Fixed shading issue

This commit is contained in:
DonBatman 2015-03-10 21:55:14 -07:00
parent 35469463a8
commit c12ead8a40
21 changed files with 1186 additions and 0 deletions

285
asphault.lua Normal file
View File

@ -0,0 +1,285 @@
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 slope_cbox_long = {
type = "fixed",
fixed = {
{-0.5, -0.5, -1.5, 0.5, -0.375, 0.5}, -- NodeBox1
{-0.5, -0.375, -1.25, 0.5, -0.25, 0.5}, -- NodeBox2
{-0.5, -0.25, -1, 0.5, -0.125, 0.5}, -- NodeBox3
{-0.5, -0.125, -0.75, 0.5, 0, 0.5}, -- NodeBox4
{-0.5, 0, -0.5, 0.5, 0.125, 0.5}, -- NodeBox5
{-0.5, 0.125, -0.25, 0.5, 0.25, 0.5}, -- NodeBox6
{-0.5, 0.25, 0, 0.5, 0.375, 0.5}, -- NodeBox7
{-0.5, 0.375, 0.25, 0.5, 0.5, 0.5}, -- NodeBox8
}
}
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
}
}
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_long = {
type = "fixed",
fixed = {
{-0.5, -0.5, -1.5, -0.25, 0.5, 0.5},
{-0.5, -0.5, 0.25, 1.5, 0.5, 0.5},
{-0.5, -0.5, 0, 1.5, 0.375, 0.5},
{-0.5, -0.5, -1.5, 0, 0.375, 0.5},
{-0.5, -0.5, -1.5, 0.25, 0.25, 0.5},
{-0.5, -0.5, -1.5, 0.5, 0.125, 0.5},
{-0.5, -0.5, -1.5, 0.75, 0, 0.5},
{-0.5, -0.5, -1.5, 1, -0.125, 0.5},
{-0.5, -0.5, -1.5, 1.25, -0.25, 0.5},
{-0.5, -0.5, -1.5, 1.5, -0.375, 0.5},
{-0.5, -0.5, -0.25, 1.5, 0.25, 0.5},
{-0.5, -0.5, -0.5, 1.5, 0.125, 0.5},
{-0.5, -0.5, -0.75, 1.5, 0, 0.5},
{-0.5, -0.5, -1, 1.5, -0.125, 0.5},
{-0.5, -0.5, -1.25, 1.5, -0.25, 0.5},
}
}
local ocorner_cbox_long = {
type = "fixed",
fixed = {
{-0.5, -0.5, 0.25, -0.25, 0.5, 0.5},
{-0.5, -0.5, 0, 0, 0.375, 0.5},
{-0.5, -0.5, -0.25, 0.25, 0.25, 0.5},
{-0.5, -0.5, -0.5, 0.5, 0.125, 0.5},
{-0.5, -0.5, -0.75, 0.75, 0, 0.5},
{-0.5, -0.5, -1, 1, -0.125, 0.5},
{-0.5, -0.5, -1.25, 1.25, -0.25, 0.5},
{-0.5, -0.5, -1.5, 1.5, -0.375, 0.5},
}
}
local asphalt_slope = { --desc, color, img
{"Grey", "grey"},
{"Dark Grey", "dark_grey"},
{"Red", "red"},
{"Green", "green"},
-- {"Grey Round", "grey_round"},
-- {"Dark Grey Round", "dark_grey_round"},
}
for i in ipairs (asphalt_slope) do
local desc = asphalt_slope[i][1]
local color = asphalt_slope[i][2]
--Slope
minetest.register_node("myroofs:asphalt_shingle_"..color, {
description = desc.." Asphalt Shingle",
drawtype = "mesh",
mesh = "twelve-twelve.obj",
tiles = {"myroofs_asphalt_shingle_"..color..".png"},
paramtype = "light",
paramtype2 = "facedir",
groups = {choppy=2, oddly_breakable_by_hand=2, flammable=3},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node,
collision_box = slope_cbox,
selection_box = slope_cbox
})
--Outside Corner
minetest.register_node("myroofs:asphalt_shingle_"..color.."_ocorner", {
description = desc.." Asphalt Shingle Outside Corner",
drawtype = "mesh",
mesh = "twelve-twelve-oc.obj",
tiles = {"myroofs_asphalt_shingle_"..color..".png"},
paramtype = "light",
paramtype2 = "facedir",
groups = {choppy=2, oddly_breakable_by_hand=2, flammable=3},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node,
collision_box = ocorner_cbox,
selection_box = ocorner_cbox
})
--Inside Corner
minetest.register_node("myroofs:asphalt_shingle_"..color.."_icorner", {
description = desc.." Asphalt Shingle Inside Corner",
drawtype = "mesh",
mesh = "twelve-twelve-ic.obj",
tiles = {"myroofs_asphalt_shingle_"..color..".png"},
paramtype = "light",
paramtype2 = "facedir",
groups = {choppy=2, oddly_breakable_by_hand=2, flammable=3},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node,
collision_box = icorner_cbox,
selection_box = icorner_cbox
})
end
local asphalt_lslope = { --desc, color, img
{"Grey", "grey"},
{"Dark Grey", "dark_grey"},
{"Red", "red"},
{"Green", "green"},
{"Grey Round", "grey_round"},
{"Dark Grey Round", "dark_grey_round"},
}
for i in ipairs (asphalt_lslope) do
local desc = asphalt_lslope[i][1]
local color = asphalt_lslope[i][2]
--Long slope
minetest.register_node("myroofs:asphalt_shingle_"..color.."_long", {
description = desc.." Asphalt Shingle Long",
drawtype = "mesh",
mesh = "six-twelve_slope.obj",
tiles = {"myroofs_asphalt_shingle_"..color..".png"},
paramtype = "light",
paramtype2 = "facedir",
groups = {choppy=2, oddly_breakable_by_hand=2, flammable=3},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node,
collision_box = slope_cbox_long,
selection_box = slope_cbox_long
})
--Long Inside Corner
minetest.register_node("myroofs:asphalt_shingle_"..color.."_long_icorner", {
description = desc.." Asphalt Shingle Long Inside Corner",
drawtype = "mesh",
mesh = "six-twelve_slope-ic.obj",
tiles = {"myroofs_asphalt_shingle_"..color..".png"},
paramtype = "light",
paramtype2 = "facedir",
groups = {choppy=2, oddly_breakable_by_hand=2, flammable=3},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node,
collision_box = icorner_cbox_long,
selection_box = icorner_cbox_long
})
--Long Outside Corner
minetest.register_node("myroofs:asphalt_shingle_"..color.."_long_ocorner", {
description = desc.." Asphalt Shingle Long Outside Corner",
drawtype = "mesh",
mesh = "six-twelve_slope-oc.obj",
tiles = {"myroofs_asphalt_shingle_"..color..".png"},
paramtype = "light",
paramtype2 = "facedir",
groups = {choppy=2, oddly_breakable_by_hand=2, flammable=3},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node,
collision_box = ocorner_cbox_long,
selection_box = ocorner_cbox_long
})
end
-----------------------------------------------------------------------------
--Crafts
-----------------------------------------------------------------------------
local craft_slope = { --desc, color, img
{"Grey", "grey"},
{"Dark Grey", "dark_grey"},
{"Red", "red"},
{"Green", "green"},
-- {"Grey Round", "grey_round"},
-- {"Dark Grey Round", "dark_grey_round"},
}
for i in ipairs (craft_slope) do
local desc = craft_slope[i][1]
local color = craft_slope[i][2]
--Slope
minetest.register_craft({
output = "myroofs:asphalt_shingle_"..color.." 2",
recipe = {
{"", "",""},
{"", "","myroofs:asphalt_shingle_"..color.."_bundle"},
{"", "myroofs:asphalt_shingle_"..color.."_bundle","myroofs:asphalt_shingle_"..color.."_bundle"},
}
})
--Inside Corner
minetest.register_craft({
output = "myroofs:asphalt_shingle_"..color.."_icorner 3",
recipe = {
{"", "",""},
{"myroofs:asphalt_shingle_"..color.."_bundle", "",""},
{"myroofs:asphalt_shingle_"..color.."_bundle", "myroofs:asphalt_shingle_"..color.."_bundle",""},
}
})
--Outside Corner
minetest.register_craft({
output = "myroofs:asphalt_shingle_"..color.."_ocorner 3",
recipe = {
{"", "",""},
{"", "myroofs:asphalt_shingle_"..color.."_bundle",""},
{"", "myroofs:asphalt_shingle_"..color.."_bundle","myroofs:asphalt_shingle_"..color.."_bundle"},
}
})
end
local craft_lslope = { --desc, color, img
{"Grey", "grey"},
{"Dark Grey", "dark_grey"},
{"Red", "red"},
{"Green", "green"},
{"Grey Round", "grey_round"},
{"Dark Grey Round", "dark_grey_round"},
}
for i in ipairs (craft_lslope) do
local desc = craft_lslope[i][1]
local color = craft_lslope[i][2]
--Long Slope
minetest.register_craft({
output = "myroofs:asphalt_shingle_"..color.."_long 3",
recipe = {
{"", "",""},
{"", "myroofs:asphalt_shingle_"..color.."_bundle","myroofs:asphalt_shingle_"..color.."_bundle"},
{"myroofs:asphalt_shingle_"..color.."_bundle", "myroofs:asphalt_shingle_"..color.."_bundle","myroofs:asphalt_shingle_"..color.."_bundle"},
}
})
--Long Inside Corner
minetest.register_craft({
output = "myroofs:asphalt_shingle_"..color.."_long_icorner 2",
recipe = {
{"", "","myroofs:asphalt_shingle_"..color.."_bundle"},
{"", "","myroofs:asphalt_shingle_"..color.."_bundle"},
{"myroofs:asphalt_shingle_"..color.."_bundle", "myroofs:asphalt_shingle_"..color.."_bundle","myroofs:asphalt_shingle_"..color.."_bundle"},
}
})
--Long Outside Corner
minetest.register_craft({
output = "myroofs:asphalt_shingle_"..color.."_long_ocorner 2",
recipe = {
{"","myroofs:asphalt_shingle_"..color.."_bundle", ""},
{"", "myroofs:asphalt_shingle_"..color.."_bundle", ""},
{"myroofs:asphalt_shingle_"..color.."_bundle", "myroofs:asphalt_shingle_"..color.."_bundle","myroofs:asphalt_shingle_"..color.."_bundle"},
}
})
end

