summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chest.lua20
1 files changed, 18 insertions, 2 deletions
diff --git a/chest.lua b/chest.lua
index 00cd616..a328f6b 100644
--- a/chest.lua
+++ b/chest.lua
@@ -3,7 +3,7 @@
minetest.register_node("landrush:shared_chest", {
description = "Land Rush Shared Chest",
tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png", "default_chest_side.png", "default_chest_side.png", "default_chest_lock.png"},
- groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
+ groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,tubedevice=1,tubedevice_receiver=1},
legacy_facedir_simple = true,
sounds = default.node_sound_wood_defaults(),
@@ -63,7 +63,23 @@ minetest.register_node("landrush:shared_chest", {
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" takes stuff from shared chest at "..minetest.pos_to_string(pos))
- end
+ end,
+
+ tube = {
+ insert_object = function(pos, node, stack, direction)
+ local meta = minetest.env:get_meta(pos)
+ local inventory = meta:get_inventory()
+ return inventory:add_item("main",stack)
+ end,
+
+ can_insert = function(pos, node, stack, direction)
+ local meta=minetest.env:get_meta(pos)
+ local inventory = meta:get_inventory()
+ return inventory:room_for_item("main",stack)
+ end,
+ input_inventory="main",
+ connect_sides = {left=1, right=1, back=1, top=1, bottom=1},
+ }
})
minetest.register_craft({