diff options
-rw-r--r-- | chest.lua | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -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({ |