Updated homedecor
- Added kingsize beds
@ -20,7 +20,7 @@ minetest.register_craft({
|
||||
minetest.register_craft({
|
||||
output = 'building_blocks:Tarmac_spread 4',
|
||||
recipe = {
|
||||
{"building_blocks:Tar", "building_blocks:Tar"},
|
||||
{"group:tar_block", "group:tar_block"},
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
@ -60,8 +60,8 @@ minetest.register_craft({
|
||||
minetest.register_craft({
|
||||
output = 'building_blocks:BWtile 10',
|
||||
recipe = {
|
||||
{"building_blocks:Marble", "building_blocks:Tar"},
|
||||
{"building_blocks:Tar", "building_blocks:Marble"},
|
||||
{"group:marble", "group:tar_block"},
|
||||
{"group:tar_block", "group:marble"},
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
@ -501,7 +501,7 @@ minetest.register_craftitem("building_blocks:tar_base", {
|
||||
minetest.register_craft({
|
||||
output = 'building_blocks:knife 1',
|
||||
recipe = {
|
||||
{"building_blocks:Tar"},
|
||||
{"group:tar_block"},
|
||||
{"group:stick"},
|
||||
}
|
||||
})
|
||||
@ -520,14 +520,14 @@ minetest.register_node("building_blocks:Tar", {
|
||||
description = "Tar",
|
||||
tiles = {"building_blocks_tar.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=1},
|
||||
groups = {crumbly=1, tar_block = 1},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
minetest.register_node("building_blocks:Marble", {
|
||||
description = "Marble",
|
||||
tiles = {"building_blocks_marble.png"},
|
||||
is_ground_content = true,
|
||||
groups = {cracky=3},
|
||||
groups = {cracky=3, marble = 1},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
minetest.register_craft({
|
||||
@ -559,14 +559,12 @@ minetest.register_tool("building_blocks:knife", {
|
||||
},
|
||||
})
|
||||
|
||||
minetest.add_to_creative_inventory('building_blocks:Tar 0')
|
||||
minetest.add_to_creative_inventory('building_blocks:hardwood 0')
|
||||
minetest.register_craft({
|
||||
output = "building_blocks:Marble 9",
|
||||
recipe = {
|
||||
{"default:clay", "building_blocks:Tar", "default:clay"},
|
||||
{"building_blocks:Tar","default:clay", "building_blocks:Tar"},
|
||||
{"default:clay", "building_blocks:Tar","default:clay"},
|
||||
{"default:clay", "group:tar_block", "default:clay"},
|
||||
{"group:tar_block","default:clay", "group:tar_block"},
|
||||
{"default:clay", "group:tar_block","default:clay"},
|
||||
}
|
||||
})
|
||||
|
||||
@ -582,9 +580,9 @@ if not minetest.get_modpath("technic") then
|
||||
minetest.register_craft({
|
||||
output = "technic:granite 9",
|
||||
recipe = {
|
||||
{ "building_blocks:Tar", "building_blocks:Marble", "building_blocks:Tar" },
|
||||
{ "building_blocks:Marble", "building_blocks:Tar", "building_blocks:Marble" },
|
||||
{ "building_blocks:Tar", "building_blocks:Marble", "building_blocks:Tar" }
|
||||
{ "group:tar_block", "group:marble", "group:tar_block" },
|
||||
{ "group:marble", "group:tar_block", "group:marble" },
|
||||
{ "group:tar_block", "group:marble", "group:tar_block" }
|
||||
},
|
||||
})
|
||||
|
||||
@ -594,15 +592,6 @@ if not minetest.get_modpath("technic") then
|
||||
groups={cracky=1, not_in_creative_inventory=1},
|
||||
tiles={"technic_granite.png"},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "technic:granite 9",
|
||||
recipe = {
|
||||
{ "moreblocks:tar", "building_blocks:Marble", "moreblocks:tar" },
|
||||
{ "building_blocks:Marble", "moreblocks:tar", "building_blocks:Marble" },
|
||||
{ "moreblocks:tar", "building_blocks:Marble", "moreblocks:tar" }
|
||||
},
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -1278,6 +1278,24 @@ minetest.register_craft({
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:candlestick_wrought_iron",
|
||||
recipe = {
|
||||
{""},
|
||||
{"homedecor:candle_thin"},
|
||||
{"default:iron_lump"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:candlestick_brass",
|
||||
recipe = {
|
||||
{""},
|
||||
{"homedecor:candle_thin"},
|
||||
{"technic:brass_ingot"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:oil_lamp 4",
|
||||
recipe = {
|
||||
@ -2427,8 +2445,8 @@ for i in ipairs(color_pairings) do
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:tiles_"..result.." 2",
|
||||
recipe = {
|
||||
{ "building_blocks:Marble", "dye:"..dye1 },
|
||||
{ "building_blocks:Marble", "dye:"..dye2 }
|
||||
{ "group:marble", "dye:"..dye1 },
|
||||
{ "group:marble", "dye:"..dye2 }
|
||||
},
|
||||
})
|
||||
end
|
||||
@ -2674,12 +2692,19 @@ for c in ipairs(bedcolors) do
|
||||
local woolcolor = bedcolors[c][2]
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:bed_"..color.."_foot",
|
||||
recipe = {
|
||||
{ "group:stick", "", "group:stick" },
|
||||
{ "wool:white", "wool:"..woolcolor, "wool:"..woolcolor },
|
||||
{ "group:wood", "", "group:wood" },
|
||||
},
|
||||
output = "homedecor:bed_"..color.."_regular",
|
||||
recipe = {
|
||||
{ "group:stick", "", "group:stick" },
|
||||
{ "wool:white", "wool:"..woolcolor, "wool:"..woolcolor },
|
||||
{ "group:wood", "", "group:wood" },
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:bed_"..color.."_kingsize",
|
||||
recipe = {
|
||||
{ "homedecor:bed_"..color.."_regular", "homedecor:bed_"..color.."_regular" }
|
||||
},
|
||||
})
|
||||
|
||||
end
|
||||
@ -3120,6 +3145,23 @@ minetest.register_craft({
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:ceiling_lamp",
|
||||
recipe = {
|
||||
{ "", "technic:brass_ingot", ""},
|
||||
{ "", "homedecor:chainlink_brass", ""},
|
||||
{ "default:glass", "homedecor:glowlight_small_cube_white", "default:glass"}
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "homedecor:ceiling_lamp",
|
||||
recipe = {
|
||||
{ "", "chains:chain_top_brass", ""},
|
||||
{ "default:glass", "homedecor:glowlight_small_cube_white", "default:glass"}
|
||||
},
|
||||
})
|
||||
|
||||
if (minetest.get_modpath("technic") and minetest.get_modpath("dye") and minetest.get_modpath("bees")) then
|
||||
technic.register_separating_recipe({ input = {"bees:wax 1"}, output = {"homedecor:oil_extract 2","dye:yellow 1"} })
|
||||
end
|
||||
|
@ -1,380 +0,0 @@
|
||||
|
||||
local S = homedecor.gettext
|
||||
|
||||
homedecor.door_models = {
|
||||
{
|
||||
"closet_mahogany",
|
||||
S("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",
|
||||
S("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",
|
||||
S("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",
|
||||
S("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",
|
||||
S("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",
|
||||
S("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",
|
||||
S("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",
|
||||
S("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 }}
|
||||
},
|
||||
|
||||
----------
|
||||
|
||||
{
|
||||
"bedroom",
|
||||
S("White Bedroom 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 }}
|
||||
},
|
||||
|
||||
----------
|
||||
|
||||
{
|
||||
"wrought_iron",
|
||||
S("Wrought Iron Gate/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 }}
|
||||
},
|
||||
|
||||
---------
|
||||
|
||||
{
|
||||
"woodglass",
|
||||
S("Woodglass 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 }}
|
||||
},
|
||||
|
||||
---------
|
||||
|
||||
{
|
||||
"woodglass2",
|
||||
S("Woodglass door type2"),
|
||||
|
||||
{{ -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 }}
|
||||
},
|
||||
|
||||
}
|
||||
|
@ -120,119 +120,133 @@ local function addDoorNode(pos,def,isClosed)
|
||||
minetest.get_meta(pos):set_int('closed', isClosed and 1 or 0)
|
||||
end
|
||||
|
||||
local door_model_list = {
|
||||
{ name = "closet_mahogany",
|
||||
description = S("Mahogany Closet Door"),
|
||||
mesh = "homedecor_door_closet.obj"
|
||||
},
|
||||
|
||||
{ name = "closet_oak",
|
||||
description = S("Oak Closet Door"),
|
||||
mesh = "homedecor_door_closet.obj"
|
||||
},
|
||||
|
||||
{ name = "exterior_fancy",
|
||||
description = S("Fancy Wood/Glass Door"),
|
||||
mesh = "homedecor_door_fancy.obj",
|
||||
tiles = {
|
||||
"homedecor_door_exterior_fancy.png",
|
||||
"homedecor_door_exterior_fancy_insert.png"
|
||||
},
|
||||
usealpha = true
|
||||
},
|
||||
|
||||
{ name = "glass",
|
||||
description = S("Glass Office Door"),
|
||||
mesh = "homedecor_door_plain.obj"
|
||||
},
|
||||
|
||||
{ name = "wood_glass_oak",
|
||||
description = S("Glass and Wood, Oak-colored"),
|
||||
mesh = "homedecor_door_wood_glass.obj",
|
||||
tiles = {
|
||||
"homedecor_door_wood_glass_oak.png",
|
||||
"homedecor_door_wood_glass_insert.png",
|
||||
}
|
||||
},
|
||||
|
||||
{ name = "wood_glass_mahogany",
|
||||
description = S("Glass and Wood, Mahogany-colored"),
|
||||
mesh = "homedecor_door_wood_glass.obj",
|
||||
tiles = {
|
||||
"homedecor_door_wood_glass_mahogany.png",
|
||||
"homedecor_door_wood_glass_insert.png",
|
||||
}
|
||||
},
|
||||
|
||||
{ name = "wood_glass_white",
|
||||
description = S("Glass and Wood, White"),
|
||||
mesh = "homedecor_door_wood_glass.obj",
|
||||
tiles = {
|
||||
"homedecor_door_wood_glass_white.png",
|
||||
"homedecor_door_wood_glass_insert.png",
|
||||
}
|
||||
},
|
||||
|
||||
{ name = "wood_plain",
|
||||
description = S("Plain Wooden Door"),
|
||||
mesh = "homedecor_door_plain.obj"
|
||||
},
|
||||
|
||||
{ name = "bedroom",
|
||||
description = S("White Bedroom Door"),
|
||||
mesh = "homedecor_door_plain.obj"
|
||||
},
|
||||
|
||||
{ name = "wrought_iron",
|
||||
description = S("Wrought Iron Gate/Door"),
|
||||
mesh = "homedecor_door_plain.obj"
|
||||
},
|
||||
|
||||
{ name = "woodglass",
|
||||
description = S("Wooden door with glass insert"),
|
||||
mesh = "homedecor_door_woodglass_typea.obj",
|
||||
tiles = {
|
||||
"homedecor_door_woodglass_typea.png",
|
||||
"homedecor_door_woodglass_typea_insert.png",
|
||||
},
|
||||
usealpha = true
|
||||
},
|
||||
|
||||
{ name = "woodglass2",
|
||||
description = S("Wooden door with glass insert, type 2"),
|
||||
mesh = "homedecor_door_plain.obj",
|
||||
usealpha = true
|
||||
},
|
||||
}
|
||||
|
||||
local def_selbox = {
|
||||
type = "fixed",
|
||||
fixed = { -0.5, -0.5, 0.375, 0.5, 1.5, 0.5 }
|
||||
}
|
||||
|
||||
local sides = {"left", "right"}
|
||||
local rsides = {"right", "left"}
|
||||
|
||||
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 = homedecor.door_models[j][5]
|
||||
local nodeboxes_bottom = homedecor.door_models[j][6]
|
||||
local texalpha = false
|
||||
if doorname == "exterior_fancy" or "woodglass" or "woodglass2" then
|
||||
texalpha = true
|
||||
for _, door_model in ipairs(door_model_list) do
|
||||
|
||||
local doorname = door_model.name
|
||||
|
||||
local selbox = door_model.selectbox or def_selbox
|
||||
local colbox = door_model.collisionbox or door_model.selectbox or def_selbox
|
||||
local mesh = door_model.mesh
|
||||
local groups = {snappy = 3}
|
||||
|
||||
if side == "right" then
|
||||
mesh = string.gsub(door_model.mesh, ".obj", "_right.obj")
|
||||
groups = {snappy = 3, not_in_creative_inventory = 1}
|
||||
end
|
||||
|
||||
if side == "left" then
|
||||
nodeboxes_top = homedecor.door_models[j][3]
|
||||
nodeboxes_bottom = homedecor.door_models[j][4]
|
||||
end
|
||||
|
||||
local lower_top_side = "homedecor_door_"..doorname.."_tb.png"
|
||||
local upper_bottom_side = "homedecor_door_"..doorname.."_tb.png"
|
||||
|
||||
if doorname == "glass" or doorname == "wrought_iron" then
|
||||
lower_top_side = "homedecor_blanktile.png"
|
||||
upper_bottom_side = "homedecor_blanktile.png"
|
||||
end
|
||||
|
||||
local tiles_upper = {
|
||||
"homedecor_door_"..doorname.."_tb.png",
|
||||
upper_bottom_side,
|
||||
"homedecor_door_"..doorname.."_lrt.png",
|
||||
"homedecor_door_"..doorname.."_lrt.png",
|
||||
"homedecor_door_"..doorname.."_"..rside.."_top.png",
|
||||
"homedecor_door_"..doorname.."_"..side.."_top.png",
|
||||
}
|
||||
|
||||
local tiles_lower = {
|
||||
lower_top_side,
|
||||
"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}
|
||||
}
|
||||
|
||||
minetest.register_node("homedecor:door_"..doorname.."_top_"..side, {
|
||||
description = doordesc.." "..S("(Top Half, %s-opening)"):format(side),
|
||||
drawtype = "nodebox",
|
||||
tiles = tiles_upper,
|
||||
minetest.register_node("homedecor:door_"..doorname.."_"..side, {
|
||||
description = door_model.description.." "..S("(%s-opening)"):format(side),
|
||||
drawtype = "mesh",
|
||||
mesh = mesh,
|
||||
tiles = door_model.tiles or { "homedecor_door_"..doorname..".png" },
|
||||
inventory_image = "homedecor_door_"..doorname.."_inv.png",
|
||||
wield_image = "homedecor_door_"..doorname.."_inv.png",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy=3, not_in_creative_inventory=1},
|
||||
groups = groups,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
use_texture_alpha = texalpha,
|
||||
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.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == "homedecor:door_"..doorname.."_bottom_"..side then
|
||||
minetest.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
|
||||
})
|
||||
|
||||
local dgroups = {snappy=3, not_in_creative_inventory=1}
|
||||
if side == "left" then
|
||||
dgroups = {snappy=3}
|
||||
end
|
||||
|
||||
minetest.register_node("homedecor:door_"..doorname.."_bottom_"..side, {
|
||||
description = doordesc.." "..S("(%s-opening)"):format(side),
|
||||
drawtype = "nodebox",
|
||||
tiles = tiles_lower,
|
||||
inventory_image = "homedecor_door_"..doorname.."_left_inv.png",
|
||||
wield_image = "homedecor_door_"..doorname.."_left_inv.png",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = dgroups,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
use_texture_alpha = texalpha,
|
||||
selection_box = selectboxes_bottom,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = nodeboxes_bottom
|
||||
},
|
||||
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||
if minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == "homedecor:door_"..doorname.."_top_"..side then
|
||||
minetest.remove_node({x=pos.x, y=pos.y+1, z=pos.z})
|
||||
end
|
||||
end,
|
||||
use_texture_alpha = door_model.usealpha,
|
||||
selection_box = selbox,
|
||||
collision_box = colbox,
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return homedecor.stack_wing(itemstack, placer, pointed_thing,
|
||||
"homedecor:door_"..doorname.."_bottom_left", "homedecor:door_"..doorname.."_top_left",
|
||||
"homedecor:door_"..doorname.."_bottom_right", "homedecor:door_"..doorname.."_top_right")
|
||||
"homedecor:door_"..doorname.."_left", "air",
|
||||
"homedecor:door_"..doorname.."_right", "air")
|
||||
end,
|
||||
on_construct = function(pos)
|
||||
minetest.get_meta(pos):set_int("closed", 1)
|
||||
@ -240,32 +254,40 @@ for i in ipairs(sides) do
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
homedecor.flip_door(pos, node, clicker, doorname, side)
|
||||
end,
|
||||
-- both left and right doors may be used for open or closed doors
|
||||
-- so they have to have both action_on and action_off and just
|
||||
-- check when that action is invoked if to continue
|
||||
-- both left and right doors may be used for open or closed doors
|
||||
-- so they have to have both action_on and action_off and just
|
||||
-- check when that action is invoked if to continue
|
||||
|
||||
on_punch = function(pos, node, puncher)
|
||||
minetest.get_meta(pos):set_string('closed',nil)
|
||||
end,
|
||||
drop = "homedecor:door_"..doorname.."_bottom_left",
|
||||
mesecons = {
|
||||
effector = {
|
||||
action_on = function(pos,node)
|
||||
local isClosed = getClosed(pos)
|
||||
if isClosed then
|
||||
homedecor.flip_door(pos,node,nil,doorname,side,isClosed)
|
||||
end
|
||||
end,
|
||||
action_off = function(pos,node)
|
||||
local isClosed = getClosed(pos)
|
||||
if not isClosed then
|
||||
homedecor.flip_door(pos,node,nil,doorname,side,isClosed)
|
||||
end
|
||||
end
|
||||
}
|
||||
}
|
||||
on_punch = function(pos, node, puncher)
|
||||
minetest.get_meta(pos):set_string('closed',nil)
|
||||
end,
|
||||
drop = "homedecor:door_"..doorname.."_left",
|
||||
mesecons = {
|
||||
effector = {
|
||||
action_on = function(pos,node)
|
||||
local isClosed = getClosed(pos)
|
||||
if isClosed then
|
||||
homedecor.flip_door(pos,node,nil,doorname,side,isClosed)
|
||||
end
|
||||
end,
|
||||
action_off = function(pos,node)
|
||||
local isClosed = getClosed(pos)
|
||||
if not isClosed then
|
||||
homedecor.flip_door(pos,node,nil,doorname,side,isClosed)
|
||||
end
|
||||
end
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_alias("homedecor:door_"..doorname.."_top_"..side, "air")
|
||||
minetest.register_alias("homedecor:door_"..doorname.."_bottom_"..side, "homedecor:door_"..doorname.."_"..side)
|
||||
|
||||
end
|
||||
|
||||
minetest.register_alias("homedecor:door_wood_glass_top_"..side, "air")
|
||||
minetest.register_alias("homedecor:door_wood_glass_bottom_"..side, "homedecor:door_wood_glass_oak_"..side)
|
||||
|
||||
end
|
||||
|
||||
-- Gates
|
||||
@ -463,112 +485,56 @@ function homedecor.flip_gate(pos, node, player, gate, oc)
|
||||
end
|
||||
end
|
||||
|
||||
-- "paper" door/wall
|
||||
-- Japanese-style wood/paper wall pieces and door
|
||||
|
||||
local jp_cbox = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, 0, 0.5, 0.5, 0.0625},
|
||||
}
|
||||
|
||||
minetest.register_node("homedecor:japanese_wall_top", {
|
||||
tiles = {
|
||||
"homedecor_japanese_wall_edges.png",
|
||||
"homedecor_japanese_wall_edges.png",
|
||||
"homedecor_japanese_wall_edges.png",
|
||||
"homedecor_japanese_wall_edges.png",
|
||||
"homedecor_japanese_wall_top.png",
|
||||
"homedecor_japanese_wall_top.png"
|
||||
},
|
||||
description = "Japanese wall (top)",
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy=3},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, 0.03125, 0.5, 0.5, 0.03125}, -- NodeBox1
|
||||
{-0.5, -0.5, 0, -0.469, 0.5, 0.0625}, -- NodeBox2
|
||||
{0.469, -0.5, 0, 0.5, 0.5, 0.0625}, -- NodeBox3
|
||||
{-0.5, -0.5, 0, 0.5, -0.46875, 0.0625}, -- NodeBox4
|
||||
{-0.5, 0.219, 0, 0.5, 0.5, 0.0625}, -- NodeBox5
|
||||
{-0.031, -0.5, 0, 0.031, 0.5, 0.0625}, -- NodeBox6
|
||||
{-0.5, -0.031, 0, 0.5, 0.03125, 0.0625}, -- NodeBox7
|
||||
{-0.281, -0.5, 0, -0.219, 0.5, 0.0625}, -- NodeBox8
|
||||
{0.219, -0.5, 0, 0.281, 0.5, 0.0625}, -- NodeBox9
|
||||
{-0.5, -0.281, 0, 0.5, -0.21875, 0.0625}, -- NodeBox10
|
||||
}
|
||||
drawtype = "mesh",
|
||||
mesh = "homedecor_wall_japanese_top.obj",
|
||||
tiles = {
|
||||
"homedecor_japanese_wood.png",
|
||||
"homedecor_japanese_paper.png"
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, 0, 0.5, 0.5, 0.0625},
|
||||
}
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy=3},
|
||||
selection_box = jp_cbox,
|
||||
collision_box = jp_cbox,
|
||||
})
|
||||
|
||||
minetest.register_node("homedecor:japanese_wall_middle", {
|
||||
tiles = {
|
||||
"homedecor_japanese_wall_edges.png",
|
||||
"homedecor_japanese_wall_edges.png",
|
||||
"homedecor_japanese_wall_edges.png",
|
||||
"homedecor_japanese_wall_edges.png",
|
||||
"homedecor_japanese_wall_middle.png",
|
||||
"homedecor_japanese_wall_middle.png"
|
||||
},
|
||||
description = "Japanese wall",
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy=3},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, 0.03125, 0.5, 0.5, 0.03125}, -- NodeBox1
|
||||
{-0.5, -0.5, 0, -0.469, 0.5, 0.0625}, -- NodeBox2
|
||||
{0.469, -0.5, 0, 0.5, 0.5, 0.0625}, -- NodeBox3
|
||||
{-0.5, -0.5, 0, 0.5, -0.46875, 0.0625}, -- NodeBox4
|
||||
{-0.5, 0.469, 0, 0.5, 0.5, 0.0625}, -- NodeBox5
|
||||
{-0.031, -0.5, 0, 0.031, 0.5, 0.0625}, -- NodeBox6
|
||||
{-0.5, -0.031, 0, 0.5, 0.03125, 0.0625}, -- NodeBox7
|
||||
{-0.281, -0.5, 0, -0.219, 0.5, 0.0625}, -- NodeBox8
|
||||
{0.219, -0.5, 0, 0.281, 0.5, 0.0625}, -- NodeBox9
|
||||
{-0.5, -0.281, 0, 0.5, -0.21875, 0.0625}, -- NodeBox10
|
||||
{-0.5, 0.219, 0, 0.5, 0.28125, 0.0625}, -- NodeBox11
|
||||
}
|
||||
drawtype = "mesh",
|
||||
mesh = "homedecor_wall_japanese_middle.obj",
|
||||
tiles = {
|
||||
"homedecor_japanese_wood.png",
|
||||
"homedecor_japanese_paper.png"
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, 0, 0.5, 0.5, 0.0625},
|
||||
}
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy=3},
|
||||
selection_box = jp_cbox,
|
||||
collision_box = jp_cbox,
|
||||
})
|
||||
|
||||
minetest.register_node("homedecor:japanese_wall_bottom", {
|
||||
tiles = {
|
||||
"homedecor_japanese_wall_edges.png",
|
||||
"homedecor_japanese_wall_edges.png",
|
||||
"homedecor_japanese_wall_edges.png",
|
||||
"homedecor_japanese_wall_edges.png",
|
||||
"homedecor_japanese_wall_bottom.png",
|
||||
"homedecor_japanese_wall_bottom.png"
|
||||
},
|
||||
description = "Japanese wall (bottom)",
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy=3},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, 0.03125, 0.5, 0.5, 0.03125}, -- NodeBox1
|
||||
{-0.5, -0.5, 0, -0.469, 0.5, 0.0625}, -- NodeBox2
|
||||
{0.469, -0.5, 0, 0.5, 0.5, 0.0625}, -- NodeBox3
|
||||
{-0.5, -0.5, 0, 0.5, -0.21875, 0.0625}, -- NodeBox4
|
||||
{-0.5, 0.469, 0, 0.5, 0.5, 0.0625}, -- NodeBox5
|
||||
{-0.031, -0.5, 0, 0.031, 0.5, 0.0625}, -- NodeBox6
|
||||
{-0.5, -0.031, 0, 0.5, 0.03125, 0.0625}, -- NodeBox7
|
||||
{-0.281, -0.5, 0, -0.219, 0.5, 0.0625}, -- NodeBox8
|
||||
{0.219, -0.5, 0, 0.281, 0.5, 0.0625}, -- NodeBox9
|
||||
{-0.5, 0.219, 0, 0.5, 0.28125, 0.0625}, -- NodeBox11
|
||||
}
|
||||
drawtype = "mesh",
|
||||
mesh = "homedecor_wall_japanese_bottom.obj",
|
||||
tiles = {
|
||||
"homedecor_japanese_wood.png",
|
||||
"homedecor_japanese_paper.png"
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, 0, 0.5, 0.5, 0.0625},
|
||||
}
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy=3},
|
||||
selection_box = jp_cbox,
|
||||
collision_box = jp_cbox,
|
||||
})
|
||||
|
||||
minetest.register_node("homedecor:tatami_mat", {
|
||||
@ -592,143 +558,56 @@ minetest.register_node("homedecor:tatami_mat", {
|
||||
}
|
||||
})
|
||||
|
||||
homedecor.register("jpn_door_bottom", {
|
||||
homedecor.register("door_japanese_closed", {
|
||||
description = "Japanese-style door",
|
||||
inventory_image = "homedecor_jpn_door_inv.png",
|
||||
inventory_image = "homedecor_door_japanese_inv.png",
|
||||
tiles = {
|
||||
"homedecor_japanese_wall_edges.png",
|
||||
"homedecor_japanese_wall_edges.png",
|
||||
"homedecor_japanese_wall_edges.png",
|
||||
"homedecor_japanese_wall_edges.png",
|
||||
"homedecor_japanese_door_bottom.png"
|
||||
"homedecor_japanese_wood.png",
|
||||
"homedecor_japanese_paper.png"
|
||||
},
|
||||
mesh = "homedecor_door_japanese_closed.obj",
|
||||
groups = { snappy = 3 },
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, 0.03125, 0.5, 0.5, 0.03125}, -- NodeBox1
|
||||
{-0.5, -0.5, 0, -0.44, 0.5, 0.0625}, -- NodeBox2
|
||||
{0.44, -0.5, 0, 0.5, 0.5, 0.0625}, -- NodeBox3
|
||||
{-0.5, -0.5, 0, 0.5, -0.4065, 0.0625}, -- NodeBox4
|
||||
{-0.5, 0.469, 0, 0.5, 0.5, 0.0625}, -- NodeBox5
|
||||
{-0.5, 0.1565, 0, 0.5, 0.21875, 0.0625}, -- NodeBox6
|
||||
{-0.5, -0.185, 0, 0.5, -0.125, 0.0625}, -- NodeBox7
|
||||
{-0.2185, -0.5, 0, -0.1565, 0.5, 0.0625}, -- NodeBox8
|
||||
{0.1565, -0.5, 0, 0.2185, 0.5, 0.0625}, -- NodeBox9
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, 0, 0.5, 1.5, 0.0625},
|
||||
},
|
||||
expand = { top = "homedecor:jpn_door_top" },
|
||||
collision_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, -0.0625, 0.5, 1.5, 0},
|
||||
},
|
||||
expand = { top = "air" },
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
local fdir = minetest.get_node(pos).param2
|
||||
minetest.set_node(pos, {name = "homedecor:jpn_door_bottom_open", param2 = fdir})
|
||||
minetest.set_node({x = pos.x, y=pos.y + 1, z = pos.z}, {name = "homedecor:jpn_door_top_open", param2 = fdir})
|
||||
minetest.set_node(pos, {name = "homedecor:door_japanese_open", param2 = node.param2})
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("homedecor:jpn_door_top", {
|
||||
minetest.register_node("homedecor:door_japanese_open", {
|
||||
tiles = {
|
||||
"homedecor_japanese_wall_edges.png",
|
||||
"homedecor_japanese_wall_edges.png",
|
||||
"homedecor_japanese_wall_edges.png",
|
||||
"homedecor_japanese_wall_edges.png",
|
||||
"homedecor_japanese_door_top.png"
|
||||
"homedecor_japanese_wood.png",
|
||||
"homedecor_japanese_paper.png"
|
||||
},
|
||||
drawtype = "nodebox",
|
||||
drawtype = "mesh",
|
||||
mesh = "homedecor_door_japanese_open.obj",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = { snappy = 3, not_in_creative_inventory = 1 },
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, 0.03125, 0.5, 0.5, 0.03125}, -- NodeBox1
|
||||
{-0.5, -0.5, 0, -0.44, 0.5, 0.0625}, -- NodeBox2
|
||||
{0.44, -0.5, 0, 0.5, 0.5, 0.0625}, -- NodeBox3
|
||||
{-0.5, -0.5, 0, 0.5, -0.469, 0.0625}, -- NodeBox4
|
||||
{-0.5, 0.4065, 0, 0.5, 0.5, 0.0625}, -- NodeBox5
|
||||
{-0.5, 0.1255, 0, 0.5, 0.1875, 0.0625}, -- NodeBox6
|
||||
{-0.5, -0.2185, 0, 0.5, -0.1565, 0.0625}, -- NodeBox7
|
||||
{-0.2185, -0.5, 0, -0.1565, 0.5, 0.0625}, -- NodeBox8
|
||||
{0.1565, -0.5, 0, 0.2185, 0.5, 0.0625}, -- NodeBox9
|
||||
}
|
||||
},
|
||||
selection_box = homedecor.nodebox.null,
|
||||
})
|
||||
|
||||
minetest.register_node("homedecor:jpn_door_bottom_open", {
|
||||
tiles = {
|
||||
"homedecor_japanese_wall_edges.png",
|
||||
"homedecor_japanese_wall_edges.png",
|
||||
"homedecor_japanese_wall_edges.png",
|
||||
"homedecor_japanese_wall_edges.png",
|
||||
"homedecor_japanese_door_bottom.png"
|
||||
},
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = { snappy = 3, not_in_creative_inventory = 1 },
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-1.5, -0.5, -0.03125, -0.5, 0.5, -0.03125}, -- NodeBox1
|
||||
{-1.5, -0.5, -0.0625, -1.44, 0.5, 0}, -- NodeBox2
|
||||
{-0.5625, -0.5, -0.0625, -0.5, 0.5, 0}, -- NodeBox3
|
||||
{-1.5, -0.5, -0.0625, -0.5, -0.40625, 0}, -- NodeBox4
|
||||
{-1.5, 0.469, -0.0625, -0.5, 0.5, 0}, -- NodeBox5
|
||||
{-1.5, 0.1565, -0.0625, -0.5, 0.21875, 0}, -- NodeBox6
|
||||
{-1.5, -0.1865, -0.0625, -0.5, -0.125, 0}, -- NodeBox7
|
||||
{-1.21875, -0.5, -0.0625, -1.1565, 0.5, 0}, -- NodeBox8
|
||||
{-0.84375, -0.5, -0.0625, -0.7815, 0.5, 0}, -- NodeBox9
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-1.5, -0.5, -0.0625, 0.5, 1.5, 0},
|
||||
},
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
local fdir = minetest.get_node(pos).param2
|
||||
minetest.set_node(pos, {name = "homedecor:jpn_door_bottom", param2 = fdir})
|
||||
minetest.set_node({x = pos.x, y=pos.y + 1, z = pos.z}, {name = "homedecor:jpn_door_top", param2 = fdir})
|
||||
end,
|
||||
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||
local pos2 = { x = pos.x, y=pos.y + 1, z = pos.z }
|
||||
if minetest.get_node(pos2).name == "homedecor:jpn_door_top_open" then
|
||||
minetest.remove_node(pos2)
|
||||
end
|
||||
end,
|
||||
drop = "homedecor:jpn_door_bottom",
|
||||
})
|
||||
|
||||
minetest.register_node("homedecor:jpn_door_top_open", {
|
||||
tiles = {
|
||||
"homedecor_japanese_wall_edges.png",
|
||||
"homedecor_japanese_wall_edges.png",
|
||||
"homedecor_japanese_wall_edges.png",
|
||||
"homedecor_japanese_wall_edges.png",
|
||||
"homedecor_japanese_door_top.png"
|
||||
},
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = { snappy = 3, not_in_creative_inventory = 1 },
|
||||
node_box = {
|
||||
collision_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-1.5, -0.5, -0.03125, -0.5, 0.5, -0.03125}, -- NodeBox1
|
||||
{-1.5, -0.5, -0.0625, -1.44, 0.5, 0}, -- NodeBox2
|
||||
{-0.5625, -0.5, -0.0625, -0.5, 0.5, 0}, -- NodeBox3
|
||||
{-1.5, -0.5, -0.0625, -0.5, -0.469, 0}, -- NodeBox4
|
||||
{-1.5, 0.4065, -0.0625, -0.5, 0.5, 0}, -- NodeBox5
|
||||
{-1.5, 0.1253, -0.0625, -0.5, 0.1875, 0}, -- NodeBox6
|
||||
{-1.5, -0.2185, -0.0625, -0.5, -0.15625, 0}, -- NodeBox7
|
||||
{-1.21875, -0.5, -0.0625, -1.1565, 0.5, 0}, -- NodeBox8
|
||||
{-0.84375, -0.5, -0.0625, -0.7815, 0.5, 0}, -- NodeBox9
|
||||
}
|
||||
fixed = {-1.5, -0.5, -0.0625, -0.5, 1.5, 0},
|
||||
},
|
||||
selection_box = homedecor.nodebox.null,
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
minetest.set_node(pos, {name = "homedecor:door_japanese_closed", param2 = node.param2})
|
||||
end,
|
||||
drop = "homedecor:door_japanese_closed",
|
||||
})
|
||||
|
||||
minetest.register_alias("homedecor:jpn_door_top", "air")
|
||||
minetest.register_alias("homedecor:jpn_door_bottom", "homedecor:door_japanese_closed")
|
||||
|
||||
minetest.register_alias("homedecor:jpn_door_top_open", "air")
|
||||
minetest.register_alias("homedecor:jpn_door_bottom_open", "homedecor:door_japanese_open")
|
||||
|
||||
|
@ -189,43 +189,16 @@ local bedcolors = {
|
||||
"pink",
|
||||
}
|
||||
|
||||
local function bed_extension(pos, color)
|
||||
|
||||
local topnode = minetest.get_node({x=pos.x, y=pos.y+1.0, z=pos.z})
|
||||
local thisnode = minetest.get_node(pos)
|
||||
local bottomnode = minetest.get_node({x=pos.x, y=pos.y-1.0, z=pos.z})
|
||||
|
||||
local fdir = thisnode.param2
|
||||
|
||||
if string.find(topnode.name, "homedecor:bed_.*_regular$") then
|
||||
if fdir == topnode.param2 then
|
||||
local newnode = string.gsub(thisnode.name, "_regular", "_extended")
|
||||
minetest.set_node(pos, { name = newnode, param2 = fdir})
|
||||
end
|
||||
end
|
||||
|
||||
if string.find(bottomnode.name, "homedecor:bed_.*_regular$") then
|
||||
if fdir == bottomnode.param2 then
|
||||
local newnode = string.gsub(bottomnode.name, "_regular", "_extended")
|
||||
minetest.set_node({x=pos.x, y=pos.y-1.0, z=pos.z}, { name = newnode, param2 = fdir})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function unextend_bed(pos, color)
|
||||
local bottomnode = minetest.get_node({x=pos.x, y=pos.y-1.0, z=pos.z})
|
||||
local fdir = bottomnode.param2
|
||||
if string.find(bottomnode.name, "homedecor:bed_.*_extended$") then
|
||||
local newnode = string.gsub(bottomnode.name, "_extended", "_regular")
|
||||
minetest.set_node({x=pos.x, y=pos.y-1.0, z=pos.z}, { name = newnode, param2 = fdir})
|
||||
end
|
||||
end
|
||||
|
||||
local bed_cbox = {
|
||||
type = "fixed",
|
||||
fixed = { -0.5, -0.5, -0.5, 0.5, 0.5, 1.5 }
|
||||
}
|
||||
|
||||
local kbed_cbox = {
|
||||
type = "fixed",
|
||||
fixed = { -0.5, -0.5, -0.5, 1.5, 0.5, 1.5 }
|
||||
}
|
||||
|
||||
for _, color in ipairs(bedcolors) do
|
||||
local color2=color
|
||||
if color == "darkgrey" then
|
||||
@ -246,12 +219,13 @@ for _, color in ipairs(bedcolors) do
|
||||
groups = {snappy=3},
|
||||
selection_box = bed_cbox,
|
||||
collision_box = bed_cbox,
|
||||
on_construct = function(pos)
|
||||
bed_extension(pos, color)
|
||||
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
||||
if not placer:get_player_control().sneak then
|
||||
return homedecor.bed_expansion(pos, placer, itemstack, pointed_thing, color)
|
||||
end
|
||||
end,
|
||||
expand = { forward = "air" },
|
||||
after_unexpand = function(pos)
|
||||
unextend_bed(pos, color)
|
||||
after_dig_node = function(pos)
|
||||
homedecor.unextend_bed(pos, color)
|
||||
end,
|
||||
})
|
||||
|
||||
@ -269,12 +243,36 @@ for _, color in ipairs(bedcolors) do
|
||||
selection_box = bed_cbox,
|
||||
collision_box = bed_cbox,
|
||||
expand = { forward = "air" },
|
||||
after_unexpand = function(pos)
|
||||
unextend_bed(pos, color)
|
||||
after_dig_node = function(pos)
|
||||
homedecor.unextend_bed(pos, color)
|
||||
end,
|
||||
drop = "homedecor:bed_"..color.."_regular"
|
||||
})
|
||||
|
||||
homedecor.register("bed_"..color.."_kingsize", {
|
||||
mesh = "homedecor_bed_kingsize.obj",
|
||||
tiles = {
|
||||
"homedecor_bed_frame.png",
|
||||
"default_wood.png",
|
||||
"wool_white.png",
|
||||
"wool_"..color2..".png",
|
||||
"homedecor_bed_bottom.png",
|
||||
"wool_"..color2..".png^[brighten",
|
||||
},
|
||||
inventory_image = "homedecor_bed_kingsize_"..color.."_inv.png",
|
||||
description = S("Bed (%s, king sized)"):format(color),
|
||||
groups = {snappy=3, not_in_creative_inventory=1},
|
||||
selection_box = kbed_cbox,
|
||||
collision_box = kbed_cbox,
|
||||
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||
local inv = digger:get_inventory()
|
||||
if digger:get_player_control().sneak and inv:room_for_item("main", "bed_"..color.."_regular 1") then
|
||||
inv:remove_item("main", "homedecor:bed_"..color.."_kingsize 1")
|
||||
inv:add_item("main", "homedecor:bed_"..color.."_regular 2")
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_alias("homedecor:bed_"..color.."_foot", "homedecor:bed_"..color.."_regular")
|
||||
minetest.register_alias("homedecor:bed_"..color.."_footext", "homedecor:bed_"..color.."_extended")
|
||||
minetest.register_alias("homedecor:bed_"..color.."_head", "air")
|
||||
|
@ -197,7 +197,7 @@ minetest.register_craft({
|
||||
output = "homedecor:toilet",
|
||||
recipe = {
|
||||
{"","","bucket:bucket_water"},
|
||||
{ "building_blocks:Marble","building_blocks:Marble", "building_blocks:Marble" },
|
||||
{ "group:marble","group:marble", "group:marble" },
|
||||
{ "", "bucket:bucket_empty", "" },
|
||||
},
|
||||
})
|
||||
@ -205,7 +205,7 @@ minetest.register_craft({
|
||||
minetest.register_craft({
|
||||
output = "homedecor:sink",
|
||||
recipe = {
|
||||
{ "building_blocks:Marble","bucket:bucket_empty", "building_blocks:Marble" },
|
||||
{ "group:marble","bucket:bucket_empty", "group:marble" },
|
||||
},
|
||||
})
|
||||
|
||||
@ -219,7 +219,7 @@ minetest.register_craft({
|
||||
minetest.register_craft({
|
||||
output = "homedecor:shower_tray",
|
||||
recipe = {
|
||||
{ "building_blocks:Marble","bucket:bucket_water", "building_blocks:Marble" },
|
||||
{ "group:marble","bucket:bucket_water", "group:marble" },
|
||||
},
|
||||
})
|
||||
|
||||
|
@ -1,5 +1,28 @@
|
||||
local S = homedecor.gettext
|
||||
|
||||
-- vectors to place one node next to or behind another
|
||||
|
||||
homedecor.fdir_to_right = {
|
||||
{ 1, 0 },
|
||||
{ 0, -1 },
|
||||
{ -1, 0 },
|
||||
{ 0, 1 },
|
||||
}
|
||||
|
||||
homedecor.fdir_to_left = {
|
||||
{ -1, 0 },
|
||||
{ 0, 1 },
|
||||
{ 1, 0 },
|
||||
{ 0, -1 },
|
||||
}
|
||||
|
||||
homedecor.fdir_to_fwd = {
|
||||
{ 0, 1 },
|
||||
{ 1, 0 },
|
||||
{ 0, -1 },
|
||||
{ -1, 0 },
|
||||
}
|
||||
|
||||
-- selects which node was pointed at based on it being known, and either clickable or buildable_to
|
||||
local function select_node(pointed_thing)
|
||||
local pos = pointed_thing.under
|
||||
@ -63,12 +86,7 @@ end
|
||||
|
||||
-- Stack one door node above another
|
||||
-- like homedecor.stack_vertically but tests first if it was placed as a right wing, then uses node1_right and node2_right instead
|
||||
local fdir_to_left = {
|
||||
{ -1, 0 },
|
||||
{ 0, 1 },
|
||||
{ 1, 0 },
|
||||
{ 0, -1 },
|
||||
}
|
||||
|
||||
function homedecor.stack_wing(itemstack, placer, pointed_thing, node1, node2, node1_right, node2_right)
|
||||
local pos, def = select_node(pointed_thing)
|
||||
if not def then return end -- rare corner case, but happened in #205
|
||||
@ -80,7 +98,7 @@ function homedecor.stack_wing(itemstack, placer, pointed_thing, node1, node2, no
|
||||
local forceright = placer:get_player_control()["sneak"]
|
||||
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
|
||||
|
||||
local is_right_wing = node1 == minetest.get_node({ x = pos.x + fdir_to_left[fdir+1][1], y=pos.y, z = pos.z + fdir_to_left[fdir+1][2] }).name
|
||||
local is_right_wing = node1 == minetest.get_node({ x = pos.x + homedecor.fdir_to_left[fdir+1][1], y=pos.y, z = pos.z + homedecor.fdir_to_left[fdir+1][2] }).name
|
||||
if forceright or is_right_wing then
|
||||
node1, node2 = node1_right, node2_right
|
||||
end
|
||||
@ -89,21 +107,6 @@ function homedecor.stack_wing(itemstack, placer, pointed_thing, node1, node2, no
|
||||
return stack(itemstack, placer, fdir, pos, def, top_pos, node1, node2)
|
||||
end
|
||||
|
||||
-- Place one node right of or behind another
|
||||
homedecor.fdir_to_right = {
|
||||
{ 1, 0 },
|
||||
{ 0, -1 },
|
||||
{ -1, 0 },
|
||||
{ 0, 1 },
|
||||
}
|
||||
|
||||
homedecor.fdir_to_fwd = {
|
||||
{ 0, 1 },
|
||||
{ 1, 0 },
|
||||
{ 0, -1 },
|
||||
{ -1, 0 },
|
||||
}
|
||||
|
||||
function homedecor.stack_sideways(itemstack, placer, pointed_thing, node1, node2, dir)
|
||||
local pos, def = select_node(pointed_thing)
|
||||
if not def then return end -- rare corner case, but happened in #205
|
||||
@ -119,3 +122,78 @@ function homedecor.stack_sideways(itemstack, placer, pointed_thing, node1, node2
|
||||
|
||||
return stack(itemstack, placer, fdir, pos, def, pos2, node1, node2)
|
||||
end
|
||||
|
||||
function homedecor.bed_expansion(pos, placer, itemstack, pointed_thing, color)
|
||||
|
||||
local thisnode = minetest.get_node(pos)
|
||||
local fdir = thisnode.param2
|
||||
|
||||
local fxd = homedecor.fdir_to_fwd[fdir+1][1]
|
||||
local fzd = homedecor.fdir_to_fwd[fdir+1][2]
|
||||
|
||||
local forwardpos = {x=pos.x+fxd, y=pos.y, z=pos.z+fzd}
|
||||
local forwardnode = minetest.get_node(forwardpos)
|
||||
|
||||
local def = minetest.registered_nodes[forwardnode.name]
|
||||
local placer_name = placer:get_player_name()
|
||||
|
||||
if not (def and def.buildable_to) then
|
||||
minetest.chat_send_player( placer:get_player_name(), "Not enough room - the space for the headboard is occupied!" )
|
||||
minetest.set_node(pos, {name = "air"})
|
||||
return true
|
||||
end
|
||||
|
||||
if minetest.is_protected(forwardpos, placer_name) then
|
||||
minetest.chat_send_player( placer:get_player_name(), "Someone already owns the spot where the headboard goes." )
|
||||
return true
|
||||
end
|
||||
|
||||
minetest.set_node(forwardpos, {name = "air"})
|
||||
|
||||
local lxd = homedecor.fdir_to_left[fdir+1][1]
|
||||
local lzd = homedecor.fdir_to_left[fdir+1][2]
|
||||
local leftpos = {x=pos.x+lxd, y=pos.y, z=pos.z+lzd}
|
||||
local leftnode = minetest.get_node(leftpos)
|
||||
|
||||
local rxd = homedecor.fdir_to_right[fdir+1][1]
|
||||
local rzd = homedecor.fdir_to_right[fdir+1][2]
|
||||
local rightpos = {x=pos.x+rxd, y=pos.y, z=pos.z+rzd}
|
||||
local rightnode = minetest.get_node(rightpos)
|
||||
|
||||
if leftnode.name == "homedecor:bed_"..color.."_regular" then
|
||||
local newname = string.gsub(thisnode.name, "_regular", "_kingsize")
|
||||
minetest.set_node(pos, {name = "air"})
|
||||
minetest.set_node(leftpos, { name = newname, param2 = fdir})
|
||||
elseif rightnode.name == "homedecor:bed_"..color.."_regular" then
|
||||
local newname = string.gsub(thisnode.name, "_regular", "_kingsize")
|
||||
minetest.set_node(rightpos, {name = "air"})
|
||||
minetest.set_node(pos, { name = newname, param2 = fdir})
|
||||
end
|
||||
|
||||
local topnode = minetest.get_node({x=pos.x, y=pos.y+1.0, z=pos.z})
|
||||
local bottomnode = minetest.get_node({x=pos.x, y=pos.y-1.0, z=pos.z})
|
||||
|
||||
if string.find(topnode.name, "homedecor:bed_.*_regular$") then
|
||||
if fdir == topnode.param2 then
|
||||
local newname = string.gsub(thisnode.name, "_regular", "_extended")
|
||||
minetest.set_node(pos, { name = newname, param2 = fdir})
|
||||
end
|
||||
end
|
||||
|
||||
if string.find(bottomnode.name, "homedecor:bed_.*_regular$") then
|
||||
if fdir == bottomnode.param2 then
|
||||
local newname = string.gsub(bottomnode.name, "_regular", "_extended")
|
||||
minetest.set_node({x=pos.x, y=pos.y-1.0, z=pos.z}, { name = newname, param2 = fdir})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function homedecor.unextend_bed(pos, color)
|
||||
local bottomnode = minetest.get_node({x=pos.x, y=pos.y-1.0, z=pos.z})
|
||||
local fdir = bottomnode.param2
|
||||
if string.find(bottomnode.name, "homedecor:bed_.*_extended$") then
|
||||
local newname = string.gsub(bottomnode.name, "_extended", "_regular")
|
||||
minetest.set_node({x=pos.x, y=pos.y-1.0, z=pos.z}, { name = newname, param2 = fdir})
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -117,7 +117,6 @@ dofile(homedecor.modpath.."/shutters.lua")
|
||||
dofile(homedecor.modpath.."/shingles.lua")
|
||||
dofile(homedecor.modpath.."/slopes.lua")
|
||||
|
||||
dofile(homedecor.modpath.."/door_models.lua")
|
||||
dofile(homedecor.modpath.."/doors_and_gates.lua")
|
||||
|
||||
dofile(homedecor.modpath.."/fences.lua")
|
||||
|
@ -172,12 +172,12 @@ homedecor.register("candle", {
|
||||
local c_cbox = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{ -0.1, -0.5, -0.1, 0.125, 0.05, 0.125 },
|
||||
{ -0.125, -0.5, -0.125, 0.125, 0.05, 0.125 },
|
||||
}
|
||||
}
|
||||
|
||||
homedecor.register("candle_thin", {
|
||||
description = S("Little Candle"),
|
||||
description = S("Thin Candle"),
|
||||
mesh = "homedecor_candle_thin.obj",
|
||||
tiles = {
|
||||
'homedecor_candle_sides.png',
|
||||
@ -192,6 +192,47 @@ homedecor.register("candle_thin", {
|
||||
light_source = LIGHT_MAX-4,
|
||||
})
|
||||
|
||||
local cs_cbox = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{ -0.15625, -0.5, -0.15625, 0.15625, 0.3125, 0.15625 },
|
||||
}
|
||||
}
|
||||
|
||||
homedecor.register("candlestick_wrought_iron", {
|
||||
description = S("Candlestick (wrought iron)"),
|
||||
mesh = "homedecor_candlestick.obj",
|
||||
tiles = {
|
||||
"homedecor_candle_sides.png",
|
||||
{name="homedecor_candle_flame.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}},
|
||||
"homedecor_tile_wrought_iron2.png",
|
||||
},
|
||||
inventory_image = "homedecor_candlestick_wrought_iron_inv.png",
|
||||
selection_box = cs_cbox,
|
||||
collision_box = cs_cbox,
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
groups = { snappy = 3 },
|
||||
light_source = LIGHT_MAX-4,
|
||||
})
|
||||
|
||||
homedecor.register("candlestick_brass", {
|
||||
description = S("Candlestick (brass)"),
|
||||
mesh = "homedecor_candlestick.obj",
|
||||
tiles = {
|
||||
"homedecor_candle_sides.png",
|
||||
{name="homedecor_candle_flame.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}},
|
||||
"homedecor_tile_brass2.png",
|
||||
},
|
||||
inventory_image = "homedecor_candlestick_brass_inv.png",
|
||||
selection_box = cs_cbox,
|
||||
collision_box = cs_cbox,
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
groups = { snappy = 3 },
|
||||
light_source = LIGHT_MAX-4,
|
||||
})
|
||||
|
||||
homedecor.register("wall_sconce", {
|
||||
description = S("Wall sconce"),
|
||||
mesh = "homedecor_wall_sconce.obj",
|
||||
@ -442,3 +483,37 @@ for _, color in ipairs(dlamp_colors) do
|
||||
groups = {snappy=3},
|
||||
})
|
||||
end
|
||||
|
||||
homedecor.register("ceiling_lamp", {
|
||||
description = S("Ceiling Lamp"),
|
||||
mesh = "homedecor_ceiling_lamp.obj",
|
||||
tiles = {
|
||||
"homedecor_tile_brass2.png",
|
||||
"homedecor_ceiling_lamp_glass.png",
|
||||
"homedecor_table_standing_lamp_lightbulb.png^[colorize:#ffffff:200",
|
||||
"homedecor_generic_brown_plastic.png",
|
||||
},
|
||||
inventory_image = "homedecor_ceiling_lamp_inv.png",
|
||||
light_source = LIGHT_MAX,
|
||||
groups = {snappy=3},
|
||||
on_punch = function(pos, node, puncher)
|
||||
minetest.set_node(pos, {name = "homedecor:ceiling_lamp_off"})
|
||||
end,
|
||||
})
|
||||
|
||||
homedecor.register("ceiling_lamp_off", {
|
||||
description = S("Ceiling Lamp (off)"),
|
||||
mesh = "homedecor_ceiling_lamp.obj",
|
||||
tiles = {
|
||||
"homedecor_tile_brass2.png",
|
||||
"homedecor_ceiling_lamp_glass.png",
|
||||
"homedecor_table_standing_lamp_lightbulb.png",
|
||||
"homedecor_generic_brown_plastic.png",
|
||||
},
|
||||
groups = {snappy=3, not_in_creative_inventory=1},
|
||||
on_punch = function(pos, node, puncher)
|
||||
minetest.set_node(pos, {name = "homedecor:ceiling_lamp"})
|
||||
end,
|
||||
drop = "homedecor:ceiling_lamp"
|
||||
})
|
||||
|
||||
|
@ -687,7 +687,11 @@ for _, i in ipairs(n) do
|
||||
homedecor.register("picture_frame"..i, {
|
||||
description = S("Picture Frame"),
|
||||
mesh = "homedecor_picture_frame.obj",
|
||||
tiles = { "homedecor_picture_frame"..i..".png" },
|
||||
tiles = {
|
||||
"homedecor_picture_frame_image"..i..".png",
|
||||
"homedecor_picture_frame_edges.png",
|
||||
"homedecor_picture_frame_back.png",
|
||||
},
|
||||
inventory_image = "homedecor_picture_frame"..i.."_inv.png",
|
||||
wield_image = "homedecor_picture_frame"..i.."_inv.png",
|
||||
groups = {snappy = 3},
|
||||
@ -695,3 +699,4 @@ for _, i in ipairs(n) do
|
||||
collision_box = pframe_cbox,
|
||||
})
|
||||
end
|
||||
|
||||
|
After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 6.0 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 6.0 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 6.2 KiB |
After Width: | Height: | Size: 6.1 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 592 B |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 682 B |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 681 B |
Before Width: | Height: | Size: 236 B |
Before Width: | Height: | Size: 233 B |
Before Width: | Height: | Size: 683 B |
Before Width: | Height: | Size: 681 B |
Before Width: | Height: | Size: 170 B |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 547 B |
Before Width: | Height: | Size: 547 B |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 586 B |
After Width: | Height: | Size: 3.9 KiB |
After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 547 B |
Before Width: | Height: | Size: 547 B |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 584 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 641 B |
After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 370 B |
Before Width: | Height: | Size: 370 B |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 393 B |
After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 173 B |
Before Width: | Height: | Size: 175 B |
After Width: | Height: | Size: 413 B |
Before Width: | Height: | Size: 168 B |
Before Width: | Height: | Size: 303 B |
Before Width: | Height: | Size: 241 B |
Before Width: | Height: | Size: 181 B |
Before Width: | Height: | Size: 181 B |
Before Width: | Height: | Size: 168 B |
Before Width: | Height: | Size: 243 B |
Before Width: | Height: | Size: 159 B |
Before Width: | Height: | Size: 170 B |
Before Width: | Height: | Size: 173 B |
After Width: | Height: | Size: 3.9 KiB |
After Width: | Height: | Size: 324 B |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 957 B |
Before Width: | Height: | Size: 957 B |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 982 B |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.8 KiB |