summaryrefslogtreecommitdiff
path: root/autocrafter.lua
diff options
context:
space:
mode:
authorTim <t4im@users.noreply.github.com>2015-01-26 19:34:43 +0100
committerTim <t4im@users.noreply.github.com>2015-01-27 23:41:46 +0100
commit827d049789f0b225cf7885087c2b0a3a2292dcd9 (patch)
tree6dd536fd4ce33dc8bac2ecc315a888de636ad24e /autocrafter.lua
parentd3110a9e20b3889adc54cb2e0aedf45d71cdeae8 (diff)
downloadpipeworks-827d049789f0b225cf7885087c2b0a3a2292dcd9.tar
pipeworks-827d049789f0b225cf7885087c2b0a3a2292dcd9.tar.gz
pipeworks-827d049789f0b225cf7885087c2b0a3a2292dcd9.tar.bz2
pipeworks-827d049789f0b225cf7885087c2b0a3a2292dcd9.tar.xz
pipeworks-827d049789f0b225cf7885087c2b0a3a2292dcd9.zip
reduce stacksizes and wear of virtual items on update instead of leaving the previous configuration in
Diffstat (limited to 'autocrafter.lua')
-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