110
blocks.lua Normal file
View File

@ -0,0 +1,110 @@
local asphalt_shingles = { --desc, color, dye
{"Grey", "grey", "grey"},
{"Dark Grey", "dark_grey", "dark_grey"},
{"Red", "red", "red"},
{"Green", "green", "green"},
}
for i in ipairs (asphalt_shingles) do
local desc = asphalt_shingles[i][1]
local color = asphalt_shingles[i][2]
local dyes = asphalt_shingles[i][3]
-- Asphalt Bundle
minetest.register_node("myroofs:asphalt_shingle_"..color.."_bundle", {
description = desc.." Asphalt Shingle bundle",
drawtype = "normal",
tiles = {"myroofs_asphalt_shingle_"..color..".png"},
paramtype = "light",
paramtype2 = "facedir",
groups = {choppy=2, oddly_breakable_by_hand=2},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node,
})
--Craft
minetest.register_craft({
output = "myroofs:asphalt_shingle_"..color.."_bundle 4",
recipe = {
{"default:gravel", "default:coal_lump","default:gravel"},
{"default:coal_lump", "default:coal_lump","default:coal_lump"},
{"default:gravel", "default:gravel","dye:"..dyes},
}
})
end
--Grey Round Asphalt
minetest.register_node("myroofs:asphalt_shingle_grey_round_bundle", {
description = "Grey Round Asphalt Shingle bundle",
drawtype = "normal",
tiles = {"myroofs_asphalt_shingle_grey_round.png"},
paramtype = "light",
paramtype2 = "facedir",
groups = {choppy=2, oddly_breakable_by_hand=2},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node,
})
--Craft
minetest.register_craft({
output = "myroofs:asphalt_shingle_grey_round_bundle 4",
recipe = {
{"", "myroofs:asphalt_shingle_grey_bundle",""},
{"myroofs:asphalt_shingle_grey_bundle", "","myroofs:asphalt_shingle_grey_bundle"},
{"", "myroofs:asphalt_shingle_grey_bundle",""},
}
})
--Dark Grey Round Asphalt
minetest.register_node("myroofs:asphalt_shingle_dark_grey_round_bundle", {
description = "Dark Grey Round Asphalt Shingle bundle",
drawtype = "normal",
tiles = {"myroofs_asphalt_shingle_dark_grey_round.png"},
paramtype = "light",
paramtype2 = "facedir",
groups = {choppy=2, oddly_breakable_by_hand=2},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_craft({
output = "myroofs:asphalt_shingle_dark_grey_round_bundle 4",
recipe = {
{"", "myroofs:asphalt_shingle_dark_grey_bundle",""},
{"myroofs:asphalt_shingle_dark_grey_bundle", "","myroofs:asphalt_shingle_dark_grey_bundle"},
{"", "myroofs:asphalt_shingle_dark_grey_bundle",""},
}
})
--Dark straw
minetest.register_node("myroofs:straw_dark", {
description = "Dark Straw",
drawtype = "normal",
tiles = {"myroofs_straw_dark.png"},
paramtype = "light",
paramtype2 = "facedir",
groups = {choppy=2, oddly_breakable_by_hand=2},
sounds = default.node_sound_wood_defaults(),
})
--Craft
minetest.register_craft({
output = "myroofs:straw_dark 1",
recipe = {
{"farming:straw", "dye:black",""},
{"", "",""},
{"", "",""},
}
})
--Reet
minetest.register_node("myroofs:reet", {
description = "Reet",
drawtype = "normal",
tiles = {"myroofs_reet.png"},
paramtype = "light",
paramtype2 = "facedir",
groups = {choppy=2, oddly_breakable_by_hand=2},
sounds = default.node_sound_wood_defaults(),
})
--Craft
minetest.register_craft({
output = "myroofs:reet 1",
recipe = {
{"farming:straw", "dye:brown",""},
{"", "",""},
{"", "",""},
}
})

4
depends.txt Normal file
View File

@ -0,0 +1,4 @@
default
farming
dye
homedecor?

290
homedecor.lua Normal file
View File

@ -0,0 +1,290 @@
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 slope_cbox_long = {
type = "fixed",
fixed = {
{-0.5, -0.5, -1.5, 0.5, -0.375, 0.5}, -- NodeBox1
{-0.5, -0.375, -1.25, 0.5, -0.25, 0.5}, -- NodeBox2
{-0.5, -0.25, -1, 0.5, -0.125, 0.5}, -- NodeBox3
{-0.5, -0.125, -0.75, 0.5, 0, 0.5}, -- NodeBox4
{-0.5, 0, -0.5, 0.5, 0.125, 0.5}, -- NodeBox5
{-0.5, 0.125, -0.25, 0.5, 0.25, 0.5}, -- NodeBox6
{-0.5, 0.25, 0, 0.5, 0.375, 0.5}, -- NodeBox7
{-0.5, 0.375, 0.25, 0.5, 0.5, 0.5}, -- NodeBox8
}
}
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
}
}
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_long = {
type = "fixed",
fixed = {
{-0.5, -0.5, -1.5, -0.25, 0.5, 0.5},
{-0.5, -0.5, 0.25, 1.5, 0.5, 0.5},
{-0.5, -0.5, 0, 1.5, 0.375, 0.5},
{-0.5, -0.5, -1.5, 0, 0.375, 0.5},
{-0.5, -0.5, -1.5, 0.25, 0.25, 0.5},
{-0.5, -0.5, -1.5, 0.5, 0.125, 0.5},
{-0.5, -0.5, -1.5, 0.75, 0, 0.5},
{-0.5, -0.5, -1.5, 1, -0.125, 0.5},
{-0.5, -0.5, -1.5, 1.25, -0.25, 0.5},
{-0.5, -0.5, -1.5, 1.5, -0.375, 0.5},
{-0.5, -0.5, -0.25, 1.5, 0.25, 0.5},
{-0.5, -0.5, -0.5, 1.5, 0.125, 0.5},
{-0.5, -0.5, -0.75, 1.5, 0, 0.5},
{-0.5, -0.5, -1, 1.5, -0.125, 0.5},
{-0.5, -0.5, -1.25, 1.5, -0.25, 0.5},
}
}
local ocorner_cbox_long = {
type = "fixed",
fixed = {
{-0.5, -0.5, 0.25, -0.25, 0.5, 0.5},
{-0.5, -0.5, 0, 0, 0.375, 0.5},
{-0.5, -0.5, -0.25, 0.25, 0.25, 0.5},
{-0.5, -0.5, -0.5, 0.5, 0.125, 0.5},
{-0.5, -0.5, -0.75, 0.75, 0, 0.5},
{-0.5, -0.5, -1, 1, -0.125, 0.5},
{-0.5, -0.5, -1.25, 1.25, -0.25, 0.5},
{-0.5, -0.5, -1.5, 1.5, -0.375, 0.5},
}
}
local homedecor_slope = { --desc, color, img
{"Home Decor", "hd_asphalt", "homedecor_shingles_asphalt"},
{"Terracotta", "hd_terracotta", "homedecor_shingles_terracotta"},
{"Wood", "hd_wood", "homedecor_shingles_wood"},
}
for i in ipairs (homedecor_slope) do
local desc = homedecor_slope[i][1]
local color = homedecor_slope[i][2]
local img = homedecor_slope[i][3]
--Slope
minetest.register_node("myroofs:asphalt_shingle_"..color, {
description = desc.." Asphalt Shingle",
drawtype = "mesh",
mesh = "twelve-twelve.obj",
tiles = {img..".png"},
paramtype = "light",
paramtype2 = "facedir",
groups = {choppy=2, oddly_breakable_by_hand=2, flammable=3},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node,
collision_box = slope_cbox,
selection_box = slope_cbox
})
--Outside Corner
minetest.register_node("myroofs:asphalt_shingle_"..color.."_ocorner", {
description = desc.." Asphalt Shingle Outside Corner",
drawtype = "mesh",
mesh = "twelve-twelve-oc.obj",
tiles = {img..".png"},
paramtype = "light",
paramtype2 = "facedir",
groups = {choppy=2, oddly_breakable_by_hand=2, flammable=3},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node,
collision_box = ocorner_cbox,
selection_box = ocorner_cbox
})
--Inside Corner
minetest.register_node("myroofs:asphalt_shingle_"..color.."_icorner", {
description = desc.." Asphalt Shingle Inside Corner",
drawtype = "mesh",
mesh = "twelve-twelve-ic.obj",
tiles = {img..".png"},
paramtype = "light",
paramtype2 = "facedir",
groups = {choppy=2, oddly_breakable_by_hand=2, flammable=3},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node,
collision_box = icorner_cbox,
selection_box = icorner_cbox
})
end
local homedecor_lslope = { --desc, color, img
{"Dog House", "hd_doghouse", "homedecor_doghouse_roof_top"},
{"Home Decor", "hd_asphalt", "homedecor_shingles_asphalt"},
{"Terracotta", "hd_terracotta", "homedecor_shingles_terracotta"},
{"Wood", "hd_wood", "homedecor_shingles_wood"},
}
for i in ipairs (homedecor_lslope) do
local desc = homedecor_lslope[i][1]
local color = homedecor_lslope[i][2]
local img = homedecor_lslope[i][3]
--Long slope
minetest.register_node("myroofs:asphalt_shingle_"..color.."_long", {
description = desc.." Asphalt Shingle Long",
drawtype = "mesh",
mesh = "six-twelve_slope.obj",
tiles = {img..".png"},
paramtype = "light",
paramtype2 = "facedir",
groups = {choppy=2, oddly_breakable_by_hand=2, flammable=3},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node,
collision_box = slope_cbox_long,
selection_box = slope_cbox_long
})
--Long Inside Corner
minetest.register_node("myroofs:asphalt_shingle_"..color.."_long_icorner", {
description = desc.." Asphalt Shingle Long Inside Corner",
drawtype = "mesh",
mesh = "six-twelve_slope-ic.obj",
tiles = {img..".png"},
paramtype = "light",
paramtype2 = "facedir",
groups = {choppy=2, oddly_breakable_by_hand=2, flammable=3},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node,
collision_box = icorner_cbox_long,
selection_box = icorner_cbox_long
})
--Long Outside Corner
minetest.register_node("myroofs:asphalt_shingle_"..color.."_long_ocorner", {
description = desc.." Asphalt Shingle Long Outside Corner",
drawtype = "mesh",
mesh = "six-twelve_slope-oc.obj",
tiles = {img..".png"},
paramtype = "light",
paramtype2 = "facedir",
groups = {choppy=2, oddly_breakable_by_hand=2, flammable=3},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node,
collision_box = ocorner_cbox_long,
selection_box = ocorner_cbox_long
})
end
minetest.register_craft( {
output = "homedecor:shingles_terracotta",
recipe = {
{ "homedecor:roof_tile_terracotta", "homedecor:roof_tile_terracotta"},
{ "homedecor:roof_tile_terracotta", "homedecor:roof_tile_terracotta"},
},
})
-----------------------------------------------------------------------------
--Crafts
-----------------------------------------------------------------------------
local homedecor_slope = { --desc, color, item
{"Home Decor", "hd_asphalt", "homedecor:shingles_asphalt"},
{"Terracotta", "hd_terracotta", "homedecor:shingles_terracotta"},
{"Wood", "hd_wood", "homedecor:shingles_wood"},
}
for i in ipairs (homedecor_slope) do
local desc = homedecor_slope[i][1]
local color = homedecor_slope[i][2]
local img = homedecor_slope[i][3]
--Slope
minetest.register_craft({
output = "myroofs:asphalt_shingle_"..color.." 2",
recipe = {
{"", "",""},
{"", "",item},
{"", item,item},
}
})
--Inside Corner
minetest.register_craft({
output = "myroofs:asphalt_shingle_"..color.."_icorner 3",
recipe = {
{"", "",""},
{item, "",""},
{item, item,""},
}
})
--Outside Corner
minetest.register_craft({
output = "myroofs:asphalt_shingle_"..color.."_ocorner 3",
recipe = {
{"", "",""},
{"", item,""},
{"", item,item},
}
})
end
local homedecor_lslope = { --desc, color, item
{"Home Decor", "hd_asphalt", "homedecor:shingles_asphalt"},
{"Terracotta", "hd_terracotta", "homedecor:shingles_terracotta"},
{"Wood", "hd_wood", "homedecor:shingles_wood"},
}
for i in ipairs (homedecor_lslope) do
local desc = homedecor_lslope[i][1]
local color = homedecor_lslope[i][2]
local img = homedecor_lslope[i][3]
--Long Slope
minetest.register_craft({
output = "myroofs:asphalt_shingle_"..color.."_long 3",
recipe = {
{"", "",""},
{"", item,item},
{item, item,item},
}
})
--Long Inside Corner
minetest.register_craft({
output = "myroofs:asphalt_shingle_"..color.."_long_icorner 2",
recipe = {
{"", "",item},
{"", "",item},
{item, item,item},
}
})
--Long Outside Corner
minetest.register_craft({
output = "myroofs:asphalt_shingle_"..color.."_long_ocorner 2",
recipe = {
{"",item, ""},
{"", item, ""},
{item, item,item},
}
})
end

