Změnit "basic_machines/grinder.lua"

This commit is contained in:
Milan2018 2020-03-16 21:25:46 +01:00
parent db8fa06bb9
commit e5cb2f8a92

View file

@ -218,7 +218,36 @@ minetest.register_node("basic_machines:grinder", {
end end
grinder_update_meta(pos); grinder_update_meta(pos);
end, end,
tube = {
insert_object = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local timer = minetest.get_node_timer(pos)
if not timer:is_started() then
timer:start(1.0)
end
if direction.y == 1 then
return inv:add_item("fuel", stack)
else
return inv:add_item("src", stack)
end
end,
can_insert = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if direction.y == 1 then
return inv:room_for_item("fuel", stack)
else
if meta:get_int("split_material_stacks") == 1 then
stack = stack:peek_item(1)
end
return inv:room_for_item("src", stack)
end
end,
input_inventory = "dst",
connect_sides = {left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1}
},
}) })