2013-05-07 07:49:22 +02:00
|
|
|
-- Various kinds of shingles
|
|
|
|
|
2013-10-22 02:31:54 +02:00
|
|
|
local S = homedecor.gettext
|
2013-05-07 07:49:22 +02:00
|
|
|
|
|
|
|
-- Corner shingle nodes, courtesy Bas080
|
|
|
|
|
2013-10-09 18:47:22 +02:00
|
|
|
homedecor.register_outer_corner = function(modname, subname, groups, images, description)
|
2013-05-07 07:49:22 +02:00
|
|
|
local slopeboxedge = {}
|
2013-10-09 18:47:22 +02:00
|
|
|
local detail = homedecor.detail_level
|
2013-05-07 07:49:22 +02:00
|
|
|
for i = 0, detail-1 do
|
2013-06-02 18:42:51 +02:00
|
|
|
slopeboxedge[i+1]={-0.5, -0.5, (i/detail)-0.5, 0.5-(i/detail), (i/detail)-0.5+(1.25/detail), 0.5}
|
2013-05-07 07:49:22 +02:00
|
|
|
end
|
|
|
|
minetest.register_node(modname..":shingle_outer_corner_" .. subname, {
|
|
|
|
description = S(description.. " (outer corner)"),
|
|
|
|
drawtype = "nodebox",
|
|
|
|
tiles = images,
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
walkable = true,
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
|
|
|
|
{-0.5, -0.25, -0.25, 0.25, 0, 0.5},
|
|
|
|
{-0.5, 0, 0, 0, 0.25, 0.5},
|
|
|
|
{-0.5, 0.25, 0.25, -0.25, 0.5, 0.5}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = slopeboxedge
|
|
|
|
},
|
|
|
|
groups = groups,
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2013-10-09 18:47:22 +02:00
|
|
|
homedecor.register_inner_corner = function(modname, subname, groups, images, description)
|
2013-05-07 07:49:22 +02:00
|
|
|
local slopeboxedge = {}
|
2013-10-09 18:47:22 +02:00
|
|
|
local detail = homedecor.detail_level
|
2013-05-07 07:49:22 +02:00
|
|
|
for i = 0, detail-1 do
|
2013-06-02 18:42:51 +02:00
|
|
|
slopeboxedge[i+1]={-0.5, -0.5, -0.5, 0.5-(i/detail), (i/detail)-0.5+(1.25/detail), 0.5}
|
|
|
|
slopeboxedge[i+detail+1]={-0.5, -0.5, (i/detail)-0.5, 0.5, (i/detail)-0.5+(1.25/detail), 0.5}
|
2013-05-07 07:49:22 +02:00
|
|
|
end
|
|
|
|
minetest.register_node(modname..":shingle_inner_corner_" .. subname, {
|
|
|
|
description = S(description.. " (inner corner)"),
|
|
|
|
drawtype = "nodebox",
|
|
|
|
tiles = images,
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
walkable = true,
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}
|
|
|
|
},
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = slopeboxedge
|
|
|
|
},
|
|
|
|
groups = groups,
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2013-10-09 18:47:22 +02:00
|
|
|
homedecor.register_slope = function(modname, subname, recipeitem, groups, images, description)
|
2013-05-07 07:49:22 +02:00
|
|
|
local slopeboxedge = {}
|
2013-10-09 18:47:22 +02:00
|
|
|
local detail = homedecor.detail_level
|
2013-05-07 07:49:22 +02:00
|
|
|
for i = 0, detail-1 do
|
2013-06-02 18:42:51 +02:00
|
|
|
slopeboxedge[i+1]={-0.5, -0.5, (i/detail)-0.5, 0.5, (i/detail)-0.5+(1.25/detail), 0.5}
|
2013-05-07 07:49:22 +02:00
|
|
|
end
|
|
|
|
minetest.register_node(modname..":shingle_side_" .. subname, {
|
|
|
|
description = S(description),
|
|
|
|
drawtype = "nodebox",
|
|
|
|
tiles = images,
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
walkable = true,
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
|
|
|
|
{-0.5, -0.25, -0.25, 0.5, 0, 0.5},
|
|
|
|
{-0.5, 0, 0, 0.5, 0.25, 0.5},
|
|
|
|
{-0.5, 0.25, 0.25, 0.5, 0.5, 0.5}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = slopeboxedge,
|
|
|
|
},
|
|
|
|
groups = groups,
|
|
|
|
})
|
|
|
|
|
|
|
|
-- convert between flat shingles and slopes
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = modname..":shingle_side_"..subname.." 3",
|
|
|
|
recipe = {
|
|
|
|
{recipeitem, recipeitem, recipeitem}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = recipeitem.." 3",
|
|
|
|
recipe = {
|
|
|
|
{modname..":shingle_side_"..subname, modname..":shingle_side_"..subname, modname..":shingle_side_"..subname},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
-- craft outer corners
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = modname..":shingle_outer_corner_"..subname.." 3",
|
|
|
|
recipe = {
|
|
|
|
{ "", recipeitem, "" },
|
|
|
|
{ recipeitem, "", recipeitem }
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = modname..":shingle_outer_corner_"..subname.." 3",
|
|
|
|
recipe = {
|
2013-10-03 13:51:30 +02:00
|
|
|
{ "", modname..":shingle_side_"..subname, "" },
|
|
|
|
{ modname..":shingle_side_"..subname, "", modname..":shingle_side_"..subname },
|
2013-05-07 07:49:22 +02:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
-- craft inner corners
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = modname..":shingle_inner_corner_"..subname.." 3",
|
|
|
|
recipe = {
|
|
|
|
{recipeitem, recipeitem},
|
|
|
|
{"", recipeitem}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = modname..":shingle_inner_corner_"..subname.." 3",
|
|
|
|
recipe = {
|
2013-10-03 13:51:30 +02:00
|
|
|
{modname..":shingle_side_"..subname, modname..":shingle_side_"..subname},
|
|
|
|
{"", modname..":shingle_side_"..subname}
|
2013-05-07 07:49:22 +02:00
|
|
|
}
|
|
|
|
})
|
|
|
|
-- convert between flat shingles and inner/outer corners
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
type = "shapeless",
|
2013-09-13 18:21:13 +02:00
|
|
|
output = recipeitem.." 1",
|
2013-05-07 07:49:22 +02:00
|
|
|
recipe = { modname..":shingle_outer_corner_"..subname }
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
type = "shapeless",
|
2013-09-13 18:21:13 +02:00
|
|
|
output = recipeitem.." 1",
|
2013-05-07 07:49:22 +02:00
|
|
|
recipe = { modname..":shingle_inner_corner_"..subname }
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
output = "homedecor:roof_tile_terracotta 8",
|
|
|
|
recipe = {
|
|
|
|
{ "homedecor:shingle_outer_corner_terracotta", "homedecor:shingle_outer_corner_terracotta" }
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
output = "homedecor:roof_tile_terracotta 8",
|
2013-09-13 18:21:13 +02:00
|
|
|
recipe = {
|
2013-05-07 07:49:22 +02:00
|
|
|
{ "homedecor:shingle_inner_corner_terracotta", "homedecor:shingle_inner_corner_terracotta" }
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
output = "homedecor:roof_tile_terracotta 8",
|
|
|
|
recipe = {
|
|
|
|
{ "homedecor:shingle_side_terracotta", "homedecor:shingle_side_terracotta" }
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
type = "fuel",
|
|
|
|
recipe = "homedecor:shingle_inner_corner_wood",
|
|
|
|
burntime = 30,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
type = "fuel",
|
|
|
|
recipe = "homedecor:shingle_outer_corner_wood",
|
|
|
|
burntime = 30,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
type = "fuel",
|
|
|
|
recipe = "homedecor:shingle_side_wood",
|
|
|
|
burntime = 30,
|
|
|
|
})
|
|
|
|
|
2013-10-09 18:47:22 +02:00
|
|
|
homedecor.register_roof = function(modname, subname, groups, images , description)
|
|
|
|
homedecor.register_outer_corner(modname, subname, groups, images, description)
|
|
|
|
homedecor.register_inner_corner(modname, subname, groups, images, description)
|
2013-05-07 07:49:22 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
-- corners
|
|
|
|
|
2013-10-09 18:47:22 +02:00
|
|
|
homedecor.register_roof("homedecor", "wood",
|
2013-09-13 18:21:13 +02:00
|
|
|
{ snappy = 3 },
|
2013-05-07 07:49:22 +02:00
|
|
|
{
|
|
|
|
"homedecor_shingles_wood_c_t.png",
|
|
|
|
"homedecor_shingles_wood_c_x.png",
|
|
|
|
"homedecor_shingles_wood_c_x.png",
|
|
|
|
"homedecor_shingles_wood_c_x.png",
|
|
|
|
"homedecor_shingles_wood_c_z.png",
|
|
|
|
"homedecor_shingles_wood_c_z.png",
|
2013-09-13 18:21:13 +02:00
|
|
|
},
|
2013-05-07 07:49:22 +02:00
|
|
|
"Wood Shingles"
|
|
|
|
)
|
|
|
|
|
2013-10-09 18:47:22 +02:00
|
|
|
homedecor.register_roof("homedecor", "asphalt",
|
2013-09-13 18:21:13 +02:00
|
|
|
{ snappy = 3 },
|
2013-05-07 07:49:22 +02:00
|
|
|
{
|
|
|
|
"homedecor_shingles_asphalt_c_t.png",
|
|
|
|
"homedecor_shingles_asphalt_c_x.png",
|
|
|
|
"homedecor_shingles_asphalt_c_x.png",
|
|
|
|
"homedecor_shingles_asphalt_c_x.png",
|
|
|
|
"homedecor_shingles_asphalt_c_z.png",
|
|
|
|
"homedecor_shingles_asphalt_c_z.png",
|
2013-09-13 18:21:13 +02:00
|
|
|
},
|
2013-05-07 07:49:22 +02:00
|
|
|
"Asphalt Shingles"
|
|
|
|
)
|
|
|
|
|
2013-10-09 18:47:22 +02:00
|
|
|
homedecor.register_roof("homedecor", "terracotta",
|
2013-09-13 18:21:13 +02:00
|
|
|
{ snappy = 3 },
|
2013-05-07 07:49:22 +02:00
|
|
|
{
|
|
|
|
"homedecor_shingles_terracotta_c_t.png",
|
|
|
|
"homedecor_shingles_terracotta_c_x.png",
|
|
|
|
"homedecor_shingles_terracotta_c_x.png",
|
|
|
|
"homedecor_shingles_terracotta_c_x.png",
|
|
|
|
"homedecor_shingles_terracotta_c_z.png",
|
|
|
|
"homedecor_shingles_terracotta_c_z.png",
|
|
|
|
},
|
|
|
|
"Terracotta Shingles"
|
|
|
|
)
|
|
|
|
|
|
|
|
-- register just the slopes
|
|
|
|
|
2013-10-09 18:47:22 +02:00
|
|
|
homedecor.register_slope("homedecor", "wood",
|
2013-09-13 18:21:13 +02:00
|
|
|
"homedecor:shingles_wood",
|
|
|
|
{ snappy = 3 },
|
2013-05-07 07:49:22 +02:00
|
|
|
{
|
|
|
|
"homedecor_shingles_wood_s_t.png",
|
|
|
|
"homedecor_shingles_wood_s_z.png",
|
|
|
|
"homedecor_shingles_wood_s_z.png",
|
|
|
|
"homedecor_shingles_wood_s_z.png",
|
|
|
|
"homedecor_shingles_wood_s_z.png",
|
|
|
|
"homedecor_shingles_wood_s_z.png",
|
2013-09-13 18:21:13 +02:00
|
|
|
},
|
2013-05-07 07:49:22 +02:00
|
|
|
"Wood Shingles"
|
|
|
|
)
|
|
|
|
|
2013-10-09 18:47:22 +02:00
|
|
|
homedecor.register_slope("homedecor", "asphalt",
|
2013-09-13 18:21:13 +02:00
|
|
|
"homedecor:shingles_asphalt",
|
|
|
|
{ snappy = 3 },
|
2013-05-07 07:49:22 +02:00
|
|
|
{
|
|
|
|
"homedecor_shingles_asphalt_s_t.png",
|
|
|
|
"homedecor_shingles_asphalt_s_z.png",
|
|
|
|
"homedecor_shingles_asphalt_s_z.png",
|
|
|
|
"homedecor_shingles_asphalt_s_z.png",
|
|
|
|
"homedecor_shingles_asphalt_s_z.png",
|
|
|
|
"homedecor_shingles_asphalt_s_z.png",
|
2013-09-13 18:21:13 +02:00
|
|
|
},
|
2013-05-07 07:49:22 +02:00
|
|
|
"Asphalt Shingles"
|
|
|
|
)
|
|
|
|
|
2013-10-09 18:47:22 +02:00
|
|
|
homedecor.register_slope("homedecor", "terracotta",
|
2013-09-13 18:21:13 +02:00
|
|
|
"homedecor:shingles_terracotta",
|
|
|
|
{ snappy = 3 },
|
2013-05-07 07:49:22 +02:00
|
|
|
{
|
|
|
|
"homedecor_shingles_terracotta_s_t.png",
|
|
|
|
"homedecor_shingles_terracotta_s_z.png",
|
|
|
|
"homedecor_shingles_terracotta_s_z.png",
|
|
|
|
"homedecor_shingles_terracotta_s_z.png",
|
|
|
|
"homedecor_shingles_terracotta_s_z.png",
|
|
|
|
"homedecor_shingles_terracotta_s_z.png",
|
|
|
|
},
|
|
|
|
"Terracotta Shingles"
|
|
|
|
)
|
|
|
|
|