diff --git a/basic_machines/recycler.lua b/basic_machines/recycler.lua index e80fea7..c725e79 100644 --- a/basic_machines/recycler.lua +++ b/basic_machines/recycler.lua @@ -166,7 +166,7 @@ end minetest.register_node("basic_machines:recycler", { description = "Recycler - use to get some ingredients back from crafted things", tiles = {"recycler.png"}, - groups = {cracky=3, mesecon_effector_on = 1}, + groups = {cracky=3, mesecon_effector_on = 1, tubedevice = 1, tubedevice_receiver = 1}, sounds = default.node_sound_wood_defaults(), after_place_node = function(pos, placer) local meta = minetest.get_meta(pos); @@ -230,6 +230,28 @@ minetest.register_node("basic_machines:recycler", { recycler_update_meta(pos); end, + tube = { + insert_object = function(pos, node, stack, direction) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + 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 + 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} + }, })