From 3b42ddd002a4d561ffbee04b4816b9603eef757e Mon Sep 17 00:00:00 2001 From: Milan2018 Date: Tue, 17 Mar 2020 17:04:18 +0100 Subject: [PATCH] =?UTF-8?q?Zm=C4=9Bnit=20"basic=5Fmachines/constructor.lua?= =?UTF-8?q?"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- basic_machines/constructor.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/basic_machines/constructor.lua b/basic_machines/constructor.lua index b9d059c..afeb95a 100644 --- a/basic_machines/constructor.lua +++ b/basic_machines/constructor.lua @@ -205,6 +205,23 @@ minetest.register_node("basic_machines:constructor", { constructor_update_meta(pos); end, + tube = { + insert_object = function(pos, node, stack, direction) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + return inv:add_item("main", stack) + end, + can_insert = function(pos, node, stack, direction) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + if meta:get_int("split_material_stacks") == 1 then + stack = stack:peek_item(1) + end + return inv:room_for_item("main", stack) + end, + input_inventory = "main", + connect_sides = {left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1} + }, })