diff --git a/basic_machines/grinder.lua b/basic_machines/grinder.lua index e8defa8..eff0193 100644 --- a/basic_machines/grinder.lua +++ b/basic_machines/grinder.lua @@ -218,7 +218,36 @@ minetest.register_node("basic_machines:grinder", { end grinder_update_meta(pos); 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} + }, })