summaryrefslogtreecommitdiff
path: root/autocrafter.lua
diff options
context:
space:
mode:
authorTim <t4im@users.noreply.github.com>2015-01-28 16:51:07 +0100
committerTim <t4im@users.noreply.github.com>2015-01-28 16:51:07 +0100
commitd75e1a214af2c59c88eda6c2fa8c1f70dd3df7b6 (patch)
tree4cd295dd8668a712e07610967e0f9580e2c86b01 /autocrafter.lua
parenta74c2212ab1e3eae7280a9071198cd87d2d4b216 (diff)
downloadpipeworks-d75e1a214af2c59c88eda6c2fa8c1f70dd3df7b6.tar
pipeworks-d75e1a214af2c59c88eda6c2fa8c1f70dd3df7b6.tar.gz
pipeworks-d75e1a214af2c59c88eda6c2fa8c1f70dd3df7b6.tar.bz2
pipeworks-d75e1a214af2c59c88eda6c2fa8c1f70dd3df7b6.tar.xz
pipeworks-d75e1a214af2c59c88eda6c2fa8c1f70dd3df7b6.zip
allow virtual item moving from output to the recipe grid
Diffstat (limited to 'autocrafter.lua')
-rw-r--r--autocrafter.lua21
1 files changed, 12 insertions, 9 deletions
diff --git a/autocrafter.lua b/autocrafter.lua
index 4b51d01..1233497 100644
--- a/autocrafter.lua
+++ b/autocrafter.lua
@@ -263,18 +263,21 @@ minetest.register_node("pipeworks:autocrafter", {
on_output_change(pos, inv, stack)
return 0
elseif from_list == "output" then
- on_output_change(pos, inv, nil)
- return 0
+ inv:set_list("output", {})
+ inv:set_list("recipe", {})
+ if to_list ~= "recipe" then
+ return 0
+ end -- else fall through to recipe list handling
end
- if from_list == "recipe" then
- inv:set_stack(from_list, from_index, ItemStack(""))
- end
- if to_list == "recipe" then
- stack:set_count(1)
- inv:set_stack(to_list, to_index, stack)
- end
if from_list == "recipe" or to_list == "recipe" then
+ if from_list == "recipe" then
+ inv:set_stack(from_list, from_index, ItemStack(""))
+ end
+ if to_list == "recipe" then
+ stack:set_count(1)
+ inv:set_stack(to_list, to_index, stack)
+ end
after_recipe_change(pos, inv)
return 0
end