10
init.lua Normal file
View File

@ -0,0 +1,10 @@
dofile(minetest.get_modpath("myroofs").."/asphault.lua")
dofile(minetest.get_modpath("myroofs").."/straw.lua")
dofile(minetest.get_modpath("myroofs").."/blocks.lua")
if minetest.get_modpath("homedecor") then
dofile(minetest.get_modpath("myroofs").."/homedecor.lua")
return
end

View File

@ -0,0 +1,59 @@
# Blender v2.73 (sub 0) OBJ File: 'six-twelve_allslopes.blend'
# www.blender.org
v -1.500000 -0.500000 0.500000
v -1.500000 -0.500000 -0.500000
v -0.500000 -0.500000 -0.500000
v -0.500000 -0.500000 0.500000
v -1.500000 0.500000 0.500000
v -1.500000 0.000000 -0.500000
v -0.500000 0.000000 -0.500000
v -0.500000 0.500000 0.500000
v -1.500000 -0.500000 -1.500000
v -0.500000 -0.500000 -1.500000
v -0.500000 0.000000 -1.500000
v 0.500000 -0.500000 -0.500000
v 0.500000 -0.500000 0.500000
v 0.500000 0.500000 -0.500000
v 0.500000 0.500000 0.500000
v 0.500000 -0.500000 -1.500000
v 0.500000 0.500000 -1.500000
vt 0.999900 0.999900
vt 0.000100 0.500000
vt 0.000100 0.000100
vt 0.999900 0.000100
vt 1.000000 0.000000
vt 1.000000 1.000000
vt 0.000000 1.000000
vt 0.000100 0.999900
vt 1.000000 0.000095
vt 1.000000 0.999905
vt 0.006215 0.006580
vt 0.000047 0.000142
vt 1.000000 0.500000
vt 0.000000 0.000000
vn -1.000000 0.000000 0.000000
vn 0.000000 0.894400 -0.447200
vn 0.000000 0.000000 1.000000
vn 0.000000 -1.000000 0.000000
vn -0.447200 0.894400 0.000000
vn 1.000000 0.000000 0.000000
vn 0.000000 0.000000 -1.000000
s off
f 5/1/1 6/2/1 2/3/1 1/4/1
f 7/5/2 8/6/2 15/7/2
f 8/1/3 5/8/3 1/3/3 4/4/3
f 1/8/4 2/3/4 3/4/4 4/1/4
f 8/8/2 7/3/2 6/9/2 5/10/2
f 14/7/5 7/11/5 15/6/5
f 6/6/2 7/7/2 9/5/2
f 3/1/4 2/8/4 9/3/4 10/4/4
f 11/12/5 7/9/5 14/6/5 17/7/5
f 14/1/6 15/8/6 13/3/6 12/4/6
f 14/8/6 12/3/6 16/4/6 17/1/6
f 3/8/4 10/3/4 16/4/4 12/1/4
f 10/5/7 11/13/7 17/7/7 16/14/7
f 4/8/4 3/3/4 12/4/4 13/1/4
f 8/8/3 4/3/3 13/4/3 15/1/3
f 7/6/5 11/7/5 9/14/5
f 9/4/7 11/2/7 10/3/7
f 2/5/1 6/13/1 9/14/1

