From aded3b0d470fde10e94841bddaaec580bf344b35 Mon Sep 17 00:00:00 2001 From: Milan2018 Date: Mon, 16 Mar 2020 21:40:01 +0100 Subject: [PATCH] =?UTF-8?q?Zm=C4=9Bnit=20"protector/doors=5Fchest.lua"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protector/doors_chest.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/protector/doors_chest.lua b/protector/doors_chest.lua index 6d4408b..d25a74a 100644 --- a/protector/doors_chest.lua +++ b/protector/doors_chest.lua @@ -597,6 +597,24 @@ minetest.register_node("protector:chest", { end, on_blast = function() 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} + }, }) -- Protected Chest formspec buttons