mirror of
https://github.com/minetest-mods/moreblocks.git
synced 2024-12-27 11:10:21 +01:00
Merge pull request #6 from CraigyDavi/saw-duplication-fix
Circular saw: Prevent microblocks from duplicating
This commit is contained in:
commit
34652642fc
@ -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:
|
-- Only accept certain blocks as input which are known to be craftable into stairs:
|
||||||
if listname == "input" then
|
if listname == "input" then
|
||||||
if not inv:is_empty("input") and
|
if not inv:is_empty("input") then
|
||||||
inv:get_stack("input", index):get_name() ~= stackname then
|
if inv:get_stack("input", index):get_name() ~= stackname then
|
||||||
return 0
|
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
|
end
|
||||||
for name, t in pairs(circular_saw.known_nodes) do
|
for name, t in pairs(circular_saw.known_nodes) do
|
||||||
if name == stackname and inv:room_for_item("input", stack) then
|
if name == stackname and inv:room_for_item("input", stack) then
|
||||||
|
Loading…
Reference in New Issue
Block a user