View File

@ -0,0 +1,49 @@
# Blender v2.73 (sub 0) OBJ File: 'six-twelve_allslopes.blend'
# www.blender.org
v -1.500000 -0.500000 0.500000
v -1.500000 -0.500000 -0.500000
v -0.500000 -0.500000 -0.500000
v -0.500000 -0.500000 0.500000
v -0.500000 0.000000 -0.500000
v -0.500000 0.000000 0.500000
v -1.500000 -0.500000 -1.500000
v -0.500000 -0.500000 -1.500000
v 0.500000 -0.500000 -0.500000
v 0.500000 -0.500000 0.500000
v 0.500000 0.000000 -0.500000
v 0.500000 0.500000 0.500000
v 0.500000 -0.500000 -1.500000
vt 0.000000 0.000000
vt 1.000000 0.000000
vt 1.000000 1.000000
vt 0.000047 0.999952
vt 0.000047 0.000142
vt 0.999953 0.000142
vt 0.000100 0.999900
vt 0.000100 0.000100
vt 0.999900 0.000100
vt 0.999900 0.999900
vt 0.999900 0.500000
vt 1.000000 0.999905
vt 0.000100 0.500000
vt 1.000000 0.500000
vn -0.447200 0.894400 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 0.894400 -0.447200
vn 1.000000 0.000000 0.000000
vn 0.000000 0.000000 1.000000
s off
f 5/1/1 6/2/1 12/3/1
f 6/3/1 5/4/1 2/5/1 1/6/1
f 1/7/2 2/8/2 3/9/2 4/10/2
f 2/2/1 5/3/1 7/1/1
f 11/1/3 5/2/3 12/4/3
f 3/10/2 2/7/2 7/8/2 8/9/2
f 11/11/4 12/7/4 10/8/4 9/9/4
f 8/6/3 5/12/3 11/7/3 13/8/3
f 3/7/2 8/8/2 13/9/2 9/10/2
f 5/7/3 8/8/3 7/6/3
f 4/7/2 3/8/2 9/9/2 10/10/2
f 6/13/5 4/8/5 10/9/5 12/10/5
f 11/13/4 9/8/4 13/9/4
f 6/14/5 1/1/5 4/2/5

