summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim <t4im@users.noreply.github.com>2015-01-28 00:42:22 +0100
committerTim <t4im@users.noreply.github.com>2015-01-28 00:42:22 +0100
commit3a46c1266a74408c3f5f7ba2548d3dbc92162842 (patch)
tree1b9cea4356297435918c78f066abc9c3deb0e4c0
parente92ac0f7b3588e183c1fa47c23109592e28ae04e (diff)
downloadpipeworks-3a46c1266a74408c3f5f7ba2548d3dbc92162842.tar
pipeworks-3a46c1266a74408c3f5f7ba2548d3dbc92162842.tar.gz
pipeworks-3a46c1266a74408c3f5f7ba2548d3dbc92162842.tar.bz2
pipeworks-3a46c1266a74408c3f5f7ba2548d3dbc92162842.tar.xz
pipeworks-3a46c1266a74408c3f5f7ba2548d3dbc92162842.zip
allow moving virtual items within the crafting grid
-rw-r--r--autocrafter.lua14
1 files changed, 8 insertions, 6 deletions
diff --git a/autocrafter.lua b/autocrafter.lua
index eab57b9..423eea4 100644
--- a/autocrafter.lua
+++ b/autocrafter.lua
@@ -247,16 +247,18 @@ minetest.register_node("pipeworks:autocrafter", {
stack:set_count(count)
if from_list == "recipe" then
inv:set_stack(from_list, from_index, ItemStack(""))
- after_recipe_change(pos, inv)
- return 0
- elseif to_list == "recipe" then
+ end
+ if to_list == "recipe" then
add_virtual_item(inv, to_list, to_index, stack)
+ end
+
+ if from_list == "recipe" or to_list == "recipe" then
after_recipe_change(pos, inv)
return 0
- else
- after_inventory_change(pos, inv)
- return stack:get_count()
end
+
+ after_inventory_change(pos, inv)
+ return stack:get_count()
end,
on_timer = run_autocrafter
})