diff --git a/forestry_bees/apiary.lua b/forestry_bees/apiary.lua index 75b8a1f..dd32f8b 100644 --- a/forestry_bees/apiary.lua +++ b/forestry_bees/apiary.lua @@ -246,7 +246,7 @@ minetest.register_node("forestry_bees:apiary", apply_logger({ "forestry_bees_apiary_side.png", "forestry_bees_apiary_side.png" }, paramtype2 = "facedir", - groups = {choppy=2}, + groups = {choppy=2, oddly_breakable_by_hand=2, tubedevice = 1, tubedevice_receiver = 1}, legacy_facedir_simple = true, is_ground_content = false, sounds = default.node_sound_wood_defaults(), @@ -284,6 +284,31 @@ minetest.register_node("forestry_bees:apiary", apply_logger({ minetest.remove_node(pos) return drops end, + + tube = { + insert_object = function(pos, node, stack, direction) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + if minetest.get_item_group(stack:get_name(),"bee_drone") == 1 then + return inv:add_item('drone', stack) + end + if minetest.get_item_group(stack:get_name(),"bee_monarch") == 1 then + return inv:add_item('monarch', stack) + end + end, + can_insert = function(pos, node, stack, direction) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + if minetest.get_item_group(stack:get_name(),"bee_drone") == 1 then + return inv:room_for_item('drone', stack) + end + if minetest.get_item_group(stack:get_name(),"bee_monarch") == 1 then + return inv:room_for_item('monarch', stack) + end + end, + input_inventory = 'dst', + connect_sides = {left = 1, right = 1, front = 1, back = 1, bottom = 1, top = 1} + }, allow_metadata_inventory_put = allow_metadata_inventory_put, allow_metadata_inventory_move = allow_metadata_inventory_move,