View File

@ -0,0 +1,38 @@
# Blender v2.73 (sub 0) OBJ File: 'six-twelve_allslopes.blend'
# www.blender.org
v -0.500000 -0.500000 0.500000
v -0.500000 -0.500000 -0.500000
v 0.500000 -0.500000 -0.500000
v 0.500000 -0.500000 0.500000
v -0.500000 0.500000 0.500000
v -0.500000 0.000000 -0.500000
v 0.500000 0.000000 -0.500000
v 0.500000 0.500000 0.500000
v -0.500000 -0.500000 -1.500000
v 0.500000 -0.500000 -1.500000
vt 0.999900 0.999900
vt 0.000100 0.500000
vt 0.000100 0.000100
vt 0.999900 0.000100
vt 0.999900 0.500000
vt 0.000100 0.999900
vt 1.000000 0.000095
vt 1.000000 0.999905
vt 1.000000 0.000000
vt 1.000000 0.500000
vt 0.000000 0.000000
vn -1.000000 0.000000 0.000000
vn 1.000000 0.000000 0.000000
vn 0.000000 0.000000 1.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 0.894400 -0.447200
s off
f 5/1/1 6/2/1 2/3/1 1/4/1
f 7/5/2 8/6/2 4/3/2 3/4/2
f 8/1/3 5/6/3 1/3/3 4/4/3
f 1/6/4 2/3/4 3/4/4 4/1/4
f 8/6/5 7/3/5 6/7/5 5/8/5
f 6/8/5 7/6/5 10/3/5 9/7/5
f 7/2/2 3/3/2 10/4/2
f 3/1/4 2/6/4 9/3/4 10/4/4
f 2/9/1 6/10/1 9/11/1

