diff options
Diffstat (limited to 'nodes_roof.lua')
-rw-r--r-- | nodes_roof.lua | 224 |
1 files changed, 36 insertions, 188 deletions
diff --git a/nodes_roof.lua b/nodes_roof.lua index 13a6f0e..f865b6d 100644 --- a/nodes_roof.lua +++ b/nodes_roof.lua @@ -7,6 +7,7 @@ local S = cottages.S -- a better roof than the normal stairs; can be replaced by stairs:stair_wood + -- create the three basic roof parts plus receipes for them; cottages.register_roof = function( name, tiles, basic_material, homedecor_alternative ) @@ -182,6 +183,11 @@ cottages.register_roof( 'slate', cottages.texture_roof_sides,"cottages_slate.png"}, cottages.craftitem_stone, nil); +cottages.register_roof( 'shingle', + {"cottages_homedecor_shingles_misc_wood.png", cottages.texture_roof_sides, + cottages.texture_roof_sides, cottages.texture_roof_sides, + cottages.texture_roof_sides, "cottages_homedecor_shingles_misc_wood.png"}, + 'cottages:wood_flat', nil); --------------------------------------------------------------------------------------- -- slate roofs are sometimes on vertical fronts of houses @@ -200,44 +206,13 @@ minetest.register_node("cottages:slate_vertical", { is_ground_content = false, }) - minetest.register_craft({ output = "cottages:slate_vertical 2", recipe = { {cottages.craftitem_stone, cottages.craftitem_wood, '' } } }); - - -if stairs and stairs.mod and stairs.mod == "redo" then - - stairs.register_all("slate_vertical", "cottages:slate_vertical", - {cracky = 2, stone = 1}, - {"cottages_slate.png"}, - S("Slate stair"), - S("Slate slab"), - default.node_sound_dirt_defaults()) - -elseif minetest.global_exists("stairsplus") then - - stairsplus:register_all("cottages", "slate_vertical", "cottages:slate_vertical", { - description = S("Slate"), - tiles = {"cottages_slate.png"}, - groups = {cracky = 2, stone = 1}, - sounds = default.node_sound_dirt_defaults(), - }) - -else - - stairs.register_stair_and_slab("slate_vertical", "cottages:slate_vertical", - {cracky = 2, stone = 1}, - {"cottages_slate.png"}, - S("Slate stair"), - S("Slate slab"), - default.node_sound_dirt_defaults()) - - -end +cottages.derive_blocks( "cottages", "slate_vertical", "Slate", "cottages_slate.png", {cracky = 2, stone = 1} ) --------------------------------------------------------------------------------------- @@ -254,44 +229,14 @@ minetest.register_node("cottages:roof_vertical_asphalt", { is_ground_content = false, }) - minetest.register_craft({ output = "cottages:roof_vertical_asphalt 3", recipe = { {cottages.craftitem_stone, cottages.craftitem_wood, cottages.craftitem_coal_lump } } }); +cottages.derive_blocks( "cottages", "roof_vertical_asphalt", "Asphalt", "cottages_homedecor_shingles_asphalt.png", {cracky = 2, stone = 1} ) - -if stairs and stairs.mod and stairs.mod == "redo" then - - stairs.register_all("roof_vertical_asphalt", "cottages:roof_vertical_asphalt", - {cracky = 2, stone = 1}, - {"cottages_homedecor_shingles_asphalt.png"}, - S("Asphalt stair"), - S("Asphalt slab"), - default.node_sound_dirt_defaults()) - -elseif minetest.global_exists("stairsplus") then - - stairsplus:register_all("cottages", "roof_vertical_asphalt", "cottages:roof_vertical_asphalt", { - description = S("Asphalt"), - tiles = {"cottages_homedecor_shingles_asphalt.png"}, - groups = {cracky = 2, stone = 1}, - sounds = default.node_sound_dirt_defaults(), - }) - -else - - stairs.register_stair_and_slab("roof_vertical_asphalt", "cottages:roof_vertical_asphalt", - {cracky = 2, stone = 1}, - {"cottages_homedecor_shingles_asphalt.png"}, - S("Asphalt stair"), - S("Asphalt slab"), - default.node_sound_dirt_defaults()) - - -end --------------------------------------------------------------------------------------- @@ -308,44 +253,13 @@ minetest.register_node("cottages:roof_vertical_terracotta", { is_ground_content = false, }) - minetest.register_craft({ output = "cottages:roof_vertical_terracotta 3", recipe = { {cottages.craftitem_stone, cottages.craftitem_wood, cottages.craftitem_clay_brick } } }); - - -if stairs and stairs.mod and stairs.mod == "redo" then - - stairs.register_all("roof_vertical_terracotta", "cottages:roof_vertical_terracotta", - {cracky = 2, stone = 1}, - {"cottages_homedecor_shingles_terracotta.png"}, - S("Terracotta stair"), - S("Terracotta slab"), - default.node_sound_dirt_defaults()) - -elseif minetest.global_exists("stairsplus") then - - stairsplus:register_all("cottages", "roof_vertical_terracotta", "cottages:roof_vertical_terracotta", { - description = S("Terracotta"), - tiles = {"cottages_homedecor_shingles_terracotta.png"}, - groups = {cracky = 2, stone = 1}, - sounds = default.node_sound_dirt_defaults(), - }) - -else - - stairs.register_stair_and_slab("roof_vertical_terracotta", "cottages:roof_vertical_terracotta", - {cracky = 2, stone = 1}, - {"cottages_homedecor_shingles_terracotta.png"}, - S("Terracotta stair"), - S("Terracotta slab"), - default.node_sound_dirt_defaults()) - - -end +cottages.derive_blocks( "cottages", "roof_vertical_terracotta", "Terracotta", "cottages_homedecor_shingles_terracotta.png", {cracky = 2, stone = 1} ) @@ -363,44 +277,15 @@ minetest.register_node("cottages:roof_vertical_wood", { is_ground_content = false, }) - minetest.register_craft({ output = "cottages:roof_vertical_wood 3", recipe = { {cottages.craftitem_stone, cottages.craftitem_wood, "default:tree" } } }); +cottages.derive_blocks( "cottages", "roof_vertical_wood", "Wooden", cottages.textures_roof_wood, {cracky = 2, stone = 1} ) + - -if stairs and stairs.mod and stairs.mod == "redo" then - - stairs.register_all("roof_vertical_wood", "cottages:roof_vertical_wood", - {cracky = 2, stone = 1}, - {cottages.textures_roof_wood}, - S("Wooden roof stair"), - S("Wooden roof slab"), - default.node_sound_dirt_defaults()) - -elseif minetest.global_exists("stairsplus") then - - stairsplus:register_all("cottages", "roof_vertical_wood", "cottages:roof_vertical_wood", { - description = S("Wooden roof"), - tiles = {cottages.textures_roof_wood}, - groups = {cracky = 2, stone = 1}, - sounds = default.node_sound_dirt_defaults(), - }) - -else - - stairs.register_stair_and_slab("roof_vertical_wood", "cottages:roof_vertical_wood", - {cracky = 2, stone = 1}, - {cottages.textures_roof_wood}, - S("Wooden roof stair"), - S("Wooden roof slab"), - default.node_sound_dirt_defaults()) - - -end --------------------------------------------------------------------------------------- -- brown shingles roof: sawable block @@ -416,44 +301,38 @@ minetest.register_node("cottages:roof_vertical_brown", { is_ground_content = false, }) - minetest.register_craft({ output = "cottages:roof_vertical_brown 3", recipe = { {cottages.craftitem_stone, cottages.craftitem_wood, cottages.craftitem_dirt } } }); +cottages.derive_blocks( "cottages", "roof_vertical_brown", "Shingles", "cottages_homedecor_shingles_wood.png", {cracky = 2, stone = 1} ) - -if stairs and stairs.mod and stairs.mod == "redo" then - - stairs.register_all("roof_vertical_brown", "cottages:roof_vertical_brown", - {cracky = 2, stone = 1}, - {"cottages_homedecor_shingles_wood.png"}, - S("Shingles stair"), - S("Shingles slab"), - default.node_sound_dirt_defaults()) - -elseif minetest.global_exists("stairsplus") then - - stairsplus:register_all("cottages", "roof_vertical_brown", "cottages:roof_vertical_brown", { - description = S("Shingles"), - tiles = {"cottages_homedecor_shingles_wood.png"}, - groups = {cracky = 2, stone = 1}, - sounds = default.node_sound_dirt_defaults(), - }) - -else - stairs.register_stair_and_slab("roof_vertical_brown", "cottages:roof_vertical_brown", - {cracky = 2, stone = 1}, - {"cottages_homedecor_shingles_wood.png"}, - S("Shingles stair"), - S("Shingles slab"), - default.node_sound_dirt_defaults()) - - -end + +--------------------------------------------------------------------------------------- +-- assorted shingles roof: sawable block +--------------------------------------------------------------------------------------- +minetest.register_node("cottages:roof_vertical_shingle", { + description = S("Vertical misc shingle roof"), + tiles = {"cottages_homedecor_shingles_misc_wood.png", cottages.texture_roof_sides, + "cottages_homedecor_shingles_misc_wood.png", "cottages_homedecor_shingles_misc_wood.png", + cottages.texture_roof_sides, "cottages_homedecor_shingles_misc_wood.png"}, + paramtype2 = "facedir", + groups = {cracky=2, stone=1}, + sounds = default.node_sound_stone_defaults, + is_ground_content = false, +}) + +minetest.register_craft({ + output = "cottages:roof_vertical_shingle", + recipe = { {"cottages:wood_flat", "cottages:wood_flat"}, + {"cottages:wood_flat", "cottages:wood_flat"}, + }, +}) + +cottages.derive_blocks( "cottages", "roof_vertical_shingle", "Misc shingles", "cottages_homedecor_shingles_misc_wood.png", {cracky = 2, stone = 1} ) --------------------------------------------------------------------------------------- @@ -467,7 +346,6 @@ minetest.register_node("cottages:reet", { is_ground_content = false, }) - minetest.register_craft({ output = "cottages:reet", recipe = { {cottages.craftitem_papyrus, cottages.craftitem_papyrus}, @@ -475,34 +353,4 @@ minetest.register_craft({ }, }) - - -if stairs and stairs.mod and stairs.mod == "redo" then - - stairs.register_all("reet", "cottages:reet", - {snappy = 3, choppy = 3, oddly_breakable_by_hand = 3, flammable = 3}, - {"cottages_reet.png"}, - S("Reet stair"), - S("Reet slab"), - default.node_sound_wood_defaults()) - -elseif minetest.global_exists("stairsplus") then - - stairsplus:register_all("cottages", "reet", "cottages:reet", { - description = S("Reet"), - tiles = {"cottages_reet.png"}, - groups = {snappy = 3, choppy = 3, oddly_breakable_by_hand = 3, flammable = 3}, - sounds = default.node_sound_wood_defaults(), - }) - -else - - stairs.register_stair_and_slab("reet", "cottages:reet", - {snappy = 3, choppy = 3, oddly_breakable_by_hand = 3, flammable = 3}, - {"cottages_reet.png"}, - S("Reet stair"), - S("Reet slab"), - default.node_sound_wood_defaults()) - - -end
\ No newline at end of file +cottages.derive_blocks( "cottages", "reet", "Reet", "cottages_reet.png", {snappy = 3, choppy = 3, oddly_breakable_by_hand = 3, flammable = 3} ) |