Wrote a whole new door routine, used it to add solid glass and glass-and-wood

doors, converted the others to use that new code, and all use nodeboxes now.
Folding doors are now called "closet" doors and will be converted via a handful
of aliases.  Tweaked crafting recipe for oak closet door to put the steel ingot
on the left.  Moves all doors' crafting recipes into crafts.lua.  This sweeps
away the old buggy zlpdoors-derived code.
这个提交包含在:
Vanessa Ezekowitz
2012-10-04 07:24:36 -04:00
父节点 ce59c7f130
当前提交 9798c4fa36
修改 53 个文件,包含 83473 行新增41 行删除

查看文件

@@ -1367,3 +1367,158 @@ minetest.register_craft( {
"homedecor:fence_chainlink_gate_closed" "homedecor:fence_chainlink_gate_closed"
}, },
}) })
-- doors
-- fancy exterior
minetest.register_craft( {
output = "homedecor:door_exterior_fancy_bottom_left 2",
recipe = {
{ "default:wood", "default:glass" },
{ "default:wood", "default:wood" },
{ "default:wood", "default:wood" },
},
})
minetest.register_craft( {
type = "shapeless",
output = "homedecor:door_exterior_fancy_bottom_left",
recipe = {
"homedecor:door_exterior_fancy_bottom_right"
},
})
minetest.register_craft( {
type = "shapeless",
output = "homedecor:door_exterior_fancy_bottom_right",
recipe = {
"homedecor:door_exterior_fancy_bottom_left"
},
})
-- wood and glass (grid style)
minetest.register_craft( {
output = "homedecor:door_wood_glass_bottom_left 2",
recipe = {
{ "default:glass", "default:wood" },
{ "default:wood", "default:glass" },
{ "default:glass", "default:wood" },
},
})
minetest.register_craft( {
type = "shapeless",
output = "homedecor:door_wood_glass_bottom_left",
recipe = {
"homedecor:door_wood_glass_bottom_right"
},
})
minetest.register_craft( {
type = "shapeless",
output = "homedecor:door_wood_glass_bottom_right",
recipe = {
"homedecor:door_wood_glass_bottom_left"
},
})
-- Solid glass with metal handle
minetest.register_craft( {
output = "homedecor:door_glass_bottom_left 2",
recipe = {
{ "default:glass", "default:glass" },
{ "default:glass", "default:steel_ingot" },
{ "default:glass", "default:glass" },
},
})
minetest.register_craft( {
type = "shapeless",
output = "homedecor:door_glass_bottom_left",
recipe = {
"homedecor:door_glass_bottom_right"
},
})
minetest.register_craft( {
type = "shapeless",
output = "homedecor:door_glass_bottom_right",
recipe = {
"homedecor:door_glass_bottom_left"
},
})
-- Closet doors
-- oak
minetest.register_craft( {
output = "homedecor:door_closet_oak_bottom_left 2",
recipe = {
{ "", "default:stick", "default:stick" },
{ "default:steel_ingot", "default:stick", "default:stick" },
{ "", "default:stick", "default:stick" },
},
})
minetest.register_craft( {
type = "shapeless",
output = "homedecor:door_closet_oak_bottom_left",
recipe = {
"homedecor:door_closet_oak_bottom_right"
},
})
minetest.register_craft( {
type = "shapeless",
output = "homedecor:door_closet_oak_bottom_right",
recipe = {
"homedecor:door_closet_oak_bottom_left"
},
})
-- mahogany
minetest.register_craft( {
type = "shapeless",
output = "homedecor:door_closet_mahogany_bottom_left 2",
recipe = {
"homedecor:door_closet_oak_bottom_left",
"homedecor:door_closet_oak_bottom_left",
"default:dirt",
"default:coal_lump",
},
})
minetest.register_craft( {
type = "shapeless",
output = "homedecor:door_closet_mahogany_bottom_left 2",
recipe = {
"homedecor:door_closet_oak_bottom_left",
"homedecor:door_closet_oak_bottom_left",
"unifieddyes:dark_orange"
},
replacements = { {'unifieddyes:dark_orange', 'vessels:glass_bottle'}, },
})
minetest.register_craft( {
type = "shapeless",
output = "homedecor:door_closet_mahogany_bottom_left",
recipe = {
"homedecor:door_closet_mahogany_bottom_right"
},
})
minetest.register_craft( {
type = "shapeless",
output = "homedecor:door_closet_mahogany_bottom_right",
recipe = {
"homedecor:door_closet_mahogany_bottom_left"
},
})