View File

@ -0,0 +1,32 @@
# Blender v2.73 (sub 0) OBJ File: 'twelve-twelve-ic.blend'
# www.blender.org
v -0.500000 -0.500000 0.500000
v -0.500000 -0.500000 -0.500000
v 0.500000 -0.500000 -0.500000
v 0.500000 -0.500000 0.500000
v -0.500000 0.500000 0.500000
v 0.500000 0.500000 -0.500000
v 0.500000 0.500000 0.500000
vt 0.999900 0.999900
vt 0.000100 0.999900
vt 0.000100 0.000100
vt 0.999900 0.000100
vt 1.000000 1.000000
vt 0.000000 1.000000
vt 1.000000 0.000000
vt 0.000000 0.000000
vn 1.000000 0.000000 0.000000
vn 0.000000 0.000000 1.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 0.707100 -0.707100
vn -1.000000 0.000000 0.000000
vn 0.000000 0.000000 -1.000000
vn -0.707100 0.707100 0.000000
s off
f 6/1/1 7/2/1 4/3/1 3/4/1
f 7/1/2 5/2/2 1/3/2 4/4/2
f 1/2/3 2/3/3 3/4/3 4/1/3
f 5/5/4 7/6/4 2/7/4
f 5/1/5 2/3/5 1/4/5
f 2/7/6 6/6/6 3/8/6
f 7/5/7 6/2/7 2/3/7

