-- Doors that are especially useful for travelnet elevators but can also be used in other situations. -- All doors (not only these here) in front of a travelnet or elevator are opened automaticly when a player arrives -- and are closed when a player departs from the travelnet or elevator. -- Autor: Sokomine local node_box_open = { type = "fixed" , fixed = { { -0.90, -0.50, 0.40, -0.49, 1.50, 0.50 } , { 0.49, -0.50, 0.40, 0.90, 1.50, 0.50 } , } } local node_box_closed = { type = "fixed" , fixed = { { -0.50, -0.50, 0.40, -0.01, 1.50, 0.50 } , { 0.01, -0.50, 0.40, 0.50, 1.50, 0.50 } , } } local selection_box_open = { type = "fixed" , fixed = { { -0.90, -0.50, 0.40, 0.90, 1.50, 0.50 } , } } local selection_box_closed = { type = "fixed" , fixed = { { -0.50, -0.50, 0.40, 0.50, 1.50, 0.50 } , } } minetest.register_node ("travelnet:elevator_door_steel_open", { description = "elevator door (open)", drawtype = "nodebox", -- top, bottom, side1, side2, inner, outer tiles = {"default_stone.png"}, paramtype = "light", paramtype2 = "facedir", is_ground_content = true, groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,not_in_creative_inventory=1}, drop = "travelnet:elevator_door_steel_closed", -- larger than one node but slightly smaller than a half node so that wallmounted torches pose no problem node_box = node_box_open , selection_box = selection_box_open , on_rightclick = function (pos, node, puncher) minetest.add_node (pos, { name = "travelnet:elevator_door_steel_closed" , param2 = node.param2 }) end }) minetest.register_node("travelnet:elevator_door_steel_closed", { description = "elevator door (closed)", drawtype = "nodebox", -- top, bottom, side1, side2, inner, outer tiles = {"default_stone.png"}, paramtype = "light", paramtype2 = "facedir", is_ground_content = true, groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, node_box = node_box_closed , selection_box = selection_box_closed , on_rightclick = function (pos, node, puncher) minetest.add_node (pos, { name = "travelnet:elevator_door_steel_open" , param2 = node.param2 , }) end , }) minetest.register_node("travelnet:elevator_door_glass_open", { description = "elevator door (open)", drawtype = "nodebox", -- top, bottom, side1, side2, inner, outer tiles = {"travelnet_elevator_door_glass.png"}, paramtype = "light", paramtype2 = "facedir", is_ground_content = true, groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,not_in_creative_inventory=1}, drop = "travelnet:elevator_door_glass_closed" , -- larger than one node but slightly smaller than a half node so that wallmounted torches pose no problem node_box = node_box_open , selection_box = selection_box_open , on_rightclick = function (pos, node, puncher) minetest.add_node (pos, { name = "travelnet:elevator_door_glass_closed" , param2 = node.param2 , }) end , }) minetest.register_node("travelnet:elevator_door_glass_closed", { description = "elevator door (closed)", drawtype = "nodebox", -- top, bottom, side1, side2, inner, outer tiles = {"travelnet_elevator_door_glass.png"}, paramtype = "light", paramtype2 = "facedir", is_ground_content = true, groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, node_box = node_box_closed , selection_box = selection_box_closed , on_rightclick = function(pos, node, puncher) minetest.add_node (pos, { name = "travelnet:elevator_door_glass_open" , param2 = node.param2 }) end , }) minetest.register_craft({ output = "travelnet:elevator_door_glass_closed", recipe = { {"default:glass", "", "default:glass", }, {"default:glass", "", "default:glass", }, {"default:glass", "", "default:glass", } } }) minetest.register_craft({ output = "travelnet:elevator_door_steel_closed", recipe = { {"default:steel_ingot", "", "default:steel_ingot", }, {"default:steel_ingot", "", "default:steel_ingot", }, {"default:steel_ingot", "", "default:steel_ingot", } } }) minetest.register_node("travelnet:elevator_door_tin_open", { description = "elevator door (open)", drawtype = "nodebox", -- top, bottom, side1, side2, inner, outer tiles = { "default_clay.png" } , paramtype = "light", paramtype2 = "facedir", is_ground_content = true, groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,not_in_creative_inventory=1}, drop = "travelnet:elevator_door_tin_closed" , -- larger than one node but slightly smaller than a half node so that wallmounted torches pose no problem node_box = node_box_open , selection_box = selection_box_open , on_rightclick = function (pos, node, puncher) minetest.add_node (pos, { name = "travelnet:elevator_door_tin_closed" , param2 = node.param2 }) end }) minetest.register_node("travelnet:elevator_door_tin_closed", { description = "elevator door (closed)", drawtype = "nodebox", -- top, bottom, side1, side2, inner, outer tiles = { "default_clay.png" } , paramtype = "light", paramtype2 = "facedir", is_ground_content = true, groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, node_box = node_box_closed , selection_box = selection_box_closed , on_rightclick = function(pos, node, puncher) minetest.add_node(pos, {name = "travelnet:elevator_door_tin_open", param2 = node.param2}) end })