82117
debug.txt 普通文件

文件差异内容过多而无法显示 加载差异

275
door_closet_mahogany.lua 普通文件
查看文件

@@ -0,0 +1,275 @@
-- 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, -0.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, 0.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)
fdir = minetest.dir_to_facedir(placer:get_look_dir())
local pos = pointed_thing.above
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,
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, -0.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, 0.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)
fdir = minetest.dir_to_facedir(placer:get_look_dir())
local pos = pointed_thing.above
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,
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")

275
door_closet_oak.lua 普通文件
查看文件

@@ -0,0 +1,275 @@
-- 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, -0.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, 0.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)
fdir = minetest.dir_to_facedir(placer:get_look_dir())
local pos = pointed_thing.above
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,
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, -0.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, 0.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)
fdir = minetest.dir_to_facedir(placer:get_look_dir())
local pos = pointed_thing.above
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,
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")

227
door_exterior_fancy.lua 普通文件
查看文件

@@ -0,0 +1,227 @@
-- 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, -0.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, 0.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)
fdir = minetest.dir_to_facedir(placer:get_look_dir())
local pos = pointed_thing.above
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,
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, -0.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, 0.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)
fdir = minetest.dir_to_facedir(placer:get_look_dir())
local pos = pointed_thing.above
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,
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:door_exterior_fancy_a_c", "homedecor:door_exterior_fancy_top_left")
minetest.register_alias("homedecor:door_exterior_fancy_a_o", "homedecor:door_exterior_fancy_top_right")
minetest.register_alias("homedecor:door_exterior_fancy_b_c", "homedecor:door_exterior_fancy_bottom_left")
minetest.register_alias("homedecor:door_exterior_fancy_b_o", "homedecor:door_exterior_fancy_bottom_right")
minetest.register_alias("homedecor:door_exterior_fancy_a_c_right", "homedecor:door_exterior_fancy_top_right")
minetest.register_alias("homedecor:door_exterior_fancy_a_o_right", "homedecor:door_exterior_fancy_top_left")
minetest.register_alias("homedecor:door_exterior_fancy_b_c_right", "homedecor:door_exterior_fancy_bottom_right")
minetest.register_alias("homedecor:door_exterior_fancy_b_o_right", "homedecor:door_exterior_fancy_bottom_left")
minetest.register_alias("homedecor:door_exterior_fancy", "homedecor:door_exterior_fancy_bottom_left")
minetest.register_alias("homedecor:door_exterior_fancy_right", "homedecor:door_exterior_fancy_bottom_right")

197
door_glass.lua 普通文件
查看文件

@@ -0,0 +1,197 @@
-- 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_lr.png",
"homedecor_door_glass_lr.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, -8/16, 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_lr.png",
"homedecor_door_glass_lr.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, 8/16, 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)
fdir = minetest.dir_to_facedir(placer:get_look_dir())
local pos = pointed_thing.above
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,
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_lr.png",
"homedecor_door_glass_lr.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, -8/16, 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_lr.png",
"homedecor_door_glass_lr.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, 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",
on_place = function(itemstack, placer, pointed_thing)
fdir = minetest.dir_to_facedir(placer:get_look_dir())
local pos = pointed_thing.above
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,
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
})

220
door_glass_and_wood.lua 普通文件
查看文件

@@ -0,0 +1,220 @@
-- 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, -0.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, 0.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)
fdir = minetest.dir_to_facedir(placer:get_look_dir())
local pos = pointed_thing.above
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,
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, -0.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, 0.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)
fdir = minetest.dir_to_facedir(placer:get_look_dir())
local pos = pointed_thing.above
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,
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
})

查看文件

