summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--autocrafter.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/autocrafter.lua b/autocrafter.lua
index de8dbae..ad32065 100644
--- a/autocrafter.lua
+++ b/autocrafter.lua
@@ -85,8 +85,11 @@ local function update_autocrafter(pos)
if meta:get_string("virtual_items") == "" then
meta:set_string("virtual_items", "1")
local inv = meta:get_inventory()
- for _, stack in ipairs(inv:get_list("recipe")) do
+ for idx, stack in ipairs(inv:get_list("recipe")) do
minetest.item_drop(stack, "", pos)
+ stack:set_count(1)
+ stack:set_wear(0)
+ inv:set_stack("recipe", idx, stack)
end
end
end