-
Notifications
You must be signed in to change notification settings - Fork 1
/
castle_grassymossynodes.lua
180 lines (162 loc) · 8.72 KB
/
castle_grassymossynodes.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
local grassymossynodes = {}
local castle_grassymossynodes_ = {}
castle_grassymossynodes_.types = {
-----Material Name Material Desc Standart tile "inv" Craft tileup tiledown tileleft tileright tilebehind tilefront
{"cobble", "Cobble", "default_cobble.png^castle_mossy_16.png^castle_grass_side_front_top_16.png", "default:cobble", nil, "default_cobble.png^castle_mossy_16.png", "default_cobble.png^castle_mossy_16.png^castle_grass_side_right_16.png", "default_cobble.png^castle_mossy_16.png^castle_grass_side_left_16.png", nil, "default_cobble.png^castle_mossy_16.png^castle_grass_side_front_16.png"},
{"dirt", "Dirt", "default_dirt.png^castle_mossy_16.png^castle_grass_side_front_top_16.png", "default:dirt", nil, "default_dirt.png^castle_mossy_16.png", "default_dirt.png^castle_mossy_16.png^castle_grass_side_right_16.png", "default_dirt.png^castle_mossy_16.png^castle_grass_side_left_16.png", nil, "default_dirt.png^castle_mossy_16.png^castle_grass_side_front_16.png"},
{"stone", "Stone", "default_stone.png^castle_mossy_16.png^castle_grass_side_front_top_16.png", "default:stone", nil, "default_stone.png^castle_mossy_16.png", "default_stone.png^castle_mossy_16.png^castle_grass_side_right_16.png", "default_stone.png^castle_mossy_16.png^castle_grass_side_left_16.png", nil, "default_stone.png^castle_mossy_16.png^castle_grass_side_front_16.png"},
{"brick", "Brick", "default_brick.png^castle_mossy_16.png^castle_grass_side_front_top_16.png", "default:brick", nil, "default_brick.png^castle_mossy_16.png", "default_brick.png^castle_mossy_16.png^castle_grass_side_right_16.png", "default_brick.png^castle_mossy_16.png^castle_grass_side_left_16.png", nil, "default_brick.png^castle_mossy_16.png^castle_grass_side_front_16.png"},
{"stonebrick", "Stone Brick", "default_stone_brick.png^castle_mossy_16.png^castle_grass_side_front_top_16.png", "default:stonebrick", nil, "default_stone_brick.png^castle_mossy_16.png", "default_stone_brick.png^castle_mossy_16.png^castle_grass_side_right_16.png", "default_stone_brick.png^castle_mossy_16.png^castle_grass_side_left_16.png", nil, "default_stone_brick.png^castle_mossy_16.png^castle_grass_side_front_16.png"},
{"coloredbrick", "Colored Brick", "color_brick.png^castle_mossy_16.png^castle_grass_side_front_top_16.png", "castle:colored_brick", nil, "color_brick.png^castle_mossy_16.png", "color_brick.png^castle_mossy_16.png^castle_grass_side_right_16.png", "color_brick.png^castle_mossy_16.png^castle_grass_side_left_16.png", nil, "color_brick.png^castle_mossy_16.png^castle_grass_side_front_16.png"},
--Castlenodes
{"stonewall", "StoneWall", "castle_stonewall.png^castle_mossy.png^castle_grass_side_front_top.png", "castle:stonewall", nil, "castle_stonewall.png^castle_mossy.png", "castle_stonewall.png^castle_mossy.png^castle_grass_side_right.png", "castle_stonewall.png^castle_mossy.png^castle_grass_side_left.png", nil, "castle_stonewall.png^castle_mossy.png^castle_grass_side_front.png"},
{"dungeon", "DungeonWall", "castle_dungeon_stone.png^castle_mossy.png^castle_grass_side_front_top.png", "castle:dungeonwall", nil, "castle_dungeon_stone.png^castle_mossy.png", "castle_dungeon_stone.png^castle_mossy.png^castle_grass_side_right.png", "castle_dungeon_stone.png^castle_mossy.png^castle_grass_side_left.png", nil, "castle_dungeon_stone.png^castle_mossy.png^castle_grass_side_front.png"},
{"cornerwall", "CornerWall", "castle_cornwall.png^castle_mossy.png^castle_grass_side_front_top.png", "castle:cornerwall", nil, "castle_cornwall.png^castle_mossy.png", "castle_cornwall.png^castle_mossy.png^castle_grass_side_right.png", "castle_cornwall.png^castle_mossy.png^castle_grass_side_left.png", nil, "castle_cornwall.png^castle_mossy.png^castle_grass_side_front.png"},
{"pavingstone", "Paving Stone", "castle_pavement_brick.png^castle_mossy.png^castle_grass_side_front_top.png", "castle:pavement", nil, "castle_pavement_brick.png^castle_mossy.png", "castle_pavement_brick.png^castle_mossy.png^castle_grass_side_right.png", "castle_pavement_brick.png^castle_mossy.png^castle_grass_side_left.png", nil, "castle_pavement_brick.png^castle_mossy.png^castle_grass_side_front.png"},
-- {"desert_stone_brick","Desert Stone Brick","default_desert_stone_brick.png","default:desertstonebrick"},
-- {"sand_stone_brick","Sand Stone Brick","default_sandstone_brick.png","default:sandstonebrick"},
-- {"tree","Tree","default_tree.png","default:tree"},
-- {"wood","Wood","default_wood.png","default:wood"},
-- {"sand_stone","Sand Stone","default_sandstone.png","default:sandstone"},
-- {"obsidian","Obsidian","default_obsidian.png","default:obsidian"},
-- {"gravel","Gravel","default_gravel.png","default:gravel"},
-- {"desertcobble","Desert Cobble","desert_cobble.png","castle:desert_cobble"},
-- {"bookshelf","Bookshelf","default_bookshelf.png","default:bookshelf"},
-- {"sand","Sand","default_sand.png","default:sand"},
-- {"desert_sand","Desert Sand","default_desert_sand.png","default:desert_sand"},
-- {"desert_stone","Desert Stone","default_desert_stone.png","default:desert-stone"},
-- {"steel","Steel","default_steel_block.png","default:steelblock"},
-- {"glass","Glass","default_glass.png","default:glass"},
}
for _, row in ipairs(castle_grassymossynodes_.types) do
local name = row[1]
local desc = row[2]
local inv = row[3] -- if alone , tile for all visible faces
local craft_logical = row[4]
local tileup = row[5]
local tiledown = row[6]
local tileleft = row[7]
local tileright = row[8]
local tilebehind = row[9]
local tilefront = row[10]
-- local alltiles -- Definition for all faces
if inv == nil
then inv = "default_dirt.png^default_grass_side.png^castle_mossy_16.png"
end
if tileup == nil
then tileup = "castle_top_grass.png"
end
if tiledown == nil
then tiledown = inv
end
if tileleft == nil
then tileleft = inv
end
if tileright == nil
then tileright = inv
end
if tilebehind == nil
then tilebehind = inv
end
if tilefront == nil
then tilefront = inv
end
local thesound = default.node_sound_dirt_defaults({footstep = {name="default_grass_footstep", gain=0.25},})
minetest.register_craft({
output = "castle:" ..name.. "_top_grassymossy",
recipe = {
{"default:cobble"},
{"default:desert_stone"},
}
})
minetest.register_node("castle:" ..name.. "_top_grassymossy", {
drawtype="drawbox",
paramtype = "light",
-- paramtype2 = "facedir",
description = "Top Mossy Grassy " ..desc,
tiles = { tileup, tiledown, inv, inv, inv, inv },
-- inventory_image = tileup,
groups = {cracky=3},
sounds = thesound ,
})
minetest.register_craft({
output = "castle:" ..name.. "_stairs_top_grassymossy",
recipe = {
{"default:cobble"},
{"default:desert_stone"},
}
})
minetest.register_node("castle:" ..name.. "_stairs_top_grassymossy", {
drawtype="nodebox",
paramtype = "light",
paramtype2 = "facedir",
description = "Top Mossy Grassy " ..desc.. " Stairs",
tiles = { tileup, tiledown, tileleft, tileright, tilebehind, tilefront },
-- inventory_image = tileup,
groups = {cracky=3},
sounds = thesound ,
node_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.5,0.5,0,0.5}, --NodeBox1
{-0.5,0,0,0.5,0.5,0.5} --NodeBox2
}
},
})
minetest.register_craft({
output = "castle:" ..name.. "_slabs_top_grassymossy",
recipe = {
{"default:cobble"},
{"default:desert_stone"},
}
})
minetest.register_node("castle:" ..name.. "_slabs_top_grassymossy", {
drawtype="nodebox",
paramtype = "light",
paramtype2 = "facedir",
description = "Top Mossy Grassy " ..desc.. " Slabs",
tiles = { tileup, tiledown, tilefront,tilefront,tilefront,tilefront },
-- inventory_image = tileup,
groups = {cracky=3},
sounds = thesound ,
node_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.5,0.5,0,0.5} --NodeBox1
}
},
})
minetest.register_node("castle:" ..name.. "_cornerstairs_top_grassymossy", {
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
description = "Top Mossy Grassy " ..desc.. " Corner Stairs",
tiles = { tileup, tiledown, tileleft, tilebehind, tilebehind, tileright },
node_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.5,0.5,-0,0.5}, --NodeBox1
{0,0,0,0.5,0.5,0.5}, --NodeBox2
{-0.5,0,-0.5,0,0.5,0.5},
}
},
groups = {cracky=3},
sounds = thesound ,
})
minetest.register_node("castle:" ..name.. "_cornerslab_top_grassymossy", {
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
description = "Top Mossy Grassy " ..desc.. " Slab Stairs",
tiles = { tileup, tiledown, tilefront, tileright, tileleft, tilefront },
node_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.5,0.5,-0,0.5}, --NodeBox1
{-0.5,0,0,0,0.5,0.5}, --NodeBox2
}
},
groups = {cracky=3},
sounds = thesound ,
})
end