diff options
author | Calinou <Calinou@users.noreply.github.com> | 2015-06-15 21:38:07 +0200 |
---|---|---|
committer | Calinou <Calinou@users.noreply.github.com> | 2015-06-15 21:38:07 +0200 |
commit | 34652642fc271f21a0c516001b09c71d11e9277d (patch) | |
tree | 74b2df4a48c78ad19ca6c5e5043d4482f0bad39e /circular_saw.lua | |
parent | 7da13d56b6c86951ee23f640bf077847532fa0c4 (diff) | |
parent | 56a9c885ff5054e69fb460662ecb14a9d9877e26 (diff) |
Merge pull request #6 from CraigyDavi/saw-duplication-fix
Circular saw: Prevent microblocks from duplicating
Diffstat (limited to 'circular_saw.lua')
-rw-r--r-- | circular_saw.lua | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/circular_saw.lua b/circular_saw.lua index 142a95f..d7bd35c 100644 --- a/circular_saw.lua +++ b/circular_saw.lua @@ -233,9 +233,17 @@ function circular_saw.allow_metadata_inventory_put( -- Only accept certain blocks as input which are known to be craftable into stairs: if listname == "input" then - if not inv:is_empty("input") and - inv:get_stack("input", index):get_name() ~= stackname then - return 0 + if not inv:is_empty("input") then + if inv:get_stack("input", index):get_name() ~= stackname then + return 0 + end + end + if not inv:is_empty("micro") then + local microstackname = inv:get_stack("micro", 1):get_name():gsub("^.+:micro_", "", 1) + local cutstackname = stackname:gsub("^.+:", "", 1) + if microstackname ~= cutstackname then + return 0 + end end for name, t in pairs(circular_saw.known_nodes) do if name == stackname and inv:room_for_item("input", stack) then |