From 827d049789f0b225cf7885087c2b0a3a2292dcd9 Mon Sep 17 00:00:00 2001 From: Tim Date: Mon, 26 Jan 2015 19:34:43 +0100 Subject: reduce stacksizes and wear of virtual items on update instead of leaving the previous configuration in --- autocrafter.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'autocrafter.lua') 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 -- cgit v1.2.3