Hand-merged "slopes" branch, with minor recipe changes.
Also changed all single quotes ' to double quotes " in crafts.lua
573
crafts.lua
1
init.lua
@ -70,6 +70,7 @@ dofile(minetest.get_modpath("homedecor").."/tables.lua")
|
||||
dofile(minetest.get_modpath("homedecor").."/electronics.lua")
|
||||
dofile(minetest.get_modpath("homedecor").."/shutters.lua")
|
||||
dofile(minetest.get_modpath("homedecor").."/shingles.lua")
|
||||
dofile(minetest.get_modpath("homedecor").."/slopes.lua")
|
||||
|
||||
dofile(minetest.get_modpath("homedecor").."/door_models.lua")
|
||||
dofile(minetest.get_modpath("homedecor").."/doors_and_gates.lua")
|
||||
|
61
shingles.lua
@ -9,13 +9,13 @@ else
|
||||
S = function ( s ) return s end
|
||||
end
|
||||
|
||||
minetest.register_node('homedecor:skylight', {
|
||||
minetest.register_node("homedecor:skylight", {
|
||||
description = S("Glass Skylight"),
|
||||
drawtype = 'raillike',
|
||||
tiles = { 'default_glass.png' },
|
||||
wield_image = 'default_glass.png',
|
||||
inventory_image = 'homedecor_skylight_inv.png',
|
||||
paramtype = 'light',
|
||||
drawtype = "raillike",
|
||||
tiles = { "default_glass.png" },
|
||||
wield_image = "default_glass.png",
|
||||
inventory_image = "homedecor_skylight_inv.png",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = true,
|
||||
groups = { snappy = 3 },
|
||||
@ -26,13 +26,13 @@ minetest.register_node('homedecor:skylight', {
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_node('homedecor:skylight_frosted', {
|
||||
minetest.register_node("homedecor:skylight_frosted", {
|
||||
description = S("Glass Skylight"),
|
||||
drawtype = 'raillike',
|
||||
tiles = { 'homedecor_skylight_frosted.png' },
|
||||
wield_image = 'homedecor_skylight_frosted.png',
|
||||
inventory_image = 'homedecor_skylight_frosted_inv.png',
|
||||
paramtype = 'light',
|
||||
drawtype = "raillike",
|
||||
tiles = { "homedecor_skylight_frosted.png" },
|
||||
wield_image = "homedecor_skylight_frosted.png",
|
||||
inventory_image = "homedecor_skylight_frosted_inv.png",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
use_texture_alpha = true,
|
||||
walkable = true,
|
||||
@ -44,13 +44,13 @@ minetest.register_node('homedecor:skylight_frosted', {
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_node('homedecor:shingles_wood', {
|
||||
minetest.register_node("homedecor:shingles_wood", {
|
||||
description = S("Wood Shingles"),
|
||||
drawtype = 'raillike',
|
||||
tiles = { 'homedecor_shingles_wood.png' },
|
||||
wield_image = 'homedecor_shingles_wood.png',
|
||||
inventory_image = 'homedecor_shingles_wood_inv.png',
|
||||
paramtype = 'light',
|
||||
drawtype = "raillike",
|
||||
tiles = { "homedecor_shingles_wood.png" },
|
||||
wield_image = "homedecor_shingles_wood.png",
|
||||
inventory_image = "homedecor_shingles_wood_inv.png",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = false,
|
||||
walkable = false,
|
||||
groups = { snappy = 3 },
|
||||
@ -61,13 +61,13 @@ minetest.register_node('homedecor:shingles_wood', {
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_node('homedecor:shingles_asphalt', {
|
||||
minetest.register_node("homedecor:shingles_asphalt", {
|
||||
description = S("Asphalt Shingles"),
|
||||
drawtype = 'raillike',
|
||||
tiles = { 'homedecor_shingles_asphalt.png' },
|
||||
wield_image = 'homedecor_shingles_asphalt.png',
|
||||
inventory_image = 'homedecor_shingles_asphalt_inv.png',
|
||||
paramtype = 'light',
|
||||
drawtype = "raillike",
|
||||
tiles = { "homedecor_shingles_asphalt.png" },
|
||||
wield_image = "homedecor_shingles_asphalt.png",
|
||||
inventory_image = "homedecor_shingles_asphalt_inv.png",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = false,
|
||||
walkable = false,
|
||||
groups = { snappy = 3 },
|
||||
@ -78,18 +78,17 @@ minetest.register_node('homedecor:shingles_asphalt', {
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_node('homedecor:shingles_terracotta', {
|
||||
minetest.register_node("homedecor:shingles_terracotta", {
|
||||
description = S("Terracotta Roofing"),
|
||||
drawtype = 'raillike',
|
||||
tiles = { 'homedecor_shingles_terracotta.png' },
|
||||
wield_image = 'homedecor_shingles_terracotta.png',
|
||||
inventory_image = 'homedecor_shingles_terracotta_inv.png',
|
||||
paramtype = 'light',
|
||||
drawtype = "raillike",
|
||||
tiles = { "homedecor_shingles_terracotta.png" },
|
||||
wield_image = "homedecor_shingles_terracotta.png",
|
||||
inventory_image = "homedecor_shingles_terracotta_inv.png",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = false,
|
||||
walkable = false,
|
||||
groups = { snappy = 3 },
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
drop = 'homedecor:roof_tile_terracotta 4',
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = { -0.5, -0.5, -0.5, 0.5, -0.4, 0.5 }
|
||||
|
295
slopes.lua
Normal file
@ -0,0 +1,295 @@
|
||||
-- Various kinds of shingles
|
||||
|
||||
-- Boilerplate to support localized strings if intllib mod is installed.
|
||||
local S
|
||||
if (minetest.get_modpath("intllib")) then
|
||||
dofile(minetest.get_modpath("intllib").."/intllib.lua")
|
||||
S = intllib.Getter(minetest.get_current_modname())
|
||||
else
|
||||
S = function ( s ) return s end
|
||||
end
|
||||
|
||||
-- Corner shingle nodes, courtesy Bas080
|
||||
|
||||
homedecor_detail_level = 256
|
||||
|
||||
homedecor_register_outer_corner = function(modname, subname, groups, images, description)
|
||||
local slopeboxedge = {}
|
||||
local detail = homedecor_detail_level
|
||||
for i = 0, detail-1 do
|
||||
slopeboxedge[i+1]={-0.5, -0.5+(4/detail), (i/detail)-0.5, 0.5-(i/detail), (i/detail)-0.5+(5/detail), 0.5}
|
||||
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
|
||||
|
||||
homedecor_register_inner_corner = function(modname, subname, groups, images, description)
|
||||
local slopeboxedge = {}
|
||||
local detail = homedecor_detail_level
|
||||
for i = 0, detail-1 do
|
||||
slopeboxedge[i+1]={-0.5, -0.5+(4/detail), -0.5, 0.5-(i/detail), (i/detail)-0.5+(5/detail), 0.5}
|
||||
slopeboxedge[i+detail+1]={-0.5, -0.5+(4/detail), (i/detail)-0.5, 0.5, (i/detail)-0.5+(5/detail), 0.5}
|
||||
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
|
||||
|
||||
homedecor_register_slope = function(modname, subname, recipeitem, groups, images, description)
|
||||
local slopeboxedge = {}
|
||||
local detail = homedecor_detail_level
|
||||
for i = 0, detail-1 do
|
||||
slopeboxedge[i+1]={-0.5, -0.5+(4/detail), (i/detail)-0.5, 0.5, (i/detail)-0.5+(5/detail), 0.5}
|
||||
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 = {
|
||||
{ "", modname..":shingles_side_"..subname, "" },
|
||||
{ modname..":shingles_side_"..subname, "", modname..":shingles_side_"..subname },
|
||||
}
|
||||
})
|
||||
|
||||
-- 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 = {
|
||||
{modname..":shingles_side_"..subname, modname..":shingles_side_"..subname},
|
||||
{"", modname..":shingles_side_"..subname}
|
||||
}
|
||||
})
|
||||
-- convert between flat shingles and inner/outer corners
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = recipeitem.." 3",
|
||||
recipe = { modname..":shingle_outer_corner_"..subname }
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = recipeitem.." 3",
|
||||
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",
|
||||
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" }
|
||||
}
|
||||
})
|
||||
|
||||
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,
|
||||
})
|
||||
|
||||
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)
|
||||
end
|
||||
|
||||
-- corners
|
||||
|
||||
homedecor_register_roof("homedecor", "wood",
|
||||
{ snappy = 3 },
|
||||
{
|
||||
"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",
|
||||
},
|
||||
"Wood Shingles"
|
||||
)
|
||||
|
||||
homedecor_register_roof("homedecor", "asphalt",
|
||||
{ snappy = 3 },
|
||||
{
|
||||
"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",
|
||||
},
|
||||
"Asphalt Shingles"
|
||||
)
|
||||
|
||||
homedecor_register_roof("homedecor", "terracotta",
|
||||
{ snappy = 3 },
|
||||
{
|
||||
"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
|
||||
|
||||
homedecor_register_slope("homedecor", "wood",
|
||||
"homedecor:shingles_wood",
|
||||
{ snappy = 3 },
|
||||
{
|
||||
"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",
|
||||
},
|
||||
"Wood Shingles"
|
||||
)
|
||||
|
||||
homedecor_register_slope("homedecor", "asphalt",
|
||||
"homedecor:shingles_asphalt",
|
||||
{ snappy = 3 },
|
||||
{
|
||||
"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",
|
||||
},
|
||||
"Asphalt Shingles"
|
||||
)
|
||||
|
||||
homedecor_register_slope("homedecor", "terracotta",
|
||||
"homedecor:shingles_terracotta",
|
||||
{ snappy = 3 },
|
||||
{
|
||||
"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"
|
||||
)
|
||||
|
BIN
textures/homedecor_shingles_asphalt_c_t.png
Normal file
After Width: | Height: | Size: 668 B |
BIN
textures/homedecor_shingles_asphalt_c_x.png
Normal file
After Width: | Height: | Size: 810 B |
BIN
textures/homedecor_shingles_asphalt_c_z.png
Normal file
After Width: | Height: | Size: 824 B |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 3.1 KiB |
BIN
textures/homedecor_shingles_asphalt_s_t.png
Normal file
After Width: | Height: | Size: 668 B |
BIN
textures/homedecor_shingles_asphalt_s_z.png
Normal file
After Width: | Height: | Size: 824 B |
BIN
textures/homedecor_shingles_terracotta_c_t.png
Normal file
After Width: | Height: | Size: 394 B |
BIN
textures/homedecor_shingles_terracotta_c_x.png
Normal file
After Width: | Height: | Size: 597 B |
BIN
textures/homedecor_shingles_terracotta_c_z.png
Normal file
After Width: | Height: | Size: 650 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.3 KiB |
BIN
textures/homedecor_shingles_terracotta_s_t.png
Normal file
After Width: | Height: | Size: 394 B |
BIN
textures/homedecor_shingles_terracotta_s_z.png
Normal file
After Width: | Height: | Size: 650 B |
BIN
textures/homedecor_shingles_wood_c_t.png
Normal file
After Width: | Height: | Size: 567 B |
BIN
textures/homedecor_shingles_wood_c_x.png
Normal file
After Width: | Height: | Size: 938 B |
BIN
textures/homedecor_shingles_wood_c_z.png
Normal file
After Width: | Height: | Size: 955 B |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.9 KiB |
BIN
textures/homedecor_shingles_wood_s_t.png
Normal file
After Width: | Height: | Size: 567 B |
BIN
textures/homedecor_shingles_wood_s_z.png
Normal file
After Width: | Height: | Size: 955 B |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.8 KiB |