reduce stacksizes and wear of virtual items on update instead of leaving the previous configuration in

This commit is contained in:
Tim 2015-01-26 19:34:43 +01:00
parent d3110a9e20
commit 827d049789

@ -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