View File

@ -0,0 +1,26 @@
# Blender v2.73 (sub 0) OBJ File: 'twelve-twelve-oc.blend'
# www.blender.org
v 0.500000 0.500000 0.500000
v -0.500000 -0.500000 0.500000
v 0.500000 -0.500000 0.500000
v -0.500000 -0.500000 -0.500000
v 0.500000 -0.500000 -0.500000
vt 0.999900 0.999900
vt 0.000100 0.999900
vt 0.000100 0.000100
vt 0.999900 0.000100
vt 0.000000 1.000000
vt 0.000000 0.000000
vt 1.000000 0.000000
vt 1.000000 1.000000
vn 0.000000 -1.000000 -0.000000
vn 1.000000 0.000000 0.000000
vn 0.000000 -0.000000 1.000000
vn -0.707100 0.707100 0.000000
vn 0.000000 0.707100 -0.707100
s off
f 3/1/1 2/2/1 4/3/1 5/4/1
f 1/5/2 3/6/2 5/7/2
f 1/8/3 2/6/3 3/7/3
f 1/8/4 4/6/4 2/7/4
f 1/5/5 5/6/5 4/7/5

29
models/twelve-twelve.obj Normal file
View File

@ -0,0 +1,29 @@
# Blender v2.73 (sub 0) OBJ File: 'twelve-twelve.blend'
# www.blender.org
v 0.500000 0.500000 0.500000
v -0.500000 0.500000 0.500000
v -0.500000 -0.500000 0.500000
v 0.500000 -0.500000 0.500000
v -0.500000 -0.500000 -0.500000
v 0.500000 -0.500000 -0.500000
vt 0.999900 0.999900
vt 0.000100 0.999900
vt 0.000100 0.000100
vt 0.999900 0.000100
vt 1.000000 1.000000
vt 0.000000 0.000000
vt 1.000000 0.000000
vt 0.000000 1.000000
vt -0.000050 0.999916
vt -0.000050 0.000084
vn 0.000000 -0.000000 1.000000
vn 0.000000 -1.000000 -0.000000
vn -1.000000 -0.000000 0.000000
vn 1.000000 0.000000 0.000000
vn 0.000000 0.707100 -0.707100
s off
f 1/1/1 2/2/1 3/3/1 4/4/1
f 4/1/2 3/2/2 5/3/2 6/4/2
f 2/5/3 5/6/3 3/7/3
f 1/8/4 4/6/4 6/7/4
f 2/5/5 1/9/5 6/10/5 5/7/5

254
straw.lua Normal file
View File

