From 7d80eb8f3fe9a6a438b9d8d348fc303084284e0e Mon Sep 17 00:00:00 2001 From: Milan2018 Date: Wed, 3 Jun 2020 13:51:03 +0200 Subject: [PATCH] =?UTF-8?q?Aktualizovat=20=E2=80=9Ebasic=5Fmachines/recycl?= =?UTF-8?q?er.lua=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- basic_machines/recycler.lua | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) 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} + }, })