@@ -11,6 +11,12 @@
-- License: LGPL -- License: LGPL
-- --
dofile(minetest.get_modpath("homedecor").."/door_glass.lua")
dofile(minetest.get_modpath("homedecor").."/door_glass_and_wood.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").."/lighting.lua")
dofile(minetest.get_modpath("homedecor").."/fences.lua") dofile(minetest.get_modpath("homedecor").."/fences.lua")
dofile(minetest.get_modpath("homedecor").."/kitchen_cabinet.lua") dofile(minetest.get_modpath("homedecor").."/kitchen_cabinet.lua")
@@ -18,9 +24,7 @@ dofile(minetest.get_modpath("homedecor").."/refrigerator.lua")
dofile(minetest.get_modpath("homedecor").."/oven.lua") dofile(minetest.get_modpath("homedecor").."/oven.lua")
dofile(minetest.get_modpath("homedecor").."/nightstands.lua") dofile(minetest.get_modpath("homedecor").."/nightstands.lua")
dofile(minetest.get_modpath("homedecor").."/television.lua") dofile(minetest.get_modpath("homedecor").."/television.lua")
dofile(minetest.get_modpath("homedecor").."/foldingdoors_oak.lua")
dofile(minetest.get_modpath("homedecor").."/foldingdoors_mahogany.lua")
dofile(minetest.get_modpath("homedecor").."/exterior_door_fancy.lua")
dofile(minetest.get_modpath("homedecor").."/crafts.lua") dofile(minetest.get_modpath("homedecor").."/crafts.lua")
local DEBUG = 0 local DEBUG = 0
@@ -443,44 +447,6 @@ minetest.register_node('homedecor:wood_table_small_square', {
}, },
}) })
minetest.register_node('homedecor:folding_door_mahogany', {
description = "Mahogany Folding Door",
tiles = { 'homedecor_folding_door_mahogany.png' },
inventory_image = 'homedecor_folding_door_mahogany.png',
wield_image = 'homedecor_folding_door_mahogany.png',
drawtype = 'signlike',
sunlight_propagates = false,
paramtype = "light",
paramtype2 = "facedir",
walkable = false,
groups = { snappy = 3 },
sounds = default.node_sound_leaves_defaults(),
paramtype2 = 'wallmounted',
selection_box = {
type = "wallmounted",
--wall_side = = <default>
},
})
minetest.register_node('homedecor:folding_door_oak', {
description = "Oak Folding Door",
tiles = { 'homedecor_folding_door_oak.png' },
inventory_image = 'homedecor_folding_door_oak.png',
wield_image = 'homedecor_folding_door_oak.png',
drawtype = 'signlike',
sunlight_propagates = false,
paramtype = "light",
paramtype2 = "facedir",
walkable = false,
groups = { snappy = 3 },
sounds = default.node_sound_leaves_defaults(),
paramtype2 = 'wallmounted',
selection_box = {
type = "wallmounted",
--wall_side = = <default>
},
})
minetest.register_node('homedecor:shutter_black', { minetest.register_node('homedecor:shutter_black', {
description = "Wooden Shutter (Black)", description = "Wooden Shutter (Black)",
tiles = { 'homedecor_window_shutter_black.png' }, tiles = { 'homedecor_window_shutter_black.png' },

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 1.6 KiB

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 3.7 KiB

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 1.6 KiB

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 437 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 1.5 KiB

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 3.8 KiB

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 1.6 KiB

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 573 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 1.6 KiB

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 3.8 KiB

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 1.6 KiB

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 447 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 1.6 KiB

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 3.8 KiB

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 1.6 KiB

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 589 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 706 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 515 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 736 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 305 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 706 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 505 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 740 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 317 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 364 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 375 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 345 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 613 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 339 B

二进制
textures/homedecor_door_glass_lr.png 普通文件

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 199 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 345 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 640 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 337 B

二进制
textures/homedecor_door_glass_tb.png 普通文件

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 188 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 364 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 375 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 3.9 KiB

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 1.8 KiB

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 3.9 KiB

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 2.0 KiB

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 735 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 1.9 KiB

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 3.8 KiB

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 1.9 KiB

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 702 B