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
|
|
|
|
2014-12-14 00:31:47 +01:00
|
|
|
local slope_cbox = {
|
|
|
|
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}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
local ocorner_cbox = {
|
|
|
|
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}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
local icorner_cbox = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.5, -0.5, -0.5, 0.5, -0.25, 0.5}, -- NodeBox5
|
|
|
|
{-0.5, -0.5, -0.25, 0.5, 0, 0.5}, -- NodeBox6
|
|
|
|
{-0.5, -0.5, -0.5, 0.25, 0, 0.5}, -- NodeBox7
|
|
|
|
{-0.5, 0, -0.5, 0, 0.25, 0.5}, -- NodeBox8
|
|
|
|
{-0.5, 0, 0, 0.5, 0.25, 0.5}, -- NodeBox9
|
|
|
|
{-0.5, 0.25, 0.25, 0.5, 0.5, 0.5}, -- NodeBox10
|
|
|
|
{-0.5, 0.25, -0.5, -0.25, 0.5, 0.5}, -- NodeBox11
|
|
|
|
}
|
|
|
|
}
|
2013-05-07 07:49:22 +02:00
|
|
|
|
2014-12-13 23:03:08 +01:00
|
|
|
homedecor.register_outer_corner = function(modname, subname, groups, slope_image, description)
|
2013-05-07 07:49:22 +02:00
|
|
|
minetest.register_node(modname..":shingle_outer_corner_" .. subname, {
|
|
|
|
description = S(description.. " (outer corner)"),
|
2014-12-13 23:03:08 +01:00
|
|
|
drawtype = "mesh",
|
|
|
|
mesh = "homedecor_slope_outer_corner.obj",
|
|
|
|
tiles = { "homedecor_slope_outer_corner_"..slope_image..".png" },
|
2013-05-07 07:49:22 +02:00
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
walkable = true,
|
2014-12-14 00:31:47 +01:00
|
|
|
selection_box = ocorner_cbox,
|
|
|
|
collision_box = ocorner_cbox,
|
2013-05-07 07:49:22 +02:00
|
|
|
groups = groups,
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2014-12-13 23:03:08 +01:00
|
|
|
homedecor.register_inner_corner = function(modname, subname, groups, slope_image, description)
|
2013-05-07 07:49:22 +02:00
|
|
|
minetest.register_node(modname..":shingle_inner_corner_" .. subname, {
|
|
|
|
description = S(description.. " (inner corner)"),
|
2014-12-13 23:03:08 +01:00
|
|
|
drawtype = "mesh",
|
|
|
|
mesh = "homedecor_slope_inner_corner.obj",
|
|
|
|
tiles = { "homedecor_slope_inner_corner_"..slope_image..".png" },
|
2013-05-07 07:49:22 +02:00
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
walkable = true,
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}
|
|
|
|
},
|
2014-12-14 00:31:47 +01:00
|
|
|
collision_box = icorner_cbox,
|
2013-05-07 07:49:22 +02:00
|
|
|
groups = groups,
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2014-12-13 23:03:08 +01:00
|
|
|
homedecor.register_slope = function(modname, subname, recipeitem, groups, slope_image, description)
|
2013-05-07 07:49:22 +02:00
|
|
|
minetest.register_node(modname..":shingle_side_" .. subname, {
|
|
|
|
description = S(description),
|
2014-12-13 23:03:08 +01:00
|
|
|
drawtype = "mesh",
|
|
|
|
mesh = "homedecor_slope.obj",
|
|
|
|
tiles = { "homedecor_slope_"..slope_image..".png" },
|
2013-05-07 07:49:22 +02:00
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
walkable = true,
|
2014-12-14 00:31:47 +01:00
|
|
|
selection_box = slope_cbox,
|
|
|
|
collision_box = slope_cbox,
|
2013-05-07 07:49:22 +02:00
|
|
|
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( {
|
2014-09-30 17:31:58 +02:00
|
|
|
output = "homedecor:shingle_side_glass",
|
|
|
|
recipe = {
|
|
|
|
{ "homedecor:skylight", "homedecor:skylight", "homedecor:skylight" }
|
|
|
|
}
|
2013-05-07 07:49:22 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
2014-09-30 17:31:58 +02:00
|
|
|
output = "homedecor:roof_tile_terracotta 8",
|
|
|
|
recipe = {
|
|
|
|
{ "homedecor:shingle_outer_corner_terracotta", "homedecor:shingle_outer_corner_terracotta" }
|
|
|
|
}
|
2013-05-07 07:49:22 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
2014-09-30 17:31:58 +02:00
|
|
|
output = "homedecor:roof_tile_terracotta 8",
|
|
|
|
recipe = {
|
|
|
|
{ "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" }
|
|
|
|
}
|
2013-05-07 07:49:22 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
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,
|
|
|
|
})
|
|
|
|
|
2014-12-13 23:03:08 +01:00
|
|
|
homedecor.register_roof = function(modname, subname, groups, slope_image , description)
|
|
|
|
homedecor.register_outer_corner(modname, subname, groups, slope_image, description)
|
|
|
|
homedecor.register_inner_corner(modname, subname, groups, slope_image, 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 },
|
2014-12-13 23:03:08 +01:00
|
|
|
"wood",
|
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 },
|
2014-12-13 23:03:08 +01:00
|
|
|
"asphalt",
|
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 },
|
2014-12-13 23:03:08 +01:00
|
|
|
"terracotta",
|
2013-05-07 07:49:22 +02:00
|
|
|
"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 },
|
2014-12-13 23:03:08 +01:00
|
|
|
"wood",
|
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 },
|
2014-12-13 23:03:08 +01:00
|
|
|
"asphalt",
|
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 },
|
2014-12-13 23:03:08 +01:00
|
|
|
"terracotta",
|
2013-05-07 07:49:22 +02:00
|
|
|
"Terracotta Shingles"
|
|
|
|
)
|
|
|
|
|
2014-09-19 09:31:49 +02:00
|
|
|
homedecor.register_slope("homedecor", "glass",
|
|
|
|
"homedecor:shingles_glass",
|
|
|
|
{ snappy = 3 },
|
2014-12-13 23:03:08 +01:00
|
|
|
"glass",
|
2014-09-19 09:31:49 +02:00
|
|
|
"Glass Shingles"
|
|
|
|
)
|
2014-09-30 17:31:58 +02:00
|
|
|
|