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.
|
@ -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")
|
|
@ -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")
|
|
@ -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")
|
225
door_glass.lua
|
@ -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
|
||||
})
|
||||
|
|
@ -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
|
||||
})
|
|
@ -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
|
||||
})
|
|
@ -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
|
||||
})
|
317
door_models.lua
Normal file
|
@ -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 }}
|
||||
},
|
||||
|
||||
}
|
||||
|
268
door_nodes.lua
Normal file
|
@ -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
|
||||
|
|
@ -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
|
||||
})
|
||||
|
32
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!")
|
||||
|
|
Before Width: | Height: | Size: 437 B After Width: | Height: | Size: 437 B |
BIN
textures/homedecor_door_closet_mahogany_lrt.png
Normal file
After Width: | Height: | Size: 437 B |
Before Width: | Height: | Size: 447 B After Width: | Height: | Size: 447 B |
BIN
textures/homedecor_door_closet_oak_lrt.png
Normal file
After Width: | Height: | Size: 447 B |
Before Width: | Height: | Size: 305 B After Width: | Height: | Size: 305 B |
BIN
textures/homedecor_door_exterior_fancy_lrt.png
Normal file
After Width: | Height: | Size: 305 B |
Before Width: | Height: | Size: 735 B After Width: | Height: | Size: 735 B |
BIN
textures/homedecor_door_wood_glass_lrt.png
Normal file
After Width: | Height: | Size: 735 B |
Before Width: | Height: | Size: 698 B After Width: | Height: | Size: 698 B |
BIN
textures/homedecor_door_wood_glass_mahogany_lrt.png
Normal file
After Width: | Height: | Size: 698 B |
Before Width: | Height: | Size: 443 B After Width: | Height: | Size: 443 B |
BIN
textures/homedecor_door_wood_glass_white_lrt.png
Normal file
After Width: | Height: | Size: 443 B |
Before Width: | Height: | Size: 724 B After Width: | Height: | Size: 724 B |
BIN
textures/homedecor_door_wood_plain_lrt.png
Normal file
After Width: | Height: | Size: 724 B |