diff options
author | VanessaE <vanessaezekowitz@gmail.com> | 2013-01-19 23:14:44 -0800 |
---|---|---|
committer | VanessaE <vanessaezekowitz@gmail.com> | 2013-01-19 23:14:44 -0800 |
commit | a2fc5547001399fdfd2f6a2c2746c01b0f97244f (patch) | |
tree | d8ef1771360846029d81c47b716104a920ef6bf1 /autocrafter.lua | |
parent | f854d96c18f0a0ab2bf931b6d6a9c11f24cdb0b9 (diff) | |
parent | 47597910344754199f1400d57262ebaf1e705411 (diff) |
Merge pull request #11 from Novatux/master
Fixed a bug where autocrafter could be used to clone items.
Diffstat (limited to 'autocrafter.lua')
-rw-r--r-- | autocrafter.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/autocrafter.lua b/autocrafter.lua index 71aeccf..9469b7d 100644 --- a/autocrafter.lua +++ b/autocrafter.lua @@ -4,6 +4,9 @@ function autocraft(inventory) local recipe=inventory:get_list("recipe") local result local new + for i=1,9 do + recipe[i]=ItemStack({name=recipe[i]:get_name(),count=1}) + end result,new=minetest.get_craft_result({method="normal",width=3,items=recipe}) local input=inventory:get_list("input") if result.item:is_empty() then return end @@ -28,7 +31,9 @@ function autocraft(inventory) inventory:remove_item("src",stack) end inventory:add_item("dst",result) - print(dump(new)) + for i=1,9 do + inventory:add_item("dst",new.items[i]) + end end minetest.register_node("pipeworks:autocrafter",{ |