From 94af6653fd74fa7f09aeb98bdc2aa9f15278ae7b Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Wed, 23 Jan 2013 05:45:42 -0500 Subject: [PATCH] completely rewrote all doors code to condense them into two files - one with the nodebox models, and one with the actual node definitions. In the process, cleaned up the code that handles node_ownership and protection mods. Also made the mod automatically enable either left-click or right-click to open/close a door, depending on whether the game supports it (actually it checks for the existance of an unrelated function that happened to be added at the same time as the new right-click function). Renamed some textures, duplicated all of the _lr.png textures to make it easier to register the textures in a loop and to allow for more flexible texturing. --- door_closet_mahogany.lua | 303 ----------------- door_closet_oak.lua | 303 ----------------- door_exterior_fancy.lua | 255 -------------- door_glass.lua | 225 ------------- door_glass_and_wood.lua | 248 -------------- door_glass_and_wood_mahogany.lua | 248 -------------- door_glass_and_wood_white.lua | 248 -------------- door_models.lua | 317 ++++++++++++++++++ door_nodes.lua | 268 +++++++++++++++ door_wood_plain.lua | 217 ------------ init.lua | 32 +- ...=> homedecor_door_closet_mahogany_lrb.png} | Bin .../homedecor_door_closet_mahogany_lrt.png | Bin 0 -> 437 bytes ....png => homedecor_door_closet_oak_lrb.png} | Bin textures/homedecor_door_closet_oak_lrt.png | Bin 0 -> 447 bytes ... => homedecor_door_exterior_fancy_lrb.png} | Bin .../homedecor_door_exterior_fancy_lrt.png | Bin 0 -> 305 bytes ....png => homedecor_door_wood_glass_lrb.png} | Bin textures/homedecor_door_wood_glass_lrt.png | Bin 0 -> 735 bytes ...omedecor_door_wood_glass_mahogany_lrb.png} | Bin ...homedecor_door_wood_glass_mahogany_lrt.png | Bin 0 -> 698 bytes ...> homedecor_door_wood_glass_white_lrb.png} | Bin .../homedecor_door_wood_glass_white_lrt.png | Bin 0 -> 443 bytes ....png => homedecor_door_wood_plain_lrb.png} | Bin textures/homedecor_door_wood_plain_lrt.png | Bin 0 -> 724 bytes 25 files changed, 598 insertions(+), 2066 deletions(-) delete mode 100644 door_closet_mahogany.lua delete mode 100644 door_closet_oak.lua delete mode 100644 door_exterior_fancy.lua delete mode 100644 door_glass.lua delete mode 100644 door_glass_and_wood.lua delete mode 100644 door_glass_and_wood_mahogany.lua delete mode 100644 door_glass_and_wood_white.lua create mode 100644 door_models.lua create mode 100644 door_nodes.lua delete mode 100644 door_wood_plain.lua rename textures/{homedecor_door_closet_mahogany_lr.png => homedecor_door_closet_mahogany_lrb.png} (100%) create mode 100644 textures/homedecor_door_closet_mahogany_lrt.png rename textures/{homedecor_door_closet_oak_lr.png => homedecor_door_closet_oak_lrb.png} (100%) create mode 100644 textures/homedecor_door_closet_oak_lrt.png rename textures/{homedecor_door_exterior_fancy_lr.png => homedecor_door_exterior_fancy_lrb.png} (100%) create mode 100644 textures/homedecor_door_exterior_fancy_lrt.png rename textures/{homedecor_door_wood_glass_lr.png => homedecor_door_wood_glass_lrb.png} (100%) create mode 100644 textures/homedecor_door_wood_glass_lrt.png rename textures/{homedecor_door_wood_glass_mahogany_lr.png => homedecor_door_wood_glass_mahogany_lrb.png} (100%) create mode 100644 textures/homedecor_door_wood_glass_mahogany_lrt.png rename textures/{homedecor_door_wood_glass_white_lr.png => homedecor_door_wood_glass_white_lrb.png} (100%) create mode 100644 textures/homedecor_door_wood_glass_white_lrt.png rename textures/{homedecor_door_wood_plain_lr.png => homedecor_door_wood_plain_lrb.png} (100%) create mode 100644 textures/homedecor_door_wood_plain_lrt.png diff --git a/door_closet_mahogany.lua b/door_closet_mahogany.lua deleted file mode 100644 index 8a94f2d5..00000000 --- a/door_closet_mahogany.lua +++ /dev/null @@ -1,303 +0,0 @@ --- This file supplies mahogany closet doors - --- Left-opening - -minetest.register_node("homedecor:door_closet_mahogany_top_left", { - description = "mahogany closet door top half", - drawtype = "nodebox", - tiles = { - "homedecor_door_closet_mahogany_tb.png", - "homedecor_door_closet_mahogany_tb.png", - "homedecor_door_closet_mahogany_lr.png", - "homedecor_door_closet_mahogany_lr.png", - "homedecor_door_closet_mahogany_right_top.png", - "homedecor_door_closet_mahogany_left_top.png", - }, - paramtype = "light", - paramtype2 = "facedir", - is_ground_content = true, - groups = {snappy=3, not_in_creative_inventory=1}, - sounds = default.node_sound_wood_defaults(), - walkable = true, - selection_box = { - type = "fixed", - fixed = { -0.5, -1.5, 6/16, 0.5, 0.5, 8/16} - }, - node_box = { - type = "fixed", - fixed = { - { -8/16, 5/16, 6/16, 8/16, 8/16, 8/16 }, - - { -8/16, 8/32, 13/32, 8/16, 9/32, 15/32 }, - { -8/16, 6/32, 13/32, 8/16, 7/32, 15/32 }, - { -8/16, 4/32, 13/32, 8/16, 5/32, 15/32 }, - { -8/16, 2/32, 13/32, 8/16, 3/32, 15/32 }, - { -8/16, 0/32, 13/32, 8/16, 1/32, 15/32 }, - { -8/16, -2/32, 13/32, 8/16, -1/32, 15/32 }, - { -8/16, -4/32, 13/32, 8/16, -3/32, 15/32 }, - { -8/16, -6/32, 13/32, 8/16, -5/32, 15/32 }, - { -8/16, -8/32, 13/32, 8/16, -7/32, 15/32 }, - { -8/16, -10/32, 13/32, 8/16, -9/32, 15/32 }, - { -8/16, -12/32, 13/32, 8/16, -11/32, 15/32 }, - - { -8/16, -16/32, 6/16, 8/16, -13/32, 8/16 }, - { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, - { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 } - } - }, - drop = "homedecor:door_closet_mahogany_bottom_left", - after_dig_node = function(pos, oldnode, oldmetadata, digger) - if minetest.env:get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == "homedecor:door_closet_mahogany_bottom_left" then - minetest.env:remove_node({x=pos.x, y=pos.y-1, z=pos.z}) - end - end, - on_punch = function(pos, node, puncher) - nfdir=node.param2-1 - if nfdir < 0 then nfdir = 3 end - minetest.env:add_node(pos, { name = "homedecor:door_closet_mahogany_top_right", param2=nfdir}) - minetest.env:add_node({x=pos.x, y=pos.y-1, z=pos.z}, { name = "homedecor:door_closet_mahogany_bottom_right", param2=nfdir}) - end -}) - -minetest.register_node("homedecor:door_closet_mahogany_bottom_left", { - description = "mahogany Closet Door", - drawtype = "nodebox", - tiles = { - "homedecor_door_closet_mahogany_tb.png", - "homedecor_door_closet_mahogany_tb.png", - "homedecor_door_closet_mahogany_lr.png", - "homedecor_door_closet_mahogany_lr.png", - "homedecor_door_closet_mahogany_right_bottom.png", - "homedecor_door_closet_mahogany_left_bottom.png", - }, - wield_image = "homedecor_door_closet_mahogany_left_inv.png", - inventory_image = "homedecor_door_closet_mahogany_left_inv.png", - wield_scale = {x=1,y=1,z=0.25}, - paramtype = "light", - paramtype2 = "facedir", - is_ground_content = true, - groups = {snappy=3}, - sounds = default.node_sound_wood_defaults(), - walkable = true, - selection_box = { - type = "fixed", - fixed = { -0.5, -0.5, 6/16, 0.5, 1.5, 8/16} - }, - node_box = { - type = "fixed", - fixed = { - { -8/16, 6/16, 6/16, 8/16, 8/16, 8/16}, - - { -8/16, 10/32, 13/32, 8/16, 11/32, 15/32 }, - { -8/16, 8/32, 13/32, 8/16, 9/32, 15/32 }, - { -8/16, 6/32, 13/32, 8/16, 7/32, 15/32 }, - { -8/16, 4/32, 13/32, 8/16, 5/32, 15/32 }, - { -8/16, 2/32, 13/32, 8/16, 3/32, 15/32 }, - { -8/16, 0, 13/32, 8/16, 1/32, 15/32 }, - { -8/16, -2/32, 13/32, 8/16, -1/32, 15/32 }, - { -8/16, -4/32, 13/32, 8/16, -3/32, 15/32 }, - { -8/16, -6/32, 13/32, 8/16, -5/32, 15/32 }, - { -8/16, -8/32, 13/32, 8/16, -7/32, 15/32 }, - { -8/16, -10/32, 13/32, 8/16, -9/32, 15/32 }, - - { -8/16, -16/32, 6/16, 8/16, -11/32, 8/16 }, - { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, - { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 } - } - }, - on_place = function(itemstack, placer, pointed_thing) - local pos = pointed_thing.above - local pd = true - if type(IsPlayerNodeOwner)=="function" then - if not IsPlayerNodeOwner(pos, placer:get_player_name()) and HasOwner(pos) then - minetest.chat_send_player( placer:get_player_name(), "Sorry, "..getLastOwner(pos).." owns that spot." ) - pd = false - end - end - if type(isprotect)=="function" then - pd = isprotect(5, pos, placer) - if not pd then - minetest.chat_send_player( placer:get_player_name(), "Sorry, someone owns that spot." ) - end - end - if pd then - fdir = minetest.dir_to_facedir(placer:get_look_dir()) - if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then - minetest.chat_send_player( placer:get_player_name(), 'Not enough vertical space to place a door!' ) - return - end - minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_closet_mahogany_top_left", param2=fdir}) - return minetest.item_place(itemstack, placer, pointed_thing) - end - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == "homedecor:door_closet_mahogany_top_left" then - minetest.env:remove_node({x=pos.x, y=pos.y+1, z=pos.z}) - end - end, - on_punch = function(pos, node, puncher) - nfdir=node.param2-1 - if nfdir < 0 then nfdir = 3 end - minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_closet_mahogany_top_right", param2=nfdir}) - minetest.env:add_node(pos, { name = "homedecor:door_closet_mahogany_bottom_right", param2=nfdir}) - end -}) - --- Right-opening - -minetest.register_node("homedecor:door_closet_mahogany_top_right", { - description = "mahogany closet door top half", - drawtype = "nodebox", - tiles = { - "homedecor_door_closet_mahogany_tb.png", - "homedecor_door_closet_mahogany_tb.png", - "homedecor_door_closet_mahogany_lr.png", - "homedecor_door_closet_mahogany_lr.png", - "homedecor_door_closet_mahogany_left_top.png", - "homedecor_door_closet_mahogany_right_top.png", - }, - paramtype = "light", - paramtype2 = "facedir", - is_ground_content = true, - groups = {snappy=3, not_in_creative_inventory=1}, - sounds = default.node_sound_wood_defaults(), - walkable = true, - selection_box = { - type = "fixed", - fixed = { -0.5, -1.5, 6/16, 0.5, 0.5, 8/16} - }, - node_box = { - type = "fixed", - fixed = { - { -8/16, 5/16, 6/16, 8/16, 8/16, 8/16 }, - - { -8/16, 8/32, 13/32, 8/16, 9/32, 15/32 }, - { -8/16, 6/32, 13/32, 8/16, 7/32, 15/32 }, - { -8/16, 4/32, 13/32, 8/16, 5/32, 15/32 }, - { -8/16, 2/32, 13/32, 8/16, 3/32, 15/32 }, - { -8/16, 0/32, 13/32, 8/16, 1/32, 15/32 }, - { -8/16, -2/32, 13/32, 8/16, -1/32, 15/32 }, - { -8/16, -4/32, 13/32, 8/16, -3/32, 15/32 }, - { -8/16, -6/32, 13/32, 8/16, -5/32, 15/32 }, - { -8/16, -8/32, 13/32, 8/16, -7/32, 15/32 }, - { -8/16, -10/32, 13/32, 8/16, -9/32, 15/32 }, - { -8/16, -12/32, 13/32, 8/16, -11/32, 15/32 }, - - { -8/16, -16/32, 6/16, 8/16, -13/32, 8/16 }, - { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, - { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 } - } - }, - drop = "homedecor:door_closet_mahogany_bottom_left", - after_dig_node = function(pos, oldnode, oldmetadata, digger) - if minetest.env:get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == "homedecor:door_closet_mahogany_bottom_right" then - minetest.env:remove_node({x=pos.x, y=pos.y-1, z=pos.z}) - end - end, - on_punch = function(pos, node, puncher) - nfdir=node.param2+1 - if nfdir > 3 then nfdir = 0 end - minetest.env:add_node(pos, { name = "homedecor:door_closet_mahogany_top_left", param2=nfdir}) - minetest.env:add_node({x=pos.x, y=pos.y-1, z=pos.z}, { name = "homedecor:door_closet_mahogany_bottom_left", param2=nfdir}) - end -}) - -minetest.register_node("homedecor:door_closet_mahogany_bottom_right", { - description = "mahogany Closet Door (Right-opening)", - drawtype = "nodebox", - tiles = { - "homedecor_door_closet_mahogany_tb.png", - "homedecor_door_closet_mahogany_tb.png", - "homedecor_door_closet_mahogany_lr.png", - "homedecor_door_closet_mahogany_lr.png", - "homedecor_door_closet_mahogany_left_bottom.png", - "homedecor_door_closet_mahogany_right_bottom.png", - }, - wield_image = "homedecor_door_closet_mahogany_right_inv.png", - inventory_image = "homedecor_door_closet_mahogany_right_inv.png", - wield_scale = {x=1,y=1,z=0.25}, - paramtype = "light", - paramtype2 = "facedir", - is_ground_content = true, - groups = {snappy=3}, - sounds = default.node_sound_wood_defaults(), - walkable = true, - selection_box = { - type = "fixed", - fixed = { -0.5, -0.5, 6/16, 0.5, 1.5, 8/16} - }, - node_box = { - type = "fixed", - fixed = { - { -8/16, 6/16, 6/16, 8/16, 8/16, 8/16}, - - { -8/16, 10/32, 13/32, 8/16, 11/32, 15/32 }, - { -8/16, 8/32, 13/32, 8/16, 9/32, 15/32 }, - { -8/16, 6/32, 13/32, 8/16, 7/32, 15/32 }, - { -8/16, 4/32, 13/32, 8/16, 5/32, 15/32 }, - { -8/16, 2/32, 13/32, 8/16, 3/32, 15/32 }, - { -8/16, 0, 13/32, 8/16, 1/32, 15/32 }, - { -8/16, -2/32, 13/32, 8/16, -1/32, 15/32 }, - { -8/16, -4/32, 13/32, 8/16, -3/32, 15/32 }, - { -8/16, -6/32, 13/32, 8/16, -5/32, 15/32 }, - { -8/16, -8/32, 13/32, 8/16, -7/32, 15/32 }, - { -8/16, -10/32, 13/32, 8/16, -9/32, 15/32 }, - - { -8/16, -16/32, 6/16, 8/16, -11/32, 8/16 }, - { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, - { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 } - } - }, - drop = "homedecor:door_closet_mahogany_bottom_left", - on_place = function(itemstack, placer, pointed_thing) - local pos = pointed_thing.above - local pd = true - if type(IsPlayerNodeOwner)=="function" then - if not IsPlayerNodeOwner(pos, placer:get_player_name()) and HasOwner(pos) then - minetest.chat_send_player( placer:get_player_name(), "Sorry, "..getLastOwner(pos).." owns that spot." ) - pd = false - end - end - if type(isprotect)=="function" then - pd = isprotect(5, pos, placer) - if not pd then - minetest.chat_send_player( placer:get_player_name(), "Sorry, someone owns that spot." ) - end - end - if pd then - fdir = minetest.dir_to_facedir(placer:get_look_dir()) - if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then - minetest.chat_send_player( placer:get_player_name(), 'Not enough vertical space to place a door!' ) - return - end - minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_closet_mahogany_top_right", param2=fdir}) - return minetest.item_place(itemstack, placer, pointed_thing) - end - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == "homedecor:door_closet_mahogany_top_right" then - minetest.env:remove_node({x=pos.x, y=pos.y+1, z=pos.z}) - end - end, - on_punch = function(pos, node, puncher) - nfdir=node.param2+1 - if nfdir > 3 then nfdir = 0 end - minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_closet_mahogany_top_left", param2=nfdir}) - minetest.env:add_node(pos, { name = "homedecor:door_closet_mahogany_bottom_left", param2=nfdir}) - end -}) - --- Backwards compatibility with old zlpdoors-derived 2D version --- good enough to avoid losing any items, though some doors may --- need to be dug up and placed again to correct their orientations. - -minetest.register_alias("homedecor:folding_door_mahogany_a_c", "homedecor:door_closet_mahogany_top_left") -minetest.register_alias("homedecor:folding_door_mahogany_a_o", "homedecor:door_closet_mahogany_top_right") -minetest.register_alias("homedecor:folding_door_mahogany_b_c", "homedecor:door_closet_mahogany_bottom_left") -minetest.register_alias("homedecor:folding_door_mahogany_b_o", "homedecor:door_closet_mahogany_bottom_right") -minetest.register_alias("homedecor:folding_door_mahogany_a_c_right", "homedecor:door_closet_mahogany_top_right") -minetest.register_alias("homedecor:folding_door_mahogany_a_o_right", "homedecor:door_closet_mahogany_top_left") -minetest.register_alias("homedecor:folding_door_mahogany_b_c_right", "homedecor:door_closet_mahogany_bottom_right") -minetest.register_alias("homedecor:folding_door_mahogany_b_o_right", "homedecor:door_closet_mahogany_bottom_left") -minetest.register_alias("homedecor:folding_door_mahogany", "homedecor:door_closet_mahogany_bottom_left") -minetest.register_alias("homedecor:folding_door_mahogany_right", "homedecor:door_closet_mahogany_bottom_right") diff --git a/door_closet_oak.lua b/door_closet_oak.lua deleted file mode 100644 index 14c0bcfe..00000000 --- a/door_closet_oak.lua +++ /dev/null @@ -1,303 +0,0 @@ --- This file supplies oak closet doors - --- Left-opening - -minetest.register_node("homedecor:door_closet_oak_top_left", { - description = "oak closet door top half", - drawtype = "nodebox", - tiles = { - "homedecor_door_closet_oak_tb.png", - "homedecor_door_closet_oak_tb.png", - "homedecor_door_closet_oak_lr.png", - "homedecor_door_closet_oak_lr.png", - "homedecor_door_closet_oak_right_top.png", - "homedecor_door_closet_oak_left_top.png", - }, - paramtype = "light", - paramtype2 = "facedir", - is_ground_content = true, - groups = {snappy=3, not_in_creative_inventory=1}, - sounds = default.node_sound_wood_defaults(), - walkable = true, - selection_box = { - type = "fixed", - fixed = { -0.5, -1.5, 6/16, 0.5, 0.5, 8/16} - }, - node_box = { - type = "fixed", - fixed = { - { -8/16, 5/16, 6/16, 8/16, 8/16, 8/16 }, - - { -8/16, 8/32, 13/32, 8/16, 9/32, 15/32 }, - { -8/16, 6/32, 13/32, 8/16, 7/32, 15/32 }, - { -8/16, 4/32, 13/32, 8/16, 5/32, 15/32 }, - { -8/16, 2/32, 13/32, 8/16, 3/32, 15/32 }, - { -8/16, 0/32, 13/32, 8/16, 1/32, 15/32 }, - { -8/16, -2/32, 13/32, 8/16, -1/32, 15/32 }, - { -8/16, -4/32, 13/32, 8/16, -3/32, 15/32 }, - { -8/16, -6/32, 13/32, 8/16, -5/32, 15/32 }, - { -8/16, -8/32, 13/32, 8/16, -7/32, 15/32 }, - { -8/16, -10/32, 13/32, 8/16, -9/32, 15/32 }, - { -8/16, -12/32, 13/32, 8/16, -11/32, 15/32 }, - - { -8/16, -16/32, 6/16, 8/16, -13/32, 8/16 }, - { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, - { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 } - } - }, - drop = "homedecor:door_closet_oak_bottom_left", - after_dig_node = function(pos, oldnode, oldmetadata, digger) - if minetest.env:get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == "homedecor:door_closet_oak_bottom_left" then - minetest.env:remove_node({x=pos.x, y=pos.y-1, z=pos.z}) - end - end, - on_punch = function(pos, node, puncher) - nfdir=node.param2-1 - if nfdir < 0 then nfdir = 3 end - minetest.env:add_node(pos, { name = "homedecor:door_closet_oak_top_right", param2=nfdir}) - minetest.env:add_node({x=pos.x, y=pos.y-1, z=pos.z}, { name = "homedecor:door_closet_oak_bottom_right", param2=nfdir}) - end -}) - -minetest.register_node("homedecor:door_closet_oak_bottom_left", { - description = "Oak Closet Door", - drawtype = "nodebox", - tiles = { - "homedecor_door_closet_oak_tb.png", - "homedecor_door_closet_oak_tb.png", - "homedecor_door_closet_oak_lr.png", - "homedecor_door_closet_oak_lr.png", - "homedecor_door_closet_oak_right_bottom.png", - "homedecor_door_closet_oak_left_bottom.png", - }, - wield_image = "homedecor_door_closet_oak_left_inv.png", - inventory_image = "homedecor_door_closet_oak_left_inv.png", - wield_scale = {x=1,y=1,z=0.25}, - paramtype = "light", - paramtype2 = "facedir", - is_ground_content = true, - groups = {snappy=3}, - sounds = default.node_sound_wood_defaults(), - walkable = true, - selection_box = { - type = "fixed", - fixed = { -0.5, -0.5, 6/16, 0.5, 1.5, 8/16} - }, - node_box = { - type = "fixed", - fixed = { - { -8/16, 6/16, 6/16, 8/16, 8/16, 8/16}, - - { -8/16, 10/32, 13/32, 8/16, 11/32, 15/32 }, - { -8/16, 8/32, 13/32, 8/16, 9/32, 15/32 }, - { -8/16, 6/32, 13/32, 8/16, 7/32, 15/32 }, - { -8/16, 4/32, 13/32, 8/16, 5/32, 15/32 }, - { -8/16, 2/32, 13/32, 8/16, 3/32, 15/32 }, - { -8/16, 0, 13/32, 8/16, 1/32, 15/32 }, - { -8/16, -2/32, 13/32, 8/16, -1/32, 15/32 }, - { -8/16, -4/32, 13/32, 8/16, -3/32, 15/32 }, - { -8/16, -6/32, 13/32, 8/16, -5/32, 15/32 }, - { -8/16, -8/32, 13/32, 8/16, -7/32, 15/32 }, - { -8/16, -10/32, 13/32, 8/16, -9/32, 15/32 }, - - { -8/16, -16/32, 6/16, 8/16, -11/32, 8/16 }, - { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, - { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 } - } - }, - on_place = function(itemstack, placer, pointed_thing) - local pos = pointed_thing.above - local pd = true - if type(IsPlayerNodeOwner)=="function" then - if not IsPlayerNodeOwner(pos, placer:get_player_name()) and HasOwner(pos) then - minetest.chat_send_player( placer:get_player_name(), "Sorry, "..getLastOwner(pos).." owns that spot." ) - pd = false - end - end - if type(isprotect)=="function" then - pd = isprotect(5, pos, placer) - if not pd then - minetest.chat_send_player( placer:get_player_name(), "Sorry, someone owns that spot." ) - end - end - if pd then - fdir = minetest.dir_to_facedir(placer:get_look_dir()) - if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then - minetest.chat_send_player( placer:get_player_name(), 'Not enough vertical space to place a door!' ) - return - end - minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_closet_oak_top_left", param2=fdir}) - return minetest.item_place(itemstack, placer, pointed_thing) - end - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == "homedecor:door_closet_oak_top_left" then - minetest.env:remove_node({x=pos.x, y=pos.y+1, z=pos.z}) - end - end, - on_punch = function(pos, node, puncher) - nfdir=node.param2-1 - if nfdir < 0 then nfdir = 3 end - minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_closet_oak_top_right", param2=nfdir}) - minetest.env:add_node(pos, { name = "homedecor:door_closet_oak_bottom_right", param2=nfdir}) - end -}) - --- Right-opening - -minetest.register_node("homedecor:door_closet_oak_top_right", { - description = "oak closet door top half", - drawtype = "nodebox", - tiles = { - "homedecor_door_closet_oak_tb.png", - "homedecor_door_closet_oak_tb.png", - "homedecor_door_closet_oak_lr.png", - "homedecor_door_closet_oak_lr.png", - "homedecor_door_closet_oak_left_top.png", - "homedecor_door_closet_oak_right_top.png", - }, - paramtype = "light", - paramtype2 = "facedir", - is_ground_content = true, - groups = {snappy=3, not_in_creative_inventory=1}, - sounds = default.node_sound_wood_defaults(), - walkable = true, - selection_box = { - type = "fixed", - fixed = { -0.5, -1.5, 6/16, 0.5, 0.5, 8/16} - }, - node_box = { - type = "fixed", - fixed = { - { -8/16, 5/16, 6/16, 8/16, 8/16, 8/16 }, - - { -8/16, 8/32, 13/32, 8/16, 9/32, 15/32 }, - { -8/16, 6/32, 13/32, 8/16, 7/32, 15/32 }, - { -8/16, 4/32, 13/32, 8/16, 5/32, 15/32 }, - { -8/16, 2/32, 13/32, 8/16, 3/32, 15/32 }, - { -8/16, 0/32, 13/32, 8/16, 1/32, 15/32 }, - { -8/16, -2/32, 13/32, 8/16, -1/32, 15/32 }, - { -8/16, -4/32, 13/32, 8/16, -3/32, 15/32 }, - { -8/16, -6/32, 13/32, 8/16, -5/32, 15/32 }, - { -8/16, -8/32, 13/32, 8/16, -7/32, 15/32 }, - { -8/16, -10/32, 13/32, 8/16, -9/32, 15/32 }, - { -8/16, -12/32, 13/32, 8/16, -11/32, 15/32 }, - - { -8/16, -16/32, 6/16, 8/16, -13/32, 8/16 }, - { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, - { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 } - } - }, - drop = "homedecor:door_closet_oak_bottom_left", - after_dig_node = function(pos, oldnode, oldmetadata, digger) - if minetest.env:get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == "homedecor:door_closet_oak_bottom_right" then - minetest.env:remove_node({x=pos.x, y=pos.y-1, z=pos.z}) - end - end, - on_punch = function(pos, node, puncher) - nfdir=node.param2+1 - if nfdir > 3 then nfdir = 0 end - minetest.env:add_node(pos, { name = "homedecor:door_closet_oak_top_left", param2=nfdir}) - minetest.env:add_node({x=pos.x, y=pos.y-1, z=pos.z}, { name = "homedecor:door_closet_oak_bottom_left", param2=nfdir}) - end -}) - -minetest.register_node("homedecor:door_closet_oak_bottom_right", { - description = "Oak Closet Door (Right-opening)", - drawtype = "nodebox", - tiles = { - "homedecor_door_closet_oak_tb.png", - "homedecor_door_closet_oak_tb.png", - "homedecor_door_closet_oak_lr.png", - "homedecor_door_closet_oak_lr.png", - "homedecor_door_closet_oak_left_bottom.png", - "homedecor_door_closet_oak_right_bottom.png", - }, - wield_image = "homedecor_door_closet_oak_right_inv.png", - inventory_image = "homedecor_door_closet_oak_right_inv.png", - wield_scale = {x=1,y=1,z=0.25}, - paramtype = "light", - paramtype2 = "facedir", - is_ground_content = true, - groups = {snappy=3}, - sounds = default.node_sound_wood_defaults(), - walkable = true, - selection_box = { - type = "fixed", - fixed = { -0.5, -0.5, 6/16, 0.5, 1.5, 8/16} - }, - node_box = { - type = "fixed", - fixed = { - { -8/16, 6/16, 6/16, 8/16, 8/16, 8/16}, - - { -8/16, 10/32, 13/32, 8/16, 11/32, 15/32 }, - { -8/16, 8/32, 13/32, 8/16, 9/32, 15/32 }, - { -8/16, 6/32, 13/32, 8/16, 7/32, 15/32 }, - { -8/16, 4/32, 13/32, 8/16, 5/32, 15/32 }, - { -8/16, 2/32, 13/32, 8/16, 3/32, 15/32 }, - { -8/16, 0, 13/32, 8/16, 1/32, 15/32 }, - { -8/16, -2/32, 13/32, 8/16, -1/32, 15/32 }, - { -8/16, -4/32, 13/32, 8/16, -3/32, 15/32 }, - { -8/16, -6/32, 13/32, 8/16, -5/32, 15/32 }, - { -8/16, -8/32, 13/32, 8/16, -7/32, 15/32 }, - { -8/16, -10/32, 13/32, 8/16, -9/32, 15/32 }, - - { -8/16, -16/32, 6/16, 8/16, -11/32, 8/16 }, - { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, - { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 } - } - }, - drop = "homedecor:door_closet_oak_bottom_left", - on_place = function(itemstack, placer, pointed_thing) - local pos = pointed_thing.above - local pd = true - if type(IsPlayerNodeOwner)=="function" then - if not IsPlayerNodeOwner(pos, placer:get_player_name()) and HasOwner(pos) then - minetest.chat_send_player( placer:get_player_name(), "Sorry, "..getLastOwner(pos).." owns that spot." ) - pd = false - end - end - if type(isprotect)=="function" then - pd = isprotect(5, pos, placer) - if not pd then - minetest.chat_send_player( placer:get_player_name(), "Sorry, someone owns that spot." ) - end - end - if pd then - fdir = minetest.dir_to_facedir(placer:get_look_dir()) - if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then - minetest.chat_send_player( placer:get_player_name(), 'Not enough vertical space to place a door!' ) - return - end - minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_closet_oak_top_right", param2=fdir}) - return minetest.item_place(itemstack, placer, pointed_thing) - end - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == "homedecor:door_closet_oak_top_right" then - minetest.env:remove_node({x=pos.x, y=pos.y+1, z=pos.z}) - end - end, - on_punch = function(pos, node, puncher) - nfdir=node.param2+1 - if nfdir > 3 then nfdir = 0 end - minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_closet_oak_top_left", param2=nfdir}) - minetest.env:add_node(pos, { name = "homedecor:door_closet_oak_bottom_left", param2=nfdir}) - end -}) - --- Backwards compatibility with old zlpdoors-derived 2D version --- good enough to avoid losing any items, though some doors may --- need to be dug up and placed again to correct their orientations. - -minetest.register_alias("homedecor:folding_door_oak_a_c", "homedecor:door_closet_oak_top_left") -minetest.register_alias("homedecor:folding_door_oak_a_o", "homedecor:door_closet_oak_top_right") -minetest.register_alias("homedecor:folding_door_oak_b_c", "homedecor:door_closet_oak_bottom_left") -minetest.register_alias("homedecor:folding_door_oak_b_o", "homedecor:door_closet_oak_bottom_right") -minetest.register_alias("homedecor:folding_door_oak_a_c_right", "homedecor:door_closet_oak_top_right") -minetest.register_alias("homedecor:folding_door_oak_a_o_right", "homedecor:door_closet_oak_top_left") -minetest.register_alias("homedecor:folding_door_oak_b_c_right", "homedecor:door_closet_oak_bottom_right") -minetest.register_alias("homedecor:folding_door_oak_b_o_right", "homedecor:door_closet_oak_bottom_left") -minetest.register_alias("homedecor:folding_door_oak", "homedecor:door_closet_oak_bottom_left") -minetest.register_alias("homedecor:folding_door_oak_right", "homedecor:door_closet_oak_bottom_right") diff --git a/door_exterior_fancy.lua b/door_exterior_fancy.lua deleted file mode 100644 index 8be5fbff..00000000 --- a/door_exterior_fancy.lua +++ /dev/null @@ -1,255 +0,0 @@ --- This file supplies Fancy Exterior wood doors with frosted glass insert --- --- Textures derived from... --- http://commons.wikimedia.org/wiki/File:Front_door_of_Morey_Mansion.jpg --- ...plus the standard Minetest logo. - --- Left-opening - -minetest.register_node("homedecor:door_exterior_fancy_top_left", { - description = "wood/glass door top half", - drawtype = "nodebox", - tiles = { - "homedecor_door_exterior_fancy_tb.png", - "homedecor_door_exterior_fancy_tb.png", - "homedecor_door_exterior_fancy_lr.png", - "homedecor_door_exterior_fancy_lr.png", - "homedecor_door_exterior_fancy_right_top.png", - "homedecor_door_exterior_fancy_left_top.png", - }, - paramtype = "light", - paramtype2 = "facedir", - is_ground_content = true, - groups = {snappy=3, not_in_creative_inventory=1}, - sounds = default.node_sound_wood_defaults(), - walkable = true, - selection_box = { - type = "fixed", - fixed = { -0.5, -1.5, 6/16, 0.5, 0.5, 8/16} - }, - node_box = { - type = "fixed", - fixed = { - { -8/16, 6/16, 6/16, 8/16, 8/16, 8/16 }, - { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, - { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, - { -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 } - } - }, - drop = "homedecor:door_exterior_fancy_bottom_left", - after_dig_node = function(pos, oldnode, oldmetadata, digger) - if minetest.env:get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == "homedecor:door_exterior_fancy_bottom_left" then - minetest.env:remove_node({x=pos.x, y=pos.y-1, z=pos.z}) - end - end, - on_punch = function(pos, node, puncher) - nfdir=node.param2-1 - if nfdir < 0 then nfdir = 3 end - minetest.env:add_node(pos, { name = "homedecor:door_exterior_fancy_top_right", param2=nfdir}) - minetest.env:add_node({x=pos.x, y=pos.y-1, z=pos.z}, { name = "homedecor:door_exterior_fancy_bottom_right", param2=nfdir}) - end -}) - -minetest.register_node("homedecor:door_exterior_fancy_bottom_left", { - description = "Wood and Glass Grid-Style Door", - drawtype = "nodebox", - tiles = { - "homedecor_door_exterior_fancy_tb.png", - "homedecor_door_exterior_fancy_tb.png", - "homedecor_door_exterior_fancy_lr.png", - "homedecor_door_exterior_fancy_lr.png", - "homedecor_door_exterior_fancy_right_bottom.png", - "homedecor_door_exterior_fancy_left_bottom.png", - }, - wield_image = "homedecor_door_exterior_fancy_left_inv.png", - inventory_image = "homedecor_door_exterior_fancy_left_inv.png", - wield_scale = {x=1,y=1,z=0.25}, - paramtype = "light", - paramtype2 = "facedir", - is_ground_content = true, - groups = {snappy=3}, - sounds = default.node_sound_wood_defaults(), - walkable = true, - selection_box = { - type = "fixed", - fixed = { -0.5, -0.5, 6/16, 0.5, 1.5, 8/16} - }, - node_box = { - type = "fixed", - fixed = { - { -8/16, -8/16, 6/16, 8/16, 6/16, 8/16 }, - { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, - { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, - { -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 } - } - }, - on_place = function(itemstack, placer, pointed_thing) - local pos = pointed_thing.above - local pd = true - if type(IsPlayerNodeOwner)=="function" then - if not IsPlayerNodeOwner(pos, placer:get_player_name()) and HasOwner(pos) then - minetest.chat_send_player( placer:get_player_name(), "Sorry, "..getLastOwner(pos).." owns that spot." ) - pd = false - end - end - if type(isprotect)=="function" then - pd = isprotect(5, pos, placer) - if not pd then - minetest.chat_send_player( placer:get_player_name(), "Sorry, someone owns that spot." ) - end - end - if pd then - fdir = minetest.dir_to_facedir(placer:get_look_dir()) - if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then - minetest.chat_send_player( placer:get_player_name(), 'Not enough vertical space to place a door!' ) - return - end - minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_exterior_fancy_top_left", param2=fdir}) - return minetest.item_place(itemstack, placer, pointed_thing) - end - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == "homedecor:door_exterior_fancy_top_left" then - minetest.env:remove_node({x=pos.x, y=pos.y+1, z=pos.z}) - end - end, - on_punch = function(pos, node, puncher) - nfdir=node.param2-1 - if nfdir < 0 then nfdir = 3 end - minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_exterior_fancy_top_right", param2=nfdir}) - minetest.env:add_node(pos, { name = "homedecor:door_exterior_fancy_bottom_right", param2=nfdir}) - end -}) - --- Right-opening - -minetest.register_node("homedecor:door_exterior_fancy_top_right", { - description = "wood/glass door top half", - drawtype = "nodebox", - tiles = { - "homedecor_door_exterior_fancy_tb.png", - "homedecor_door_exterior_fancy_tb.png", - "homedecor_door_exterior_fancy_lr.png", - "homedecor_door_exterior_fancy_lr.png", - "homedecor_door_exterior_fancy_left_top.png", - "homedecor_door_exterior_fancy_right_top.png", - }, - paramtype = "light", - paramtype2 = "facedir", - is_ground_content = true, - groups = {snappy=3, not_in_creative_inventory=1}, - sounds = default.node_sound_wood_defaults(), - walkable = true, - selection_box = { - type = "fixed", - fixed = { -0.5, -1.5, 6/16, 0.5, 0.5, 8/16} - }, - node_box = { - type = "fixed", - fixed = { - { -8/16, 6/16, 6/16, 8/16, 8/16, 8/16 }, - { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, - { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, - { -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 } - } - }, - drop = "homedecor:door_exterior_fancy_bottom_left", - after_dig_node = function(pos, oldnode, oldmetadata, digger) - if minetest.env:get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == "homedecor:door_exterior_fancy_bottom_right" then - minetest.env:remove_node({x=pos.x, y=pos.y-1, z=pos.z}) - end - end, - on_punch = function(pos, node, puncher) - nfdir=node.param2+1 - if nfdir > 3 then nfdir = 0 end - minetest.env:add_node(pos, { name = "homedecor:door_exterior_fancy_top_left", param2=nfdir}) - minetest.env:add_node({x=pos.x, y=pos.y-1, z=pos.z}, { name = "homedecor:door_exterior_fancy_bottom_left", param2=nfdir}) - end -}) - -minetest.register_node("homedecor:door_exterior_fancy_bottom_right", { - description = "Wood and Glass Grid-Style Door (Right-opening)", - drawtype = "nodebox", - tiles = { - "homedecor_door_exterior_fancy_tb.png", - "homedecor_door_exterior_fancy_tb.png", - "homedecor_door_exterior_fancy_lr.png", - "homedecor_door_exterior_fancy_lr.png", - "homedecor_door_exterior_fancy_left_bottom.png", - "homedecor_door_exterior_fancy_right_bottom.png", - }, - wield_image = "homedecor_door_exterior_fancy_right_inv.png", - inventory_image = "homedecor_door_exterior_fancy_right_inv.png", - wield_scale = {x=1,y=1,z=0.25}, - paramtype = "light", - paramtype2 = "facedir", - is_ground_content = true, - groups = {snappy=3}, - sounds = default.node_sound_wood_defaults(), - walkable = true, - selection_box = { - type = "fixed", - fixed = { -0.5, -0.5, 6/16, 0.5, 1.5, 8/16} - }, - node_box = { - type = "fixed", - fixed = { - { -8/16, -8/16, 6/16, 8/16, 6/16, 8/16 }, - { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, - { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, - { -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 } - } - }, - drop = "homedecor:door_exterior_fancy_bottom_left", - on_place = function(itemstack, placer, pointed_thing) - local pos = pointed_thing.above - local pd = true - if type(IsPlayerNodeOwner)=="function" then - if not IsPlayerNodeOwner(pos, placer:get_player_name()) and HasOwner(pos) then - minetest.chat_send_player( placer:get_player_name(), "Sorry, "..getLastOwner(pos).." owns that spot." ) - pd = false - end - end - if type(isprotect)=="function" then - pd = isprotect(5, pos, placer) - if not pd then - minetest.chat_send_player( placer:get_player_name(), "Sorry, someone owns that spot." ) - end - end - if pd then - fdir = minetest.dir_to_facedir(placer:get_look_dir()) - if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then - minetest.chat_send_player( placer:get_player_name(), 'Not enough vertical space to place a door!' ) - return - end - minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_exterior_fancy_top_right", param2=fdir}) - return minetest.item_place(itemstack, placer, pointed_thing) - end - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == "homedecor:door_exterior_fancy_top_right" then - minetest.env:remove_node({x=pos.x, y=pos.y+1, z=pos.z}) - end - end, - on_punch = function(pos, node, puncher) - nfdir=node.param2+1 - if nfdir > 3 then nfdir = 0 end - minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_exterior_fancy_top_left", param2=nfdir}) - minetest.env:add_node(pos, { name = "homedecor:door_exterior_fancy_bottom_left", param2=nfdir}) - end -}) - --- Backwards compatibility with old zlpdoors-derived 2D version --- good enough to avoid losing any items, though some doors may --- need to be dug up and placed again to correct their orientations. - -minetest.register_alias("homedecor:exterior_door_fancy_a_c", "homedecor:door_exterior_fancy_top_left") -minetest.register_alias("homedecor:exterior_door_fancy_a_o", "homedecor:door_exterior_fancy_top_right") -minetest.register_alias("homedecor:exterior_door_fancy_b_c", "homedecor:door_exterior_fancy_bottom_left") -minetest.register_alias("homedecor:exterior_door_fancy_b_o", "homedecor:door_exterior_fancy_bottom_right") -minetest.register_alias("homedecor:exterior_door_fancy_a_c_right", "homedecor:door_exterior_fancy_top_right") -minetest.register_alias("homedecor:exterior_door_fancy_a_o_right", "homedecor:door_exterior_fancy_top_left") -minetest.register_alias("homedecor:exterior_door_fancy_b_c_right", "homedecor:door_exterior_fancy_bottom_right") -minetest.register_alias("homedecor:exterior_door_fancy_b_o_right", "homedecor:door_exterior_fancy_bottom_left") -minetest.register_alias("homedecor:exterior_door_fancy", "homedecor:door_exterior_fancy_bottom_left") -minetest.register_alias("homedecor:exterior_door_fancy_right", "homedecor:door_exterior_fancy_bottom_right") diff --git a/door_glass.lua b/door_glass.lua deleted file mode 100644 index b71ed970..00000000 --- a/door_glass.lua +++ /dev/null @@ -1,225 +0,0 @@ --- This file supplies solid glass doors with frosted edges and metal handle - --- Left-opening - -minetest.register_node("homedecor:door_glass_top_left", { - description = "glass door top half", - drawtype = "nodebox", - tiles = { - "homedecor_door_glass_tb.png", - "homedecor_blanktile.png", - "homedecor_door_glass_lrt.png", - "homedecor_door_glass_lrt.png", - "homedecor_door_glass_right_top.png", - "homedecor_door_glass_left_top.png", - }, - paramtype = "light", - paramtype2 = "facedir", - is_ground_content = true, - groups = {snappy=3, not_in_creative_inventory=1}, - sounds = default.node_sound_wood_defaults(), - walkable = true, - selection_box = { - type = "fixed", - fixed = { -8/16, -1.5, 6/16, 8/16, 8/16, 8/16 }, - }, - node_box = { - type = "fixed", - fixed = { - { -8/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, - } - }, - drop = "homedecor:door_glass_bottom_left", - after_dig_node = function(pos, oldnode, oldmetadata, digger) - if minetest.env:get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == "homedecor:door_glass_bottom_left" then - minetest.env:remove_node({x=pos.x, y=pos.y-1, z=pos.z}) - end - end, - on_punch = function(pos, node, puncher) - nfdir=node.param2-1 - if nfdir < 0 then nfdir = 3 end - minetest.env:add_node(pos, { name = "homedecor:door_glass_top_right", param2=nfdir}) - minetest.env:add_node({x=pos.x, y=pos.y-1, z=pos.z}, { name = "homedecor:door_glass_bottom_right", param2=nfdir}) - end -}) - -minetest.register_node("homedecor:door_glass_bottom_left", { - description = "Glass Door", - drawtype = "nodebox", - tiles = { - "homedecor_blanktile.png", - "homedecor_door_glass_tb.png", - "homedecor_door_glass_lrb.png", - "homedecor_door_glass_lrb.png", - "homedecor_door_glass_right_bottom.png", - "homedecor_door_glass_left_bottom.png", - }, - wield_image = "homedecor_door_glass_left_inv.png", - inventory_image = "homedecor_door_glass_left_inv.png", - wield_scale = {x=1,y=1,z=0.25}, - paramtype = "light", - paramtype2 = "facedir", - is_ground_content = true, - groups = {snappy=3}, - sounds = default.node_sound_wood_defaults(), - walkable = true, - selection_box = { - type = "fixed", - fixed = { -8/16, -8/16, 6/16, 8/16, 1.5, 8/16 }, - }, - node_box = { - type = "fixed", - fixed = { - { -8/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, - } - }, - on_place = function(itemstack, placer, pointed_thing) - local pos = pointed_thing.above - local pd = true - if type(IsPlayerNodeOwner)=="function" then - if not IsPlayerNodeOwner(pos, placer:get_player_name()) and HasOwner(pos) then - minetest.chat_send_player( placer:get_player_name(), "Sorry, "..getLastOwner(pos).." owns that spot." ) - pd = false - end - end - if type(isprotect)=="function" then - pd = isprotect(5, pos, placer) - if not pd then - minetest.chat_send_player( placer:get_player_name(), "Sorry, someone owns that spot." ) - end - end - if pd then - fdir = minetest.dir_to_facedir(placer:get_look_dir()) - if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then - minetest.chat_send_player( placer:get_player_name(), 'Not enough vertical space to place a door!' ) - return - end - minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_glass_top_left", param2=fdir}) - return minetest.item_place(itemstack, placer, pointed_thing) - end - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == "homedecor:door_glass_top_left" then - minetest.env:remove_node({x=pos.x, y=pos.y+1, z=pos.z}) - end - end, - on_punch = function(pos, node, puncher) - nfdir=node.param2-1 - if nfdir < 0 then nfdir = 3 end - minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_glass_top_right", param2=nfdir}) - minetest.env:add_node(pos, { name = "homedecor:door_glass_bottom_right", param2=nfdir}) - end -}) - --- Right-opening - -minetest.register_node("homedecor:door_glass_top_right", { - description = "glass door top half", - drawtype = "nodebox", - tiles = { - "homedecor_door_glass_tb.png", - "homedecor_blanktile.png", - "homedecor_door_glass_lrt.png", - "homedecor_door_glass_lrt.png", - "homedecor_door_glass_left_top.png", - "homedecor_door_glass_right_top.png", - }, - paramtype = "light", - paramtype2 = "facedir", - is_ground_content = true, - groups = {snappy=3, not_in_creative_inventory=1}, - sounds = default.node_sound_wood_defaults(), - walkable = true, - selection_box = { - type = "fixed", - fixed = { -8/16, -1.5, 6/16, 8/16, 8/16, 8/16 }, - }, - node_box = { - type = "fixed", - fixed = { - { -8/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, - } - }, - drop = "homedecor:door_glass_bottom_left", - after_dig_node = function(pos, oldnode, oldmetadata, digger) - if minetest.env:get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == "homedecor:door_glass_bottom_right" then - minetest.env:remove_node({x=pos.x, y=pos.y-1, z=pos.z}) - end - end, - on_punch = function(pos, node, puncher) - nfdir=node.param2+1 - if nfdir > 3 then nfdir = 0 end - minetest.env:add_node(pos, { name = "homedecor:door_glass_top_left", param2=nfdir}) - minetest.env:add_node({x=pos.x, y=pos.y-1, z=pos.z}, { name = "homedecor:door_glass_bottom_left", param2=nfdir}) - end -}) - -minetest.register_node("homedecor:door_glass_bottom_right", { - description = "Glass Door (Right-opening)", - drawtype = "nodebox", - tiles = { - "homedecor_blanktile.png", - "homedecor_door_glass_tb.png", - "homedecor_door_glass_lrb.png", - "homedecor_door_glass_lrb.png", - "homedecor_door_glass_left_bottom.png", - "homedecor_door_glass_right_bottom.png", - }, - wield_image = "homedecor_door_glass_right_inv.png", - inventory_image = "homedecor_door_glass_right_inv.png", - wield_scale = {x=1,y=1,z=0.25}, - paramtype = "light", - paramtype2 = "facedir", - is_ground_content = true, - groups = {snappy=3}, - sounds = default.node_sound_wood_defaults(), - walkable = true, - selection_box = { - type = "fixed", - fixed = { -8/16, -8/16, 6/16, 8/16, 1.5, 8/16 }, - }, - node_box = { - type = "fixed", - fixed = { - { -8/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, - } - }, - drop = "homedecor:door_glass_bottom_left", - on_place = function(itemstack, placer, pointed_thing) - local pos = pointed_thing.above - local pd = true - if type(IsPlayerNodeOwner)=="function" then - if not IsPlayerNodeOwner(pos, placer:get_player_name()) and HasOwner(pos) then - minetest.chat_send_player( placer:get_player_name(), "Sorry, "..getLastOwner(pos).." owns that spot." ) - pd = false - end - end - if type(isprotect)=="function" then - pd = isprotect(5, pos, placer) - if not pd then - minetest.chat_send_player( placer:get_player_name(), "Sorry, someone owns that spot." ) - end - end - if pd then - fdir = minetest.dir_to_facedir(placer:get_look_dir()) - if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then - minetest.chat_send_player( placer:get_player_name(), 'Not enough vertical space to place a door!' ) - return - end - minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_glass_top_right", param2=fdir}) - return minetest.item_place(itemstack, placer, pointed_thing) - end - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == "homedecor:door_glass_top_right" then - minetest.env:remove_node({x=pos.x, y=pos.y+1, z=pos.z}) - end - end, - on_punch = function(pos, node, puncher) - nfdir=node.param2+1 - if nfdir > 3 then nfdir = 0 end - minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_glass_top_left", param2=nfdir}) - minetest.env:add_node(pos, { name = "homedecor:door_glass_bottom_left", param2=nfdir}) - end -}) - diff --git a/door_glass_and_wood.lua b/door_glass_and_wood.lua deleted file mode 100644 index 1726f26d..00000000 --- a/door_glass_and_wood.lua +++ /dev/null @@ -1,248 +0,0 @@ --- This file supplies wood-and-glass doors (Grid-style, like old windows) - --- Left-opening - -minetest.register_node("homedecor:door_wood_glass_top_left", { - description = "wood/glass door top half", - drawtype = "nodebox", - tiles = { - "homedecor_door_wood_glass_tb.png", - "homedecor_door_wood_glass_tb.png", - "homedecor_door_wood_glass_lr.png", - "homedecor_door_wood_glass_lr.png", - "homedecor_door_wood_glass_right_top.png", - "homedecor_door_wood_glass_left_top.png", - }, - paramtype = "light", - paramtype2 = "facedir", - is_ground_content = true, - groups = {snappy=3, not_in_creative_inventory=1}, - sounds = default.node_sound_wood_defaults(), - walkable = true, - selection_box = { - type = "fixed", - fixed = { -0.5, -1.5, 6/16, 0.5, 0.5, 8/16} - }, - node_box = { - type = "fixed", - fixed = { - { -8/16, 6/16, 6/16, 8/16, 8/16, 8/16 }, - { -8/16, -3/32, 6/16, 8/16, 1/32, 8/16 }, - { -8/16, -8/16, 6/16, 8/16, -7/16, 8/16 }, - { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, - { -1/16, -8/16, 6/16, 1/16, 8/16, 8/16 }, - { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, - { -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 } - } - }, - drop = "homedecor:door_wood_glass_bottom_left", - after_dig_node = function(pos, oldnode, oldmetadata, digger) - if minetest.env:get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == "homedecor:door_wood_glass_bottom_left" then - minetest.env:remove_node({x=pos.x, y=pos.y-1, z=pos.z}) - end - end, - on_punch = function(pos, node, puncher) - nfdir=node.param2-1 - if nfdir < 0 then nfdir = 3 end - minetest.env:add_node(pos, { name = "homedecor:door_wood_glass_top_right", param2=nfdir}) - minetest.env:add_node({x=pos.x, y=pos.y-1, z=pos.z}, { name = "homedecor:door_wood_glass_bottom_right", param2=nfdir}) - end -}) - -minetest.register_node("homedecor:door_wood_glass_bottom_left", { - description = "Wood and Glass Grid-Style Door", - drawtype = "nodebox", - tiles = { - "homedecor_door_wood_glass_tb.png", - "homedecor_door_wood_glass_tb.png", - "homedecor_door_wood_glass_lr.png", - "homedecor_door_wood_glass_lr.png", - "homedecor_door_wood_glass_right_bottom.png", - "homedecor_door_wood_glass_left_bottom.png", - }, - wield_image = "homedecor_door_wood_glass_left_inv.png", - inventory_image = "homedecor_door_wood_glass_left_inv.png", - wield_scale = {x=1,y=1,z=0.25}, - paramtype = "light", - paramtype2 = "facedir", - is_ground_content = true, - groups = {snappy=3}, - sounds = default.node_sound_wood_defaults(), - walkable = true, - selection_box = { - type = "fixed", - fixed = { -0.5, -0.5, 6/16, 0.5, 1.5, 8/16} - }, - node_box = { - type = "fixed", - fixed = { - { -8/16, 7/16, 6/16, 8/16, 8/16, 8/16 }, - { -8/16, -1/32, 6/16, 8/16, 3/32, 8/16 }, - { -8/16, -8/16, 6/16, 8/16, -6/16, 8/16 }, - { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, - { -1/16, -8/16, 6/16, 1/16, 8/16, 8/16 }, - { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, - { -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 } - } - }, - on_place = function(itemstack, placer, pointed_thing) - local pos = pointed_thing.above - local pd = true - if type(IsPlayerNodeOwner)=="function" then - if not IsPlayerNodeOwner(pos, placer:get_player_name()) and HasOwner(pos) then - minetest.chat_send_player( placer:get_player_name(), "Sorry, "..getLastOwner(pos).." owns that spot." ) - pd = false - end - end - if type(isprotect)=="function" then - pd = isprotect(5, pos, placer) - if not pd then - minetest.chat_send_player( placer:get_player_name(), "Sorry, someone owns that spot." ) - end - end - if pd then - fdir = minetest.dir_to_facedir(placer:get_look_dir()) - if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then - minetest.chat_send_player( placer:get_player_name(), 'Not enough vertical space to place a door!' ) - return - end - minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_wood_glass_top_left", param2=fdir}) - return minetest.item_place(itemstack, placer, pointed_thing) - end - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == "homedecor:door_wood_glass_top_left" then - minetest.env:remove_node({x=pos.x, y=pos.y+1, z=pos.z}) - end - end, - on_punch = function(pos, node, puncher) - nfdir=node.param2-1 - if nfdir < 0 then nfdir = 3 end - minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_wood_glass_top_right", param2=nfdir}) - minetest.env:add_node(pos, { name = "homedecor:door_wood_glass_bottom_right", param2=nfdir}) - end -}) - --- Right-opening - -minetest.register_node("homedecor:door_wood_glass_top_right", { - description = "wood/glass door top half", - drawtype = "nodebox", - tiles = { - "homedecor_door_wood_glass_tb.png", - "homedecor_door_wood_glass_tb.png", - "homedecor_door_wood_glass_lr.png", - "homedecor_door_wood_glass_lr.png", - "homedecor_door_wood_glass_left_top.png", - "homedecor_door_wood_glass_right_top.png", - }, - paramtype = "light", - paramtype2 = "facedir", - is_ground_content = true, - groups = {snappy=3, not_in_creative_inventory=1}, - sounds = default.node_sound_wood_defaults(), - walkable = true, - selection_box = { - type = "fixed", - fixed = { -0.5, -1.5, 6/16, 0.5, 0.5, 8/16} - }, - node_box = { - type = "fixed", - fixed = { - { -8/16, 6/16, 6/16, 8/16, 8/16, 8/16 }, - { -8/16, -3/32, 6/16, 8/16, 1/32, 8/16 }, - { -8/16, -8/16, 6/16, 8/16, -7/16, 8/16 }, - { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, - { -1/16, -8/16, 6/16, 1/16, 8/16, 8/16 }, - { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, - { -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 } - } - }, - drop = "homedecor:door_wood_glass_bottom_left", - after_dig_node = function(pos, oldnode, oldmetadata, digger) - if minetest.env:get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == "homedecor:door_wood_glass_bottom_right" then - minetest.env:remove_node({x=pos.x, y=pos.y-1, z=pos.z}) - end - end, - on_punch = function(pos, node, puncher) - nfdir=node.param2+1 - if nfdir > 3 then nfdir = 0 end - minetest.env:add_node(pos, { name = "homedecor:door_wood_glass_top_left", param2=nfdir}) - minetest.env:add_node({x=pos.x, y=pos.y-1, z=pos.z}, { name = "homedecor:door_wood_glass_bottom_left", param2=nfdir}) - end -}) - -minetest.register_node("homedecor:door_wood_glass_bottom_right", { - description = "Wood and Glass Grid-Style Door (Right-opening)", - drawtype = "nodebox", - tiles = { - "homedecor_door_wood_glass_tb.png", - "homedecor_door_wood_glass_tb.png", - "homedecor_door_wood_glass_lr.png", - "homedecor_door_wood_glass_lr.png", - "homedecor_door_wood_glass_left_bottom.png", - "homedecor_door_wood_glass_right_bottom.png", - }, - wield_image = "homedecor_door_wood_glass_right_inv.png", - inventory_image = "homedecor_door_wood_glass_right_inv.png", - wield_scale = {x=1,y=1,z=0.25}, - paramtype = "light", - paramtype2 = "facedir", - is_ground_content = true, - groups = {snappy=3}, - sounds = default.node_sound_wood_defaults(), - walkable = true, - selection_box = { - type = "fixed", - fixed = { -0.5, -0.5, 6/16, 0.5, 1.5, 8/16} - }, - node_box = { - type = "fixed", - fixed = { - { -8/16, 7/16, 6/16, 8/16, 8/16, 8/16 }, - { -8/16, -1/32, 6/16, 8/16, 3/32, 8/16 }, - { -8/16, -8/16, 6/16, 8/16, -6/16, 8/16 }, - { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, - { -1/16, -8/16, 6/16, 1/16, 8/16, 8/16 }, - { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, - { -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 } - } - }, - drop = "homedecor:door_wood_glass_bottom_left", - on_place = function(itemstack, placer, pointed_thing) - local pos = pointed_thing.above - local pd = true - if type(IsPlayerNodeOwner)=="function" then - if not IsPlayerNodeOwner(pos, placer:get_player_name()) and HasOwner(pos) then - minetest.chat_send_player( placer:get_player_name(), "Sorry, "..getLastOwner(pos).." owns that spot." ) - pd = false - end - end - if type(isprotect)=="function" then - pd = isprotect(5, pos, placer) - if not pd then - minetest.chat_send_player( placer:get_player_name(), "Sorry, someone owns that spot." ) - end - end - if pd then - fdir = minetest.dir_to_facedir(placer:get_look_dir()) - if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then - minetest.chat_send_player( placer:get_player_name(), 'Not enough vertical space to place a door!' ) - return - end - minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_wood_glass_top_right", param2=fdir}) - return minetest.item_place(itemstack, placer, pointed_thing) - end - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == "homedecor:door_wood_glass_top_right" then - minetest.env:remove_node({x=pos.x, y=pos.y+1, z=pos.z}) - end - end, - on_punch = function(pos, node, puncher) - nfdir=node.param2+1 - if nfdir > 3 then nfdir = 0 end - minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_wood_glass_top_left", param2=nfdir}) - minetest.env:add_node(pos, { name = "homedecor:door_wood_glass_bottom_left", param2=nfdir}) - end -}) diff --git a/door_glass_and_wood_mahogany.lua b/door_glass_and_wood_mahogany.lua deleted file mode 100644 index 811391b2..00000000 --- a/door_glass_and_wood_mahogany.lua +++ /dev/null @@ -1,248 +0,0 @@ --- This file supplies wood-and-glass doors (Grid-style, like old windows) - --- Left-opening - -minetest.register_node("homedecor:door_wood_glass_mahogany_top_left", { - description = "wood/glass door top half", - drawtype = "nodebox", - tiles = { - "homedecor_door_wood_glass_mahogany_tb.png", - "homedecor_door_wood_glass_mahogany_tb.png", - "homedecor_door_wood_glass_mahogany_lr.png", - "homedecor_door_wood_glass_mahogany_lr.png", - "homedecor_door_wood_glass_mahogany_right_top.png", - "homedecor_door_wood_glass_mahogany_left_top.png", - }, - paramtype = "light", - paramtype2 = "facedir", - is_ground_content = true, - groups = {snappy=3, not_in_creative_inventory=1}, - sounds = default.node_sound_wood_defaults(), - walkable = true, - selection_box = { - type = "fixed", - fixed = { -0.5, -1.5, 6/16, 0.5, 0.5, 8/16} - }, - node_box = { - type = "fixed", - fixed = { - { -8/16, 6/16, 6/16, 8/16, 8/16, 8/16 }, - { -8/16, -3/32, 6/16, 8/16, 1/32, 8/16 }, - { -8/16, -8/16, 6/16, 8/16, -7/16, 8/16 }, - { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, - { -1/16, -8/16, 6/16, 1/16, 8/16, 8/16 }, - { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, - { -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 } - } - }, - drop = "homedecor:door_wood_glass_mahogany_bottom_left", - after_dig_node = function(pos, oldnode, oldmetadata, digger) - if minetest.env:get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == "homedecor:door_wood_glass_mahogany_bottom_left" then - minetest.env:remove_node({x=pos.x, y=pos.y-1, z=pos.z}) - end - end, - on_punch = function(pos, node, puncher) - nfdir=node.param2-1 - if nfdir < 0 then nfdir = 3 end - minetest.env:add_node(pos, { name = "homedecor:door_wood_glass_mahogany_top_right", param2=nfdir}) - minetest.env:add_node({x=pos.x, y=pos.y-1, z=pos.z}, { name = "homedecor:door_wood_glass_mahogany_bottom_right", param2=nfdir}) - end -}) - -minetest.register_node("homedecor:door_wood_glass_mahogany_bottom_left", { - description = "Wood and Glass Grid-Style Door", - drawtype = "nodebox", - tiles = { - "homedecor_door_wood_glass_mahogany_tb.png", - "homedecor_door_wood_glass_mahogany_tb.png", - "homedecor_door_wood_glass_mahogany_lr.png", - "homedecor_door_wood_glass_mahogany_lr.png", - "homedecor_door_wood_glass_mahogany_right_bottom.png", - "homedecor_door_wood_glass_mahogany_left_bottom.png", - }, - wield_image = "homedecor_door_wood_glass_mahogany_left_inv.png", - inventory_image = "homedecor_door_wood_glass_mahogany_left_inv.png", - wield_scale = {x=1,y=1,z=0.25}, - paramtype = "light", - paramtype2 = "facedir", - is_ground_content = true, - groups = {snappy=3}, - sounds = default.node_sound_wood_defaults(), - walkable = true, - selection_box = { - type = "fixed", - fixed = { -0.5, -0.5, 6/16, 0.5, 1.5, 8/16} - }, - node_box = { - type = "fixed", - fixed = { - { -8/16, 7/16, 6/16, 8/16, 8/16, 8/16 }, - { -8/16, -1/32, 6/16, 8/16, 3/32, 8/16 }, - { -8/16, -8/16, 6/16, 8/16, -6/16, 8/16 }, - { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, - { -1/16, -8/16, 6/16, 1/16, 8/16, 8/16 }, - { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, - { -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 } - } - }, - on_place = function(itemstack, placer, pointed_thing) - local pos = pointed_thing.above - local pd = true - if type(IsPlayerNodeOwner)=="function" then - if not IsPlayerNodeOwner(pos, placer:get_player_name()) and HasOwner(pos) then - minetest.chat_send_player( placer:get_player_name(), "Sorry, "..getLastOwner(pos).." owns that spot." ) - pd = false - end - end - if type(isprotect)=="function" then - pd = isprotect(5, pos, placer) - if not pd then - minetest.chat_send_player( placer:get_player_name(), "Sorry, someone owns that spot." ) - end - end - if pd then - fdir = minetest.dir_to_facedir(placer:get_look_dir()) - if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then - minetest.chat_send_player( placer:get_player_name(), 'Not enough vertical space to place a door!' ) - return - end - minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_wood_glass_mahogany_top_left", param2=fdir}) - return minetest.item_place(itemstack, placer, pointed_thing) - end - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == "homedecor:door_wood_glass_mahogany_top_left" then - minetest.env:remove_node({x=pos.x, y=pos.y+1, z=pos.z}) - end - end, - on_punch = function(pos, node, puncher) - nfdir=node.param2-1 - if nfdir < 0 then nfdir = 3 end - minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_wood_glass_mahogany_top_right", param2=nfdir}) - minetest.env:add_node(pos, { name = "homedecor:door_wood_glass_mahogany_bottom_right", param2=nfdir}) - end -}) - --- Right-opening - -minetest.register_node("homedecor:door_wood_glass_mahogany_top_right", { - description = "wood/glass door top half", - drawtype = "nodebox", - tiles = { - "homedecor_door_wood_glass_mahogany_tb.png", - "homedecor_door_wood_glass_mahogany_tb.png", - "homedecor_door_wood_glass_mahogany_lr.png", - "homedecor_door_wood_glass_mahogany_lr.png", - "homedecor_door_wood_glass_mahogany_left_top.png", - "homedecor_door_wood_glass_mahogany_right_top.png", - }, - paramtype = "light", - paramtype2 = "facedir", - is_ground_content = true, - groups = {snappy=3, not_in_creative_inventory=1}, - sounds = default.node_sound_wood_defaults(), - walkable = true, - selection_box = { - type = "fixed", - fixed = { -0.5, -1.5, 6/16, 0.5, 0.5, 8/16} - }, - node_box = { - type = "fixed", - fixed = { - { -8/16, 6/16, 6/16, 8/16, 8/16, 8/16 }, - { -8/16, -3/32, 6/16, 8/16, 1/32, 8/16 }, - { -8/16, -8/16, 6/16, 8/16, -7/16, 8/16 }, - { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, - { -1/16, -8/16, 6/16, 1/16, 8/16, 8/16 }, - { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, - { -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 } - } - }, - drop = "homedecor:door_wood_glass_mahogany_bottom_left", - after_dig_node = function(pos, oldnode, oldmetadata, digger) - if minetest.env:get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == "homedecor:door_wood_glass_mahogany_bottom_right" then - minetest.env:remove_node({x=pos.x, y=pos.y-1, z=pos.z}) - end - end, - on_punch = function(pos, node, puncher) - nfdir=node.param2+1 - if nfdir > 3 then nfdir = 0 end - minetest.env:add_node(pos, { name = "homedecor:door_wood_glass_mahogany_top_left", param2=nfdir}) - minetest.env:add_node({x=pos.x, y=pos.y-1, z=pos.z}, { name = "homedecor:door_wood_glass_mahogany_bottom_left", param2=nfdir}) - end -}) - -minetest.register_node("homedecor:door_wood_glass_mahogany_bottom_right", { - description = "Wood and Glass Grid-Style Door (Right-opening)", - drawtype = "nodebox", - tiles = { - "homedecor_door_wood_glass_mahogany_tb.png", - "homedecor_door_wood_glass_mahogany_tb.png", - "homedecor_door_wood_glass_mahogany_lr.png", - "homedecor_door_wood_glass_mahogany_lr.png", - "homedecor_door_wood_glass_mahogany_left_bottom.png", - "homedecor_door_wood_glass_mahogany_right_bottom.png", - }, - wield_image = "homedecor_door_wood_glass_mahogany_right_inv.png", - inventory_image = "homedecor_door_wood_glass_mahogany_right_inv.png", - wield_scale = {x=1,y=1,z=0.25}, - paramtype = "light", - paramtype2 = "facedir", - is_ground_content = true, - groups = {snappy=3}, - sounds = default.node_sound_wood_defaults(), - walkable = true, - selection_box = { - type = "fixed", - fixed = { -0.5, -0.5, 6/16, 0.5, 1.5, 8/16} - }, - node_box = { - type = "fixed", - fixed = { - { -8/16, 7/16, 6/16, 8/16, 8/16, 8/16 }, - { -8/16, -1/32, 6/16, 8/16, 3/32, 8/16 }, - { -8/16, -8/16, 6/16, 8/16, -6/16, 8/16 }, - { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, - { -1/16, -8/16, 6/16, 1/16, 8/16, 8/16 }, - { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, - { -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 } - } - }, - drop = "homedecor:door_wood_glass_mahogany_bottom_left", - on_place = function(itemstack, placer, pointed_thing) - local pos = pointed_thing.above - local pd = true - if type(IsPlayerNodeOwner)=="function" then - if not IsPlayerNodeOwner(pos, placer:get_player_name()) and HasOwner(pos) then - minetest.chat_send_player( placer:get_player_name(), "Sorry, "..getLastOwner(pos).." owns that spot." ) - pd = false - end - end - if type(isprotect)=="function" then - pd = isprotect(5, pos, placer) - if not pd then - minetest.chat_send_player( placer:get_player_name(), "Sorry, someone owns that spot." ) - end - end - if pd then - fdir = minetest.dir_to_facedir(placer:get_look_dir()) - if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then - minetest.chat_send_player( placer:get_player_name(), 'Not enough vertical space to place a door!' ) - return - end - minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_wood_glass_mahogany_top_right", param2=fdir}) - return minetest.item_place(itemstack, placer, pointed_thing) - end - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == "homedecor:door_wood_glass_mahogany_top_right" then - minetest.env:remove_node({x=pos.x, y=pos.y+1, z=pos.z}) - end - end, - on_punch = function(pos, node, puncher) - nfdir=node.param2+1 - if nfdir > 3 then nfdir = 0 end - minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_wood_glass_mahogany_top_left", param2=nfdir}) - minetest.env:add_node(pos, { name = "homedecor:door_wood_glass_mahogany_bottom_left", param2=nfdir}) - end -}) diff --git a/door_glass_and_wood_white.lua b/door_glass_and_wood_white.lua deleted file mode 100644 index 561c8070..00000000 --- a/door_glass_and_wood_white.lua +++ /dev/null @@ -1,248 +0,0 @@ --- This file supplies wood-and-glass doors (Grid-style, like old windows) - --- Left-opening - -minetest.register_node("homedecor:door_wood_glass_white_top_left", { - description = "wood/glass door top half", - drawtype = "nodebox", - tiles = { - "homedecor_door_wood_glass_white_tb.png", - "homedecor_door_wood_glass_white_tb.png", - "homedecor_door_wood_glass_white_lr.png", - "homedecor_door_wood_glass_white_lr.png", - "homedecor_door_wood_glass_white_right_top.png", - "homedecor_door_wood_glass_white_left_top.png", - }, - paramtype = "light", - paramtype2 = "facedir", - is_ground_content = true, - groups = {snappy=3, not_in_creative_inventory=1}, - sounds = default.node_sound_wood_defaults(), - walkable = true, - selection_box = { - type = "fixed", - fixed = { -0.5, -1.5, 6/16, 0.5, 0.5, 8/16} - }, - node_box = { - type = "fixed", - fixed = { - { -8/16, 6/16, 6/16, 8/16, 8/16, 8/16 }, - { -8/16, -3/32, 6/16, 8/16, 1/32, 8/16 }, - { -8/16, -8/16, 6/16, 8/16, -7/16, 8/16 }, - { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, - { -1/16, -8/16, 6/16, 1/16, 8/16, 8/16 }, - { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, - { -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 } - } - }, - drop = "homedecor:door_wood_glass_white_bottom_left", - after_dig_node = function(pos, oldnode, oldmetadata, digger) - if minetest.env:get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == "homedecor:door_wood_glass_white_bottom_left" then - minetest.env:remove_node({x=pos.x, y=pos.y-1, z=pos.z}) - end - end, - on_punch = function(pos, node, puncher) - nfdir=node.param2-1 - if nfdir < 0 then nfdir = 3 end - minetest.env:add_node(pos, { name = "homedecor:door_wood_glass_white_top_right", param2=nfdir}) - minetest.env:add_node({x=pos.x, y=pos.y-1, z=pos.z}, { name = "homedecor:door_wood_glass_white_bottom_right", param2=nfdir}) - end -}) - -minetest.register_node("homedecor:door_wood_glass_white_bottom_left", { - description = "Wood and Glass Grid-Style Door", - drawtype = "nodebox", - tiles = { - "homedecor_door_wood_glass_white_tb.png", - "homedecor_door_wood_glass_white_tb.png", - "homedecor_door_wood_glass_white_lr.png", - "homedecor_door_wood_glass_white_lr.png", - "homedecor_door_wood_glass_white_right_bottom.png", - "homedecor_door_wood_glass_white_left_bottom.png", - }, - wield_image = "homedecor_door_wood_glass_white_left_inv.png", - inventory_image = "homedecor_door_wood_glass_white_left_inv.png", - wield_scale = {x=1,y=1,z=0.25}, - paramtype = "light", - paramtype2 = "facedir", - is_ground_content = true, - groups = {snappy=3}, - sounds = default.node_sound_wood_defaults(), - walkable = true, - selection_box = { - type = "fixed", - fixed = { -0.5, -0.5, 6/16, 0.5, 1.5, 8/16} - }, - node_box = { - type = "fixed", - fixed = { - { -8/16, 7/16, 6/16, 8/16, 8/16, 8/16 }, - { -8/16, -1/32, 6/16, 8/16, 3/32, 8/16 }, - { -8/16, -8/16, 6/16, 8/16, -6/16, 8/16 }, - { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, - { -1/16, -8/16, 6/16, 1/16, 8/16, 8/16 }, - { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, - { -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 } - } - }, - on_place = function(itemstack, placer, pointed_thing) - local pos = pointed_thing.above - local pd = true - if type(IsPlayerNodeOwner)=="function" then - if not IsPlayerNodeOwner(pos, placer:get_player_name()) and HasOwner(pos) then - minetest.chat_send_player( placer:get_player_name(), "Sorry, "..getLastOwner(pos).." owns that spot." ) - pd = false - end - end - if type(isprotect)=="function" then - pd = isprotect(5, pos, placer) - if not pd then - minetest.chat_send_player( placer:get_player_name(), "Sorry, someone owns that spot." ) - end - end - if pd then - fdir = minetest.dir_to_facedir(placer:get_look_dir()) - if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then - minetest.chat_send_player( placer:get_player_name(), 'Not enough vertical space to place a door!' ) - return - end - minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_wood_glass_white_top_left", param2=fdir}) - return minetest.item_place(itemstack, placer, pointed_thing) - end - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == "homedecor:door_wood_glass_white_top_left" then - minetest.env:remove_node({x=pos.x, y=pos.y+1, z=pos.z}) - end - end, - on_punch = function(pos, node, puncher) - nfdir=node.param2-1 - if nfdir < 0 then nfdir = 3 end - minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_wood_glass_white_top_right", param2=nfdir}) - minetest.env:add_node(pos, { name = "homedecor:door_wood_glass_white_bottom_right", param2=nfdir}) - end -}) - --- Right-opening - -minetest.register_node("homedecor:door_wood_glass_white_top_right", { - description = "wood/glass door top half", - drawtype = "nodebox", - tiles = { - "homedecor_door_wood_glass_white_tb.png", - "homedecor_door_wood_glass_white_tb.png", - "homedecor_door_wood_glass_white_lr.png", - "homedecor_door_wood_glass_white_lr.png", - "homedecor_door_wood_glass_white_left_top.png", - "homedecor_door_wood_glass_white_right_top.png", - }, - paramtype = "light", - paramtype2 = "facedir", - is_ground_content = true, - groups = {snappy=3, not_in_creative_inventory=1}, - sounds = default.node_sound_wood_defaults(), - walkable = true, - selection_box = { - type = "fixed", - fixed = { -0.5, -1.5, 6/16, 0.5, 0.5, 8/16} - }, - node_box = { - type = "fixed", - fixed = { - { -8/16, 6/16, 6/16, 8/16, 8/16, 8/16 }, - { -8/16, -3/32, 6/16, 8/16, 1/32, 8/16 }, - { -8/16, -8/16, 6/16, 8/16, -7/16, 8/16 }, - { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, - { -1/16, -8/16, 6/16, 1/16, 8/16, 8/16 }, - { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, - { -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 } - } - }, - drop = "homedecor:door_wood_glass_white_bottom_left", - after_dig_node = function(pos, oldnode, oldmetadata, digger) - if minetest.env:get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == "homedecor:door_wood_glass_white_bottom_right" then - minetest.env:remove_node({x=pos.x, y=pos.y-1, z=pos.z}) - end - end, - on_punch = function(pos, node, puncher) - nfdir=node.param2+1 - if nfdir > 3 then nfdir = 0 end - minetest.env:add_node(pos, { name = "homedecor:door_wood_glass_white_top_left", param2=nfdir}) - minetest.env:add_node({x=pos.x, y=pos.y-1, z=pos.z}, { name = "homedecor:door_wood_glass_white_bottom_left", param2=nfdir}) - end -}) - -minetest.register_node("homedecor:door_wood_glass_white_bottom_right", { - description = "Wood and Glass Grid-Style Door (Right-opening)", - drawtype = "nodebox", - tiles = { - "homedecor_door_wood_glass_white_tb.png", - "homedecor_door_wood_glass_white_tb.png", - "homedecor_door_wood_glass_white_lr.png", - "homedecor_door_wood_glass_white_lr.png", - "homedecor_door_wood_glass_white_left_bottom.png", - "homedecor_door_wood_glass_white_right_bottom.png", - }, - wield_image = "homedecor_door_wood_glass_white_right_inv.png", - inventory_image = "homedecor_door_wood_glass_white_right_inv.png", - wield_scale = {x=1,y=1,z=0.25}, - paramtype = "light", - paramtype2 = "facedir", - is_ground_content = true, - groups = {snappy=3}, - sounds = default.node_sound_wood_defaults(), - walkable = true, - selection_box = { - type = "fixed", - fixed = { -0.5, -0.5, 6/16, 0.5, 1.5, 8/16} - }, - node_box = { - type = "fixed", - fixed = { - { -8/16, 7/16, 6/16, 8/16, 8/16, 8/16 }, - { -8/16, -1/32, 6/16, 8/16, 3/32, 8/16 }, - { -8/16, -8/16, 6/16, 8/16, -6/16, 8/16 }, - { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, - { -1/16, -8/16, 6/16, 1/16, 8/16, 8/16 }, - { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, - { -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 } - } - }, - drop = "homedecor:door_wood_glass_white_bottom_left", - on_place = function(itemstack, placer, pointed_thing) - local pos = pointed_thing.above - local pd = true - if type(IsPlayerNodeOwner)=="function" then - if not IsPlayerNodeOwner(pos, placer:get_player_name()) and HasOwner(pos) then - minetest.chat_send_player( placer:get_player_name(), "Sorry, "..getLastOwner(pos).." owns that spot." ) - pd = false - end - end - if type(isprotect)=="function" then - pd = isprotect(5, pos, placer) - if not pd then - minetest.chat_send_player( placer:get_player_name(), "Sorry, someone owns that spot." ) - end - end - if pd then - fdir = minetest.dir_to_facedir(placer:get_look_dir()) - if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then - minetest.chat_send_player( placer:get_player_name(), 'Not enough vertical space to place a door!' ) - return - end - minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_wood_glass_white_top_right", param2=fdir}) - return minetest.item_place(itemstack, placer, pointed_thing) - end - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == "homedecor:door_wood_glass_white_top_right" then - minetest.env:remove_node({x=pos.x, y=pos.y+1, z=pos.z}) - end - end, - on_punch = function(pos, node, puncher) - nfdir=node.param2+1 - if nfdir > 3 then nfdir = 0 end - minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_wood_glass_white_top_left", param2=nfdir}) - minetest.env:add_node(pos, { name = "homedecor:door_wood_glass_white_bottom_left", param2=nfdir}) - end -}) diff --git a/door_models.lua b/door_models.lua new file mode 100644 index 00000000..13d98bbf --- /dev/null +++ b/door_models.lua @@ -0,0 +1,317 @@ +homedecor_door_models = { + { + "closet_mahogany", + "Mahogany Closet Door", + + {{ -8/16, 5/16, 6/16, 8/16, 8/16, 8/16 }, + { -8/16, 8/32, 13/32, 8/16, 9/32, 15/32 }, + { -8/16, 6/32, 13/32, 8/16, 7/32, 15/32 }, + { -8/16, 4/32, 13/32, 8/16, 5/32, 15/32 }, + { -8/16, 2/32, 13/32, 8/16, 3/32, 15/32 }, + { -8/16, 0/32, 13/32, 8/16, 1/32, 15/32 }, + { -8/16, -2/32, 13/32, 8/16, -1/32, 15/32 }, + { -8/16, -4/32, 13/32, 8/16, -3/32, 15/32 }, + { -8/16, -6/32, 13/32, 8/16, -5/32, 15/32 }, + { -8/16, -8/32, 13/32, 8/16, -7/32, 15/32 }, + { -8/16, -10/32, 13/32, 8/16, -9/32, 15/32 }, + { -8/16, -12/32, 13/32, 8/16, -11/32, 15/32 }, + { -8/16, -16/32, 6/16, 8/16, -13/32, 8/16 }, + { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, + { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }}, + + {{ -8/16, 6/16, 6/16, 8/16, 8/16, 8/16}, + { -8/16, 10/32, 13/32, 8/16, 11/32, 15/32 }, + { -8/16, 8/32, 13/32, 8/16, 9/32, 15/32 }, + { -8/16, 6/32, 13/32, 8/16, 7/32, 15/32 }, + { -8/16, 4/32, 13/32, 8/16, 5/32, 15/32 }, + { -8/16, 2/32, 13/32, 8/16, 3/32, 15/32 }, + { -8/16, 0, 13/32, 8/16, 1/32, 15/32 }, + { -8/16, -2/32, 13/32, 8/16, -1/32, 15/32 }, + { -8/16, -4/32, 13/32, 8/16, -3/32, 15/32 }, + { -8/16, -6/32, 13/32, 8/16, -5/32, 15/32 }, + { -8/16, -8/32, 13/32, 8/16, -7/32, 15/32 }, + { -8/16, -10/32, 13/32, 8/16, -9/32, 15/32 }, + { -8/16, -16/32, 6/16, 8/16, -11/32, 8/16 }, + { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, + { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }}, + + {{ -8/16, 5/16, 6/16, 8/16, 8/16, 8/16 }, + { -8/16, 8/32, 13/32, 8/16, 9/32, 15/32 }, + { -8/16, 6/32, 13/32, 8/16, 7/32, 15/32 }, + { -8/16, 4/32, 13/32, 8/16, 5/32, 15/32 }, + { -8/16, 2/32, 13/32, 8/16, 3/32, 15/32 }, + { -8/16, 0/32, 13/32, 8/16, 1/32, 15/32 }, + { -8/16, -2/32, 13/32, 8/16, -1/32, 15/32 }, + { -8/16, -4/32, 13/32, 8/16, -3/32, 15/32 }, + { -8/16, -6/32, 13/32, 8/16, -5/32, 15/32 }, + { -8/16, -8/32, 13/32, 8/16, -7/32, 15/32 }, + { -8/16, -10/32, 13/32, 8/16, -9/32, 15/32 }, + { -8/16, -12/32, 13/32, 8/16, -11/32, 15/32 }, + { -8/16, -16/32, 6/16, 8/16, -13/32, 8/16 }, + { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, + { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }}, + + {{ -8/16, 6/16, 6/16, 8/16, 8/16, 8/16}, + { -8/16, 10/32, 13/32, 8/16, 11/32, 15/32 }, + { -8/16, 8/32, 13/32, 8/16, 9/32, 15/32 }, + { -8/16, 6/32, 13/32, 8/16, 7/32, 15/32 }, + { -8/16, 4/32, 13/32, 8/16, 5/32, 15/32 }, + { -8/16, 2/32, 13/32, 8/16, 3/32, 15/32 }, + { -8/16, 0, 13/32, 8/16, 1/32, 15/32 }, + { -8/16, -2/32, 13/32, 8/16, -1/32, 15/32 }, + { -8/16, -4/32, 13/32, 8/16, -3/32, 15/32 }, + { -8/16, -6/32, 13/32, 8/16, -5/32, 15/32 }, + { -8/16, -8/32, 13/32, 8/16, -7/32, 15/32 }, + { -8/16, -10/32, 13/32, 8/16, -9/32, 15/32 }, + { -8/16, -16/32, 6/16, 8/16, -11/32, 8/16 }, + { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, + { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }} + }, + +---------- + + { + "closet_oak", + "Oak Closet Door", + + {{ -8/16, 5/16, 6/16, 8/16, 8/16, 8/16 }, + { -8/16, 8/32, 13/32, 8/16, 9/32, 15/32 }, + { -8/16, 6/32, 13/32, 8/16, 7/32, 15/32 }, + { -8/16, 4/32, 13/32, 8/16, 5/32, 15/32 }, + { -8/16, 2/32, 13/32, 8/16, 3/32, 15/32 }, + { -8/16, 0/32, 13/32, 8/16, 1/32, 15/32 }, + { -8/16, -2/32, 13/32, 8/16, -1/32, 15/32 }, + { -8/16, -4/32, 13/32, 8/16, -3/32, 15/32 }, + { -8/16, -6/32, 13/32, 8/16, -5/32, 15/32 }, + { -8/16, -8/32, 13/32, 8/16, -7/32, 15/32 }, + { -8/16, -10/32, 13/32, 8/16, -9/32, 15/32 }, + { -8/16, -12/32, 13/32, 8/16, -11/32, 15/32 }, + { -8/16, -16/32, 6/16, 8/16, -13/32, 8/16 }, + { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, + { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }}, + + {{ -8/16, 6/16, 6/16, 8/16, 8/16, 8/16}, + { -8/16, 10/32, 13/32, 8/16, 11/32, 15/32 }, + { -8/16, 8/32, 13/32, 8/16, 9/32, 15/32 }, + { -8/16, 6/32, 13/32, 8/16, 7/32, 15/32 }, + { -8/16, 4/32, 13/32, 8/16, 5/32, 15/32 }, + { -8/16, 2/32, 13/32, 8/16, 3/32, 15/32 }, + { -8/16, 0, 13/32, 8/16, 1/32, 15/32 }, + { -8/16, -2/32, 13/32, 8/16, -1/32, 15/32 }, + { -8/16, -4/32, 13/32, 8/16, -3/32, 15/32 }, + { -8/16, -6/32, 13/32, 8/16, -5/32, 15/32 }, + { -8/16, -8/32, 13/32, 8/16, -7/32, 15/32 }, + { -8/16, -10/32, 13/32, 8/16, -9/32, 15/32 }, + { -8/16, -16/32, 6/16, 8/16, -11/32, 8/16 }, + { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, + { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }}, + + {{ -8/16, 5/16, 6/16, 8/16, 8/16, 8/16 }, + { -8/16, 8/32, 13/32, 8/16, 9/32, 15/32 }, + { -8/16, 6/32, 13/32, 8/16, 7/32, 15/32 }, + { -8/16, 4/32, 13/32, 8/16, 5/32, 15/32 }, + { -8/16, 2/32, 13/32, 8/16, 3/32, 15/32 }, + { -8/16, 0/32, 13/32, 8/16, 1/32, 15/32 }, + { -8/16, -2/32, 13/32, 8/16, -1/32, 15/32 }, + { -8/16, -4/32, 13/32, 8/16, -3/32, 15/32 }, + { -8/16, -6/32, 13/32, 8/16, -5/32, 15/32 }, + { -8/16, -8/32, 13/32, 8/16, -7/32, 15/32 }, + { -8/16, -10/32, 13/32, 8/16, -9/32, 15/32 }, + { -8/16, -12/32, 13/32, 8/16, -11/32, 15/32 }, + { -8/16, -16/32, 6/16, 8/16, -13/32, 8/16 }, + { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, + { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }}, + + {{ -8/16, 6/16, 6/16, 8/16, 8/16, 8/16}, + { -8/16, 10/32, 13/32, 8/16, 11/32, 15/32 }, + { -8/16, 8/32, 13/32, 8/16, 9/32, 15/32 }, + { -8/16, 6/32, 13/32, 8/16, 7/32, 15/32 }, + { -8/16, 4/32, 13/32, 8/16, 5/32, 15/32 }, + { -8/16, 2/32, 13/32, 8/16, 3/32, 15/32 }, + { -8/16, 0, 13/32, 8/16, 1/32, 15/32 }, + { -8/16, -2/32, 13/32, 8/16, -1/32, 15/32 }, + { -8/16, -4/32, 13/32, 8/16, -3/32, 15/32 }, + { -8/16, -6/32, 13/32, 8/16, -5/32, 15/32 }, + { -8/16, -8/32, 13/32, 8/16, -7/32, 15/32 }, + { -8/16, -10/32, 13/32, 8/16, -9/32, 15/32 }, + { -8/16, -16/32, 6/16, 8/16, -11/32, 8/16 }, + { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, + { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }}, + }, + +---------- + + { + "exterior_fancy", + "Fancy Wood/Glass Door", + + {{ -8/16, 6/16, 6/16, 8/16, 8/16, 8/16 }, + { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, + { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, + { -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 }}, + + {{ -8/16, -8/16, 6/16, 8/16, 6/16, 8/16 }, + { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, + { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, + { -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 }}, + + {{ -8/16, 6/16, 6/16, 8/16, 8/16, 8/16 }, + { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, + { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, + { -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 }}, + + {{ -8/16, -8/16, 6/16, 8/16, 6/16, 8/16 }, + { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, + { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, + { -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 }} + }, + +---------- + + { + "glass", + "Glass Office Door", + + {{ -8/16, -8/16, 6/16, 8/16, 8/16, 8/16 }}, + + {{ -8/16, -8/16, 6/16, 8/16, 8/16, 8/16 }}, + + {{ -8/16, -8/16, 6/16, 8/16, 8/16, 8/16 }}, + + {{ -8/16, -8/16, 6/16, 8/16, 8/16, 8/16 }} + }, + +---------- + + { + "wood_glass", + "Glass and Wood, Oak-colored", + + {{ -8/16, 6/16, 6/16, 8/16, 8/16, 8/16 }, + { -8/16, -3/32, 6/16, 8/16, 1/32, 8/16 }, + { -8/16, -8/16, 6/16, 8/16, -7/16, 8/16 }, + { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, + { -1/16, -8/16, 6/16, 1/16, 8/16, 8/16 }, + { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, + { -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 }}, + + {{ -8/16, 7/16, 6/16, 8/16, 8/16, 8/16 }, + { -8/16, -1/32, 6/16, 8/16, 3/32, 8/16 }, + { -8/16, -8/16, 6/16, 8/16, -6/16, 8/16 }, + { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, + { -1/16, -8/16, 6/16, 1/16, 8/16, 8/16 }, + { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, + { -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 }}, + + {{ -8/16, 6/16, 6/16, 8/16, 8/16, 8/16 }, + { -8/16, -3/32, 6/16, 8/16, 1/32, 8/16 }, + { -8/16, -8/16, 6/16, 8/16, -7/16, 8/16 }, + { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, + { -1/16, -8/16, 6/16, 1/16, 8/16, 8/16 }, + { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, + { -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 }}, + + {{ -8/16, 7/16, 6/16, 8/16, 8/16, 8/16 }, + { -8/16, -1/32, 6/16, 8/16, 3/32, 8/16 }, + { -8/16, -8/16, 6/16, 8/16, -6/16, 8/16 }, + { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, + { -1/16, -8/16, 6/16, 1/16, 8/16, 8/16 }, + { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, + { -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 }} + }, + +---------- + + { + "wood_glass_mahogany", + "Glass and Wood, Mahogany-colored", + + {{ -8/16, 6/16, 6/16, 8/16, 8/16, 8/16 }, + { -8/16, -3/32, 6/16, 8/16, 1/32, 8/16 }, + { -8/16, -8/16, 6/16, 8/16, -7/16, 8/16 }, + { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, + { -1/16, -8/16, 6/16, 1/16, 8/16, 8/16 }, + { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, + { -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 }}, + + {{ -8/16, 7/16, 6/16, 8/16, 8/16, 8/16 }, + { -8/16, -1/32, 6/16, 8/16, 3/32, 8/16 }, + { -8/16, -8/16, 6/16, 8/16, -6/16, 8/16 }, + { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, + { -1/16, -8/16, 6/16, 1/16, 8/16, 8/16 }, + { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, + { -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 }}, + + {{ -8/16, 6/16, 6/16, 8/16, 8/16, 8/16 }, + { -8/16, -3/32, 6/16, 8/16, 1/32, 8/16 }, + { -8/16, -8/16, 6/16, 8/16, -7/16, 8/16 }, + { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, + { -1/16, -8/16, 6/16, 1/16, 8/16, 8/16 }, + { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, + { -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 }}, + + {{ -8/16, 7/16, 6/16, 8/16, 8/16, 8/16 }, + { -8/16, -1/32, 6/16, 8/16, 3/32, 8/16 }, + { -8/16, -8/16, 6/16, 8/16, -6/16, 8/16 }, + { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, + { -1/16, -8/16, 6/16, 1/16, 8/16, 8/16 }, + { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, + { -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 }} + }, + +---------- + + { + "wood_glass_white", + "Glass and Wood, White", + + {{ -8/16, 6/16, 6/16, 8/16, 8/16, 8/16 }, + { -8/16, -3/32, 6/16, 8/16, 1/32, 8/16 }, + { -8/16, -8/16, 6/16, 8/16, -7/16, 8/16 }, + { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, + { -1/16, -8/16, 6/16, 1/16, 8/16, 8/16 }, + { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, + { -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 }}, + + {{ -8/16, 7/16, 6/16, 8/16, 8/16, 8/16 }, + { -8/16, -1/32, 6/16, 8/16, 3/32, 8/16 }, + { -8/16, -8/16, 6/16, 8/16, -6/16, 8/16 }, + { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, + { -1/16, -8/16, 6/16, 1/16, 8/16, 8/16 }, + { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, + { -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 }}, + + {{ -8/16, 6/16, 6/16, 8/16, 8/16, 8/16 }, + { -8/16, -3/32, 6/16, 8/16, 1/32, 8/16 }, + { -8/16, -8/16, 6/16, 8/16, -7/16, 8/16 }, + { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, + { -1/16, -8/16, 6/16, 1/16, 8/16, 8/16 }, + { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, + { -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 }}, + + {{ -8/16, 7/16, 6/16, 8/16, 8/16, 8/16 }, + { -8/16, -1/32, 6/16, 8/16, 3/32, 8/16 }, + { -8/16, -8/16, 6/16, 8/16, -6/16, 8/16 }, + { -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, + { -1/16, -8/16, 6/16, 1/16, 8/16, 8/16 }, + { 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, + { -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 }} + }, + +---------- + + { + "wood_plain", + "Plain Wooden Door", + + {{ -8/16, -8/16, 6/16, 8/16, 8/16, 8/16 }}, + + {{ -8/16, -8/16, 6/16, 8/16, 8/16, 8/16 }}, + + {{ -8/16, -8/16, 6/16, 8/16, 8/16, 8/16 }}, + + {{ -8/16, -8/16, 6/16, 8/16, 8/16, 8/16 }} + }, + +} + diff --git a/door_nodes.lua b/door_nodes.lua new file mode 100644 index 00000000..68d3f4d4 --- /dev/null +++ b/door_nodes.lua @@ -0,0 +1,268 @@ +-- Node definitions for Homedecor doors + +local sides = {"left", "right"} +local rsides = {"right", "left"} + +-- cheater's method of detecting if default doors are right-click-to-open: +-- default.generate_ore() was exposed to the modding API one day prior to the +-- right-click thing. + +local use_rightclick = type(default.generate_ore) + +for i in ipairs(sides) do + local side = sides[i] + local rside = rsides[i] + + for j in ipairs(homedecor_door_models) do + local doorname = homedecor_door_models[j][1] + local doordesc = homedecor_door_models[j][2] + local nodeboxes_top = nil + local nodeboxes_bottom = nil + + if side == "left" then + nodeboxes_top = homedecor_door_models[j][3] + nodeboxes_bottomtom = homedecor_door_models[j][4] + else + nodeboxes_top = homedecor_door_models[j][5] + nodeboxes_bottomtom = homedecor_door_models[j][6] + end + + local tiles_top = { + "homedecor_door_"..doorname.."_tb.png", + "homedecor_door_"..doorname.."_tb.png", + "homedecor_door_"..doorname.."_lrt.png", + "homedecor_door_"..doorname.."_lrt.png", + "homedecor_door_"..doorname.."_"..rside.."_top.png", + "homedecor_door_"..doorname.."_"..side.."_top.png", + } + + local tiles_bottom = { + "homedecor_door_"..doorname.."_tb.png", + "homedecor_door_"..doorname.."_tb.png", + "homedecor_door_"..doorname.."_lrb.png", + "homedecor_door_"..doorname.."_lrb.png", + "homedecor_door_"..doorname.."_"..rside.."_bottom.png", + "homedecor_door_"..doorname.."_"..side.."_bottom.png", + } + + local selectboxes_top = { + type = "fixed", + fixed = { -0.5, -1.5, 6/16, 0.5, 0.5, 8/16} + } + + local selectboxes_bottom = { + type = "fixed", + fixed = { -0.5, -0.5, 6/16, 0.5, 1.5, 8/16} + } + + if use_rightclick == nil then -- register the version that uses on_punch + + minetest.register_node("homedecor:door_"..doorname.."_top_"..side, { + description = doordesc.." (Top Half, "..side.."-opening)", + drawtype = "nodebox", + tiles = tiles_top, + paramtype = "light", + paramtype2 = "facedir", + groups = {snappy=3, not_in_creative_inventory=1}, + sounds = default.node_sound_wood_defaults(), + walkable = true, + selection_box = selectboxes_top, + node_box = { + type = "fixed", + fixed = nodeboxes_top + }, + drop = "homedecor:door_"..doorname.."_bottom_"..side, + after_dig_node = function(pos, oldnode, oldmetadata, digger) + if minetest.env:get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == "homedecor:door_"..doorname.."_bottom_"..side then + minetest.env:remove_node({x=pos.x, y=pos.y-1, z=pos.z}) + end + end, + on_punch = function(pos, node, puncher) + homedecor_flip_door({x=pos.x, y=pos.y-1, z=pos.z}, node, puncher, doorname, side) + end + }) + + minetest.register_node("homedecor:door_"..doorname.."_bottom_"..side, { + description = doordesc.." ("..side.."-opening)", + drawtype = "nodebox", + tiles = tiles_bottom, + inventory_image = "homedecor_door_"..doorname.."_"..side.."_inv.png", + paramtype = "light", + paramtype2 = "facedir", + groups = {snappy=3}, + sounds = default.node_sound_wood_defaults(), + walkable = true, + selection_box = selectboxes_bottom, + node_box = { + type = "fixed", + fixed = nodeboxes_bottomtom + }, + after_dig_node = function(pos, oldnode, oldmetadata, digger) + if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == "homedecor:door_"..doorname.."_top_"..side then + minetest.env:remove_node({x=pos.x, y=pos.y+1, z=pos.z}) + end + end, + on_punch = function(pos, node, puncher) + homedecor_flip_door(pos, node, puncher, doorname, side) + end, + on_place = function(itemstack, placer, pointed_thing) + return homedecor_place_door(itemstack, placer, pointed_thing, doorname, side) + end, + }) + + else -- register the version that uses on_rightclick + + minetest.register_node("homedecor:door_"..doorname.."_top_"..side, { + description = doordesc.." (Top Half, "..side.."-opening)", + drawtype = "nodebox", + tiles = tiles_top, + paramtype = "light", + paramtype2 = "facedir", + groups = {snappy=3, not_in_creative_inventory=1}, + sounds = default.node_sound_wood_defaults(), + walkable = true, + selection_box = selectboxes_top, + node_box = { + type = "fixed", + fixed = nodeboxes_top + }, + drop = "homedecor:door_"..doorname.."_bottom_"..side, + after_dig_node = function(pos, oldnode, oldmetadata, digger) + if minetest.env:get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == "homedecor:door_"..doorname.."_bottom_"..side then + minetest.env:remove_node({x=pos.x, y=pos.y-1, z=pos.z}) + end + end, + on_rightclick = function(pos, node, clicker) + homedecor_flip_door({x=pos.x, y=pos.y-1, z=pos.z}, node, clicker, doorname, side) + end + }) + + minetest.register_node("homedecor:door_"..doorname.."_bottom_"..side, { + description = doordesc.." ("..side.."-opening)", + drawtype = "nodebox", + tiles = tiles_bottom, + inventory_image = "homedecor_door_"..doorname.."_"..side.."_inv.png", + paramtype = "light", + paramtype2 = "facedir", + groups = {snappy=3}, + sounds = default.node_sound_wood_defaults(), + walkable = true, + selection_box = selectboxes_bottom, + node_box = { + type = "fixed", + fixed = nodeboxes_bottomtom + }, + after_dig_node = function(pos, oldnode, oldmetadata, digger) + if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == "homedecor:door_"..doorname.."_top_"..side then + minetest.env:remove_node({x=pos.x, y=pos.y+1, z=pos.z}) + end + end, + on_place = function(itemstack, placer, pointed_thing) + -- for some obscure reason, this callback is used if the target node + -- is a homedecor door, probably because they have an on_rightclick + -- setting -- but only if you're weilding a door! + + local node=minetest.env:get_node(pointed_thing.under) + if string.find(node.name, "homedecor:door_") then + + local lr = nil + if string.find(node.name, "left") then + lr = "left" + else + lr = "right" + end + + local tb = nil + if string.find(node.name, "top") then + tb = "top" + else + tb = "bottom" + end + + local dname = string.gsub(string.gsub(string.gsub(node.name, "homedecor:door_", ""), "_"..lr, ""), "_"..tb, "") + + print(node.name) + print(dname) + print(lr) + + homedecor_flip_door(pointed_thing.under, node, placer, dname, lr) + return + else + return homedecor_place_door(itemstack, placer, pointed_thing, doorname, side) + end + end, + on_rightclick = function(pos, node, clicker) + homedecor_flip_door(pos, node, clicker, doorname, side) + end + }) + end + end +end + +function homedecor_node_is_owned(pos, placer) + local ownername = false + if type(IsPlayerNodeOwner) == "function" then -- node_ownership mod + if HasOwner(pos, placer) then -- returns true if the node is owned + if not IsPlayerNodeOwner(pos, placer:get_player_name()) then + if type(getLastOwner) == "function" then -- ...is an old version + ownername = getLastOwner(pos) + elseif type(GetNodeOwnerName) == "function" then -- ...is a recent version + ownername = GetNodeOwnerName(pos) + else + ownername = "someone" + end + end + end + + elseif type(isprotect)=="function" then -- glomie's protection mod + if not isprotect(5, pos, placer) then + ownername = "someone" + end + end + + if ownername ~= false then + minetest.chat_send_player( placer:get_player_name(), "Sorry, "..ownername.." owns that spot." ) + return true + else + return false + end +end + +function homedecor_place_door(itemstack, placer, pointed_thing, name, side) + local pos = pointed_thing.above + if homedecor_node_is_owned(pointed_thing.under, placer) == false then + + local nodename = minetest.env:get_node(pointed_thing.under).name + local field = minetest.registered_nodes[nodename].on_rightclick + + if field == nil then + fdir = minetest.dir_to_facedir(placer:get_look_dir()) + if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then + minetest.chat_send_player( placer:get_player_name(), 'Not enough vertical space to place a door!' ) + return + end + minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_"..name.."_top_"..side, param2=fdir}) + minetest.env:add_node(pos, { name = "homedecor:door_"..name.."_bottom_"..side, param2=fdir}) + itemstack:take_item() + return itemstack + end + return minetest.item_place(itemstack, placer, pointed_thing) + end +end + +function homedecor_flip_door(pos, node, player, name, side) + local rside = nil + local nfdir = nil + if side == "left" then + rside = "right" + nfdir=node.param2 - 1 + if nfdir < 0 then nfdir = 3 end + else + rside = "left" + nfdir=node.param2 + 1 + if nfdir > 3 then nfdir = 0 end + end + minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_"..name.."_top_"..rside, param2=nfdir}) + minetest.env:add_node(pos, { name = "homedecor:door_"..name.."_bottom_"..rside, param2=nfdir}) +end + diff --git a/door_wood_plain.lua b/door_wood_plain.lua deleted file mode 100644 index 544545a9..00000000 --- a/door_wood_plain.lua +++ /dev/null @@ -1,217 +0,0 @@ --- This file supplies plain, non-windowed doors. - --- Left-opening - -minetest.register_node("homedecor:door_wood_plain_top_left", { - description = "plain wooden door top half", - drawtype = "nodebox", - tiles = { - "homedecor_door_wood_plain_tb.png", - "homedecor_door_wood_plain_tb.png", - "homedecor_door_wood_plain_lr.png", - "homedecor_door_wood_plain_lr.png", - "homedecor_door_wood_plain_right_top.png", - "homedecor_door_wood_plain_left_top.png", - }, - paramtype = "light", - paramtype2 = "facedir", - is_ground_content = true, - groups = {snappy=3, not_in_creative_inventory=1}, - sounds = default.node_sound_wood_defaults(), - walkable = true, - selection_box = { - type = "fixed", - fixed = { -0.5, -1.5, 6/16, 0.5, 0.5, 8/16 } - }, - node_box = { - type = "fixed", - fixed = { -0.5, -0.5, 6/16, 0.5, 0.5, 8/16 } - }, - drop = "homedecor:door_wood_plain_bottom_left", - after_dig_node = function(pos, oldnode, oldmetadata, digger) - if minetest.env:get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == "homedecor:door_wood_plain_bottom_left" then - minetest.env:remove_node({x=pos.x, y=pos.y-1, z=pos.z}) - end - end, - on_punch = function(pos, node, puncher) - nfdir=node.param2-1 - if nfdir < 0 then nfdir = 3 end - minetest.env:add_node(pos, { name = "homedecor:door_wood_plain_top_right", param2=nfdir}) - minetest.env:add_node({x=pos.x, y=pos.y-1, z=pos.z}, { name = "homedecor:door_wood_plain_bottom_right", param2=nfdir}) - end -}) - -minetest.register_node("homedecor:door_wood_plain_bottom_left", { - description = "Plain Windowless Wooden Door", - drawtype = "nodebox", - tiles = { - "homedecor_door_wood_plain_tb.png", - "homedecor_door_wood_plain_tb.png", - "homedecor_door_wood_plain_lr.png", - "homedecor_door_wood_plain_lr.png", - "homedecor_door_wood_plain_right_bottom.png", - "homedecor_door_wood_plain_left_bottom.png", - }, - wield_image = "homedecor_door_wood_plain_left_inv.png", - inventory_image = "homedecor_door_wood_plain_left_inv.png", - wield_scale = {x=1,y=1,z=0.25}, - paramtype = "light", - paramtype2 = "facedir", - is_ground_content = true, - groups = {snappy=3}, - sounds = default.node_sound_wood_defaults(), - walkable = true, - selection_box = { - type = "fixed", - fixed = { -0.5, -0.5, 6/16, 0.5, 1.5, 8/16 } - }, - node_box = { - type = "fixed", - fixed = { -0.5, -0.5, 6/16, 0.5, 0.5, 8/16 } - }, - on_place = function(itemstack, placer, pointed_thing) - local pos = pointed_thing.above - local pd = true - if type(IsPlayerNodeOwner)=="function" then - if not IsPlayerNodeOwner(pos, placer:get_player_name()) and HasOwner(pos) then - minetest.chat_send_player( placer:get_player_name(), "Sorry, "..getLastOwner(pos).." owns that spot." ) - pd = false - end - end - if type(isprotect)=="function" then - pd = isprotect(5, pos, placer) - if not pd then - minetest.chat_send_player( placer:get_player_name(), "Sorry, someone owns that spot." ) - end - end - if pd then - fdir = minetest.dir_to_facedir(placer:get_look_dir()) - if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then - minetest.chat_send_player( placer:get_player_name(), 'Not enough vertical space to place a door!' ) - return - end - minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_wood_plain_top_left", param2=fdir}) - return minetest.item_place(itemstack, placer, pointed_thing) - end - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == "homedecor:door_wood_plain_top_left" then - minetest.env:remove_node({x=pos.x, y=pos.y+1, z=pos.z}) - end - end, - on_punch = function(pos, node, puncher) - nfdir=node.param2-1 - if nfdir < 0 then nfdir = 3 end - minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_wood_plain_top_right", param2=nfdir}) - minetest.env:add_node(pos, { name = "homedecor:door_wood_plain_bottom_right", param2=nfdir}) - end -}) - --- Right-opening - -minetest.register_node("homedecor:door_wood_plain_top_right", { - description = "plain wooden door top half", - drawtype = "nodebox", - tiles = { - "homedecor_door_wood_plain_tb.png", - "homedecor_door_wood_plain_tb.png", - "homedecor_door_wood_plain_lr.png", - "homedecor_door_wood_plain_lr.png", - "homedecor_door_wood_plain_left_top.png", - "homedecor_door_wood_plain_right_top.png", - }, - paramtype = "light", - paramtype2 = "facedir", - is_ground_content = true, - groups = {snappy=3, not_in_creative_inventory=1}, - sounds = default.node_sound_wood_defaults(), - walkable = true, - selection_box = { - type = "fixed", - fixed = { -0.5, -1.5, 6/16, 0.5, 0.5, 8/16 } - }, - node_box = { - type = "fixed", - fixed = { -0.5, -0.5, 6/16, 0.5, 0.5, 8/16 } - }, - drop = "homedecor:door_wood_plain_bottom_left", - after_dig_node = function(pos, oldnode, oldmetadata, digger) - if minetest.env:get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == "homedecor:door_wood_plain_bottom_right" then - minetest.env:remove_node({x=pos.x, y=pos.y-1, z=pos.z}) - end - end, - on_punch = function(pos, node, puncher) - nfdir=node.param2+1 - if nfdir > 3 then nfdir = 0 end - minetest.env:add_node(pos, { name = "homedecor:door_wood_plain_top_left", param2=nfdir}) - minetest.env:add_node({x=pos.x, y=pos.y-1, z=pos.z}, { name = "homedecor:door_wood_plain_bottom_left", param2=nfdir}) - end -}) - -minetest.register_node("homedecor:door_wood_plain_bottom_right", { - description = "Plain Windowless Wooden Door (Right-opening)", - drawtype = "nodebox", - tiles = { - "homedecor_door_wood_plain_tb.png", - "homedecor_door_wood_plain_tb.png", - "homedecor_door_wood_plain_lr.png", - "homedecor_door_wood_plain_lr.png", - "homedecor_door_wood_plain_left_bottom.png", - "homedecor_door_wood_plain_right_bottom.png", - }, - wield_image = "homedecor_door_wood_plain_right_inv.png", - inventory_image = "homedecor_door_wood_plain_right_inv.png", - wield_scale = {x=1,y=1,z=0.25}, - paramtype = "light", - paramtype2 = "facedir", - is_ground_content = true, - groups = {snappy=3}, - sounds = default.node_sound_wood_defaults(), - walkable = true, - selection_box = { - type = "fixed", - fixed = { -0.5, -0.5, 6/16, 0.5, 1.5, 8/16 } - }, - node_box = { - type = "fixed", - fixed = { -0.5, -0.5, 6/16, 0.5, 0.5, 8/16 } - }, - drop = "homedecor:door_wood_plain_bottom_left", - on_place = function(itemstack, placer, pointed_thing) - local pos = pointed_thing.above - local pd = true - if type(IsPlayerNodeOwner)=="function" then - if not IsPlayerNodeOwner(pos, placer:get_player_name()) and HasOwner(pos) then - minetest.chat_send_player( placer:get_player_name(), "Sorry, "..getLastOwner(pos).." owns that spot." ) - pd = false - end - end - if type(isprotect)=="function" then - pd = isprotect(5, pos, placer) - if not pd then - minetest.chat_send_player( placer:get_player_name(), "Sorry, someone owns that spot." ) - end - end - if pd then - fdir = minetest.dir_to_facedir(placer:get_look_dir()) - if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then - minetest.chat_send_player( placer:get_player_name(), 'Not enough vertical space to place a door!' ) - return - end - minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_wood_plain_top_right", param2=fdir}) - return minetest.item_place(itemstack, placer, pointed_thing) - end - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == "homedecor:door_wood_plain_top_right" then - minetest.env:remove_node({x=pos.x, y=pos.y+1, z=pos.z}) - end - end, - on_punch = function(pos, node, puncher) - nfdir=node.param2+1 - if nfdir > 3 then nfdir = 0 end - minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_wood_plain_top_left", param2=nfdir}) - minetest.env:add_node(pos, { name = "homedecor:door_wood_plain_bottom_left", param2=nfdir}) - end -}) - diff --git a/init.lua b/init.lua index a192a899..cd92d191 100644 --- a/init.lua +++ b/init.lua @@ -11,25 +11,6 @@ -- License: LGPL -- -dofile(minetest.get_modpath("homedecor").."/door_wood_plain.lua") -dofile(minetest.get_modpath("homedecor").."/door_glass.lua") -dofile(minetest.get_modpath("homedecor").."/door_glass_and_wood.lua") -dofile(minetest.get_modpath("homedecor").."/door_glass_and_wood_mahogany.lua") -dofile(minetest.get_modpath("homedecor").."/door_glass_and_wood_white.lua") -dofile(minetest.get_modpath("homedecor").."/door_exterior_fancy.lua") -dofile(minetest.get_modpath("homedecor").."/door_closet_oak.lua") -dofile(minetest.get_modpath("homedecor").."/door_closet_mahogany.lua") - -dofile(minetest.get_modpath("homedecor").."/lighting.lua") -dofile(minetest.get_modpath("homedecor").."/fences.lua") -dofile(minetest.get_modpath("homedecor").."/kitchen_cabinet.lua") -dofile(minetest.get_modpath("homedecor").."/refrigerator.lua") -dofile(minetest.get_modpath("homedecor").."/oven.lua") -dofile(minetest.get_modpath("homedecor").."/nightstands.lua") -dofile(minetest.get_modpath("homedecor").."/television.lua") - -dofile(minetest.get_modpath("homedecor").."/crafts.lua") - local DEBUG = 0 -- Local Functions @@ -809,4 +790,17 @@ minetest.register_node("homedecor:curtain_"..color, { end +dofile(minetest.get_modpath("homedecor").."/door_models.lua") +dofile(minetest.get_modpath("homedecor").."/door_nodes.lua") + +dofile(minetest.get_modpath("homedecor").."/lighting.lua") +dofile(minetest.get_modpath("homedecor").."/fences.lua") +dofile(minetest.get_modpath("homedecor").."/kitchen_cabinet.lua") +dofile(minetest.get_modpath("homedecor").."/refrigerator.lua") +dofile(minetest.get_modpath("homedecor").."/oven.lua") +dofile(minetest.get_modpath("homedecor").."/nightstands.lua") +dofile(minetest.get_modpath("homedecor").."/television.lua") + +dofile(minetest.get_modpath("homedecor").."/crafts.lua") + print("[HomeDecor] Loaded!") diff --git a/textures/homedecor_door_closet_mahogany_lr.png b/textures/homedecor_door_closet_mahogany_lrb.png similarity index 100% rename from textures/homedecor_door_closet_mahogany_lr.png rename to textures/homedecor_door_closet_mahogany_lrb.png diff --git a/textures/homedecor_door_closet_mahogany_lrt.png b/textures/homedecor_door_closet_mahogany_lrt.png new file mode 100644 index 0000000000000000000000000000000000000000..d0a38d5c4634b1b6c88fd3048e925a65762b0c71 GIT binary patch literal 437 zcmV;m0ZRUfP)B*1ppU<}sx9jEC&)w@R{>+{fAlSOEZ42+4fy<4918oVR7<4l|p& zW`CiWmf9rD_nqk+?urFBGkV}{%$zee5`eW35fMSjWmu@jsclY0)e6SHae$yxV`8)CE58cJW3Hvr>NF;e0qL-bpP76U63o6Q&92i p!_$oiHy+%0aO1&^2mb{R{sCbNS)3M6p{@V`002ovPDHLkV1n-;zYYKZ literal 0 HcmV?d00001 diff --git a/textures/homedecor_door_exterior_fancy_lr.png b/textures/homedecor_door_exterior_fancy_lrb.png similarity index 100% rename from textures/homedecor_door_exterior_fancy_lr.png rename to textures/homedecor_door_exterior_fancy_lrb.png diff --git a/textures/homedecor_door_exterior_fancy_lrt.png b/textures/homedecor_door_exterior_fancy_lrt.png new file mode 100644 index 0000000000000000000000000000000000000000..87a43b4733dff7be2ccfa0f9c7d47df40dd40f7d GIT binary patch literal 305 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|oCO|{#S9F5he4R}c>anMpdfpR zr>`sf9WEAj6+M@3=667$3!W~HAsXj+?Q2$W_+H?fY-G$tPf{G2@9NF^~UD?R6 zib*JF-nEH5a%*>9zI*t0$Kjl#9;+JCl)1m(I@5FY?~QGOd~7S%26pzCarmutN#k-` zWvIV;`Q>NbzSBD_{s*m{ce3_=^<8(5>K{2zpF2XskIMF-pp1O_H3o*b@j0007hNklP;W2;bDfE1DY8)s`P zK+PHL6FqAta%=9j3EFe1H{(VMC7m) zz>&S2FDWMgVB==zuBelmN-My&?}%uS0e~c50ARg54gJsxKtzVQZh9=md;JB&Szp&(|P~x=_9js#DspPc7ReuX%i80miD;Ry#fKq z-tLMN)rbfolArIu1VUS-Ssxg**YmB)PV8tsz2q&I{Tn;itkFcDpFbMxoWG@E95u)B z`aX*^Q^0^#Yt0IoK)CB~*V7lIu9*TAwxe@is}N8*pP!2C+R_7n3NOd6AV5IYx~{W6 zr(?4%Vw+2t`jMCkl$bf?g0)?eg+Q}GPC3w?k6MfMcYw_vyQyqScIt*Ue0}CWLJot`U$>fx8>hGnhj&52}>7t~qK=Ox$Ztssgpy z-xQJ9^-{!j14)TXI1+l0Q#+G$TK;wDz!24%=J62oF}JHsGDA20SZcEDzXLy3Stv-_ RyPg05002ovPDHLkV1kD2Q9%Fz literal 0 HcmV?d00001 diff --git a/textures/homedecor_door_wood_glass_mahogany_lr.png b/textures/homedecor_door_wood_glass_mahogany_lrb.png similarity index 100% rename from textures/homedecor_door_wood_glass_mahogany_lr.png rename to textures/homedecor_door_wood_glass_mahogany_lrb.png diff --git a/textures/homedecor_door_wood_glass_mahogany_lrt.png b/textures/homedecor_door_wood_glass_mahogany_lrt.png new file mode 100644 index 0000000000000000000000000000000000000000..8e6c8f04363b0efdd1cbf9823bad1a9754338d70 GIT binary patch literal 698 zcmV;r0!96aP)pF2XskIMF-pp1qT`ymGH-C00076NklT(M;e2Syd$EkKcd$`^%oD z^w;NazrMd)qZ>CNZ&8 zTqarar2QBLaLD<@x0awaE;-$+dD{n$NZ_}M6tSEx@wN2xI#b~7WfXt{fnVr*+4;jP zYW}j7z%b0F>I&}yfwMbqTRE@uzCT6*4#@MwNC05$h%uTn1Q`XG;4cNc3IK9i*BDb& z@57S(P!V`?2SDo^fNzgunucX93Q~|=)m4d{Z%6%UnMy6gY%0>+AzYRdTiMS`-b&BY zItq{had}F(z5Ewb3^5`gG0($XWTK+oB2(m6d#?cDy$u@?JwTcZ0j}%X(F4TBZMy{d zd8VpLOuTKSb>C_YF%7$D;6LAM7Uubh=S*w$dP?fUazL7xH*>R2*RW3W*GChM>p(E) zcnS_TO3>GBJ51eumpF2XskIMF-pp1qUG#t}pCK00046NklqM^!vASnMo4D9AqXn2kE%G7NfOx1`R+& z2!m#3y?1K90EnRi_!r~sB4O58M08>WP3ys~3U>#aPRn4|&v6_eV69c#rX;bvB^_;> zo;ldXE$XrN#}1y{1NJufUTussbAJb6d#ja*>+Eb(PO5eva1$?+_pea>bK(5wLYRY9cHA~{ lfc-TMIvx?)rSI-6yC3~M6bbdZKobA}002ovPDHLkV1lyby@LP% literal 0 HcmV?d00001 diff --git a/textures/homedecor_door_wood_plain_lr.png b/textures/homedecor_door_wood_plain_lrb.png similarity index 100% rename from textures/homedecor_door_wood_plain_lr.png rename to textures/homedecor_door_wood_plain_lrb.png diff --git a/textures/homedecor_door_wood_plain_lrt.png b/textures/homedecor_door_wood_plain_lrt.png new file mode 100644 index 0000000000000000000000000000000000000000..13ea21380eadcaacf7ac757795ef803c4025ca93 GIT binary patch literal 724 zcmV;_0xSKAP)pB21N*Qs7_cqP*qWYh-Yh3U22dZs|7Q{Z{paiV??1hp?ZnIZ1S8J< zdMCZitN#Dnf5e8LKYxiiwo+iwaq|?zJ;q3=h)L%?DsA?VMgb{?^Rl)StkVR&8$%@& z=ciGCp8W0lKCLH^PJjT4V#~{E7+_c_rG%MS5g<+Lq7CO(M*&CbA`^wjx1nMPQ=aKbf-LR0AK(EVk5n%;V1+nBL z(1rnS7G@y?>_p1s+O@GF!vLwtDA1ar1GOBy)hQRhoJRplQ%R|mR&pX%+9(3-q=#j& zTt3-pMHC{U)|zpXW(@b=qktUa`_ErpfRrKD77@3{Zv8y0roGJGT0ghesH70XQF059 zeH5^L{5H;%un`b3vo*FHiDcA#V7BwRLhrd|B4t_^ZT;@YqE}N+CqtZXdb#$q!oHH~W#Dw}Ep;|PJIx0jd8`;Q+X49lR!z4pq4U4R&+ z<-m-6+^X2N?R=gQ5u__(I?~;(CmGiw@6IhHIf^!xtY2&E^Lc)Lejb*A;huq=PAO5z z2?a|EZXQFK46tLY;=lygQK5%~**tzmdsavuQz0000