Import source (dev state between 1.2.0 and 1.3.0)
[minetest_tutorial_subgame.git] / mods / cottages / nodes_roof.lua
blob8a2910308fa054d86ea9f26c1f3ad290c198f240
3 ---------------------------------------------------------------------------------------
4 -- roof parts
5 ---------------------------------------------------------------------------------------
6 -- a better roof than the normal stairs; can be replaced by stairs:stair_wood
9 -- create the three basic roof parts plus receipes for them;
10 cottages.register_roof = function( name, tiles, basic_material, homedecor_alternative )
12 minetest.register_node("cottages:roof_"..name, {
13 description = "Roof "..name,
14 drawtype = "nodebox",
15 --tiles = {"default_tree.png","default_wood.png","default_wood.png","default_wood.png","default_wood.png","default_tree.png"},
16 tiles = tiles,
17 paramtype = "light",
18 paramtype2 = "facedir",
19 is_ground_content = true,
20 groups = {immortal=1},
21 node_box = {
22 type = "fixed",
23 fixed = {
24 {-0.5, -0.5, -0.5, 0.5, 0, 0},
25 {-0.5, 0, 0, 0.5, 0.5, 0.5},
28 selection_box = {
29 type = "fixed",
30 fixed = {
31 {-0.5, -0.5, -0.5, 0.5, 0, 0},
32 {-0.5, 0, 0, 0.5, 0.5, 0.5},
35 sounds = default.node_sound_wood_defaults()
38 -- a better roof than the normal stairs; this one is for usage directly on top of walls (it has the form of a stair)
39 minetest.register_node("cottages:roof_connector_"..name, {
40 description = "Roof connector "..name,
41 drawtype = "nodebox",
42 -- top, bottom, side1, side2, inner, outer
43 --tiles = {"default_tree.png","default_wood.png","default_tree.png","default_tree.png","default_wood.png","default_tree.png"},
44 --tiles = {"darkage_straw.png","default_wood.png","darkage_straw.png","darkage_straw.png","darkage_straw.png","darkage_straw.png"},
45 tiles = tiles,
46 paramtype = "light",
47 paramtype2 = "facedir",
48 is_ground_content = true,
49 groups = {immortal=1},
50 node_box = {
51 type = "fixed",
52 fixed = {
53 {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
54 {-0.5, 0, 0, 0.5, 0.5, 0.5},
57 selection_box = {
58 type = "fixed",
59 fixed = {
60 {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
61 {-0.5, 0, 0, 0.5, 0.5, 0.5},
64 sounds = default.node_sound_wood_defaults()
67 -- this one is the slab version of the above roof
68 minetest.register_node("cottages:roof_flat_"..name, {
69 description = "Roof (flat) "..name,
70 drawtype = "nodebox",
71 -- top, bottom, side1, side2, inner, outer
72 --tiles = {"default_tree.png","default_wood.png","default_tree.png","default_tree.png","default_wood.png","default_tree.png"},
73 -- this one is from all sides - except from the underside - of the given material
74 tiles = { tiles[1], tiles[2], tiles[1], tiles[1], tiles[1], tiles[1] };
75 paramtype = "light",
76 paramtype2 = "facedir",
77 is_ground_content = true,
78 groups = {immortal=1},
79 node_box = {
80 type = "fixed",
81 fixed = {
82 {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
85 selection_box = {
86 type = "fixed",
87 fixed = {
88 {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
91 sounds = default.node_sound_wood_defaults()
95 end -- of cottages.register_roof( name, tiles, basic_material )
100 ---------------------------------------------------------------------------------------
101 -- add the diffrent roof types
102 ---------------------------------------------------------------------------------------
103 cottages.register_roof( 'black',
104 {"cottages_homedecor_shingles_asphalt.png","default_wood.png","default_wood.png","default_wood.png","default_wood.png","cottages_homedecor_shingles_asphalt.png"},
105 'homedecor:shingles_asphalt', 'default:coal_lump');
106 cottages.register_roof( 'red',
107 {"cottages_homedecor_shingles_terracotta.png","default_wood.png","default_wood.png","default_wood.png","default_wood.png","cottages_homedecor_shingles_terracotta.png"},
108 'homedecor:shingles_terracotta', 'default:clay_brick');