diff options
author | Tim <idn.inbox@yahoo.com> | 2013-10-07 17:10:02 +0200 |
---|---|---|
committer | Tim <idn.inbox@yahoo.com> | 2013-10-07 17:10:02 +0200 |
commit | a938a10c6648ef1c81acafcb325770f75ecdee4b (patch) | |
tree | c28d84eb9958713cf7867d825ebba2a92fbcf9e5 | |
parent | 7ad4c806fed4e1068d9966ecd4ea956f406f804e (diff) |
add compatibility between shared chest and pipeworks mod
-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({ |