Work Table : prevent cutting to different micronodes when the outputstack is already filled

This commit is contained in:
jp 2015-08-06 18:08:18 +02:00
parent b887a4bd0c
commit 428ecec29b
2 changed files with 7 additions and 5 deletions

View File

@ -50,7 +50,6 @@ xdecor.register("mailbox", {
if listname == "drop" then
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if inv:room_for_item("main", stack) then return -1
else return 0 end
end

View File

@ -70,13 +70,16 @@ function worktable.fields(pos, formname, fields, sender)
for _, d in pairs(def) do
local nb, anz = d[1], d[2]
if outputcount < 99 and fields[nb] then
local outputshape = string.match(outputstack:get_name(), nb)
if nb ~= outputshape and outputcount > 0 then return end
shape = "xdecor:"..nb.."_"..string.sub(inputname, 9)
get = shape.." "..anz
if not minetest.registered_nodes[shape] then return end
inv:add_item("output", get)
inputstack:take_item()
inv:set_stack("input", 1, inputstack)
if minetest.registered_nodes[shape] then
inv:add_item("output", get)
inputstack:take_item()
inv:set_stack("input", 1, inputstack)
end
end
end
end