@ -0,0 +1,254 @@
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 slope_cbox_long = {
type = "fixed",
fixed = {
{-0.5, -0.5, -1.5, 0.5, -0.375, 0.5}, -- NodeBox1
{-0.5, -0.375, -1.25, 0.5, -0.25, 0.5}, -- NodeBox2
{-0.5, -0.25, -1, 0.5, -0.125, 0.5}, -- NodeBox3
{-0.5, -0.125, -0.75, 0.5, 0, 0.5}, -- NodeBox4
{-0.5, 0, -0.5, 0.5, 0.125, 0.5}, -- NodeBox5
{-0.5, 0.125, -0.25, 0.5, 0.25, 0.5}, -- NodeBox6
{-0.5, 0.25, 0, 0.5, 0.375, 0.5}, -- NodeBox7
{-0.5, 0.375, 0.25, 0.5, 0.5, 0.5}, -- NodeBox8
}
}
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
}
}
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_long = {
type = "fixed",
fixed = {
{-0.5, -0.5, -1.5, -0.25, 0.5, 0.5},
{-0.5, -0.5, 0.25, 1.5, 0.5, 0.5},
{-0.5, -0.5, 0, 1.5, 0.375, 0.5},
{-0.5, -0.5, -1.5, 0, 0.375, 0.5},
{-0.5, -0.5, -1.5, 0.25, 0.25, 0.5},
{-0.5, -0.5, -1.5, 0.5, 0.125, 0.5},
{-0.5, -0.5, -1.5, 0.75, 0, 0.5},
{-0.5, -0.5, -1.5, 1, -0.125, 0.5},
{-0.5, -0.5, -1.5, 1.25, -0.25, 0.5},
{-0.5, -0.5, -1.5, 1.5, -0.375, 0.5},
{-0.5, -0.5, -0.25, 1.5, 0.25, 0.5},
{-0.5, -0.5, -0.5, 1.5, 0.125, 0.5},
{-0.5, -0.5, -0.75, 1.5, 0, 0.5},
{-0.5, -0.5, -1, 1.5, -0.125, 0.5},
{-0.5, -0.5, -1.25, 1.5, -0.25, 0.5},
}
}
local ocorner_cbox_long = {
type = "fixed",
fixed = {
{-0.5, -0.5, 0.25, -0.25, 0.5, 0.5},
{-0.5, -0.5, 0, 0, 0.375, 0.5},
{-0.5, -0.5, -0.25, 0.25, 0.25, 0.5},
{-0.5, -0.5, -0.5, 0.5, 0.125, 0.5},
{-0.5, -0.5, -0.75, 0.75, 0, 0.5},
{-0.5, -0.5, -1, 1, -0.125, 0.5},
{-0.5, -0.5, -1.25, 1.25, -0.25, 0.5},
{-0.5, -0.5, -1.5, 1.5, -0.375, 0.5},
}
}
local straw_slope = { --desc, color, item
{"Straw", "straw", "farming:straw"},
{"Dark Straw", "straw_dark", "myroofs:straw_dark"},
{"Reet", "reet", "myroofs:reet"},
}
for i in ipairs (straw_slope) do
local desc = straw_slope[i][1]
local color = straw_slope[i][2]
local item = straw_slope[i][3]
--Slope
minetest.register_node("myroofs:"..color.."_roof", {
description = desc.." Roof",
drawtype = "mesh",
mesh = "twelve-twelve.obj",
tiles = {"myroofs_"..color..".png"},
paramtype = "light",
paramtype2 = "facedir",
groups = {choppy=2, oddly_breakable_by_hand=2, flammable=3},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node,
collision_box = slope_cbox,
selection_box = slope_cbox
})
--Outside Corner
minetest.register_node("myroofs:"..color.."_roof_ocorner", {
description = desc.." Roof Outside Corner",
drawtype = "mesh",
mesh = "twelve-twelve-oc.obj",
tiles = {"myroofs_"..color..".png"},
paramtype = "light",
paramtype2 = "facedir",
groups = {choppy=2, oddly_breakable_by_hand=2, flammable=3},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node,
collision_box = ocorner_cbox,
selection_box = ocorner_cbox
})
--Inner Corner
minetest.register_node("myroofs:"..color.."_roof_icorner", {
description = desc.." Roof Inside Corner",
drawtype = "mesh",
mesh = "twelve-twelve-ic.obj",
tiles = {"myroofs_"..color..".png"},
paramtype = "light",
paramtype2 = "facedir",
groups = {choppy=2, oddly_breakable_by_hand=2, flammable=3},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node,
collision_box = icorner_cbox,
selection_box = icorner_cbox
})
--Long Slope
minetest.register_node("myroofs:"..color.."_roof_long", {
description = desc.." Roof Long",
drawtype = "mesh",
mesh = "six-twelve_slope.obj",
tiles = {"myroofs_"..color..".png"},
paramtype = "light",
paramtype2 = "facedir",
groups = {choppy=2, oddly_breakable_by_hand=2, flammable=3},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node,
collision_box = slope_cbox_long,
selection_box = slope_cbox_long
})
--Long Inner Corner
minetest.register_node("myroofs:"..color.."_roof_long_icorner", {
description = desc.." Roof Long Inside Corner",
drawtype = "mesh",
mesh = "six-twelve_slope-ic.obj",
tiles = {"myroofs_"..color..".png"},
paramtype = "light",
paramtype2 = "facedir",
groups = {choppy=2, oddly_breakable_by_hand=2, flammable=3},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node,
collision_box = icorner_cbox_long,
selection_box = icorner_cbox_long
})
--Long Outside Corner
minetest.register_node("myroofs:"..color.."_roof_long_ocorner", {
description = desc.." Roof Long Outside Corner",
drawtype = "mesh",
mesh = "six-twelve_slope-oc.obj",
tiles = {"myroofs_"..color..".png"},
paramtype = "light",
paramtype2 = "facedir",
groups = {choppy=2, oddly_breakable_by_hand=2, flammable=3},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node,
collision_box = ocorner_cbox_long,
selection_box = ocorner_cbox_long
})
------------------------------------------------------------------------------------
--Crafts
------------------------------------------------------------------------------------
--Slope
minetest.register_craft({
output = "myroofs:"..color.."_roof 6",
recipe = {
{"","",""},
{"","",item},
{"",item,item},
}
})
--Outside Corner
minetest.register_craft({
output = "myroofs:"..color.."_roof_ocorner 5",
recipe = {
{"", "",""},
{"",item,""},
{"",item,item},
}
})
--Inside Corner
minetest.register_craft({
output = "myroofs:"..color.."_roof_icorner 8",
recipe = {
{"","",""},
{item,"",""},
{item,item,""},
}
})
--Long Slope
minetest.register_craft({
output = "myroofs:"..color.."_roof_long 1",
recipe = {
{"", "",""},
{"", item,item},
{item, item,item},
}
})
--Long Inside Corner
minetest.register_craft({
output = "myroofs:"..color.."_roof_long_icorner 1",
recipe = {
{"", "",item},
{"", "",item},
{item, item,item},
}
})
--Long Outside Corner
minetest.register_craft({
output = "myroofs:"..color.."_roof_long_ocorner 1",
recipe = {
{"", item,""},
{"", item,""},
{item, item,item},
}
})
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 507 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 664 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 557 B

BIN
textures/myroofs_reet.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 773 B

BIN
textures/myroofs_straw.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 745 B