-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathethereal.lua
202 lines (187 loc) · 5.47 KB
/
ethereal.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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
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 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 moretrees_slopes = { --Material , Description , Item, Image
{"willow" , "Willow Wood" , "ethereal:willow_wood", "ethereal_willow"},
{"redwood", "RedWood Wood", "ethereal:redwood_wood", "ethereal_redwood"},
{"frost", "Frost Wood", "ethereal:frost_wood", "ethereal_frost"},
{"yellow", "Healing Tree Wood", "ethereal:yellow_wood", "ethereal_yellow"},
{"palm", "Palm Wood", "ethereal:palm_wood", "moretrees_palm"},
{"banana", "Banana Wood", "ethereal:banana_wood", "ethereal_banana"},
{"birch", "Birch Wood", "ethereal:birch_wood", "moretrees_birch"},
}
for i in ipairs(moretrees_slopes) do
local mat = moretrees_slopes[i][1]
local desc = moretrees_slopes[i][2]
local item = moretrees_slopes[i][3]
local img = moretrees_slopes[i][4]
--slope
minetest.register_node("mywoodslopes:"..mat.."_slope", {
description = desc.." Slope",
drawtype = "mesh",
mesh = "twelve-twelve.obj",
tiles = {img.."_wood.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
})
--icorner
minetest.register_node("mywoodslopes:"..mat.."_icorner", {
description = desc.." Slope Inside Corner",
drawtype = "mesh",
mesh = "twelve-twelve-ic.obj",
tiles = {img.."_wood.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
})
--ocorner
minetest.register_node("mywoodslopes:"..mat.."_ocorner", {
description = desc.." Slope Outside Corner",
drawtype = "mesh",
mesh = "twelve-twelve-oc.obj",
tiles = {img.."_wood.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
})
--rotated---------------------------------------------------------------
--slope
minetest.register_node("mywoodslopes:"..mat.."_slope_r", {
description = desc.." Slope Rotated",
drawtype = "mesh",
mesh = "twelve-twelve.obj",
tiles = {img.."_wood.png^[transformR90"},
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
})
--icorner
minetest.register_node("mywoodslopes:"..mat.."_icorner_r", {
description = desc.." Slope Inside Corner Rotate",
drawtype = "mesh",
mesh = "twelve-twelve-ic.obj",
tiles = {img.."_wood.png^[transformR90"},
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
})
--ocorner
minetest.register_node("mywoodslopes:"..mat.."_ocorner_r", {
description = desc.." Slope Outside Corner Rotated",
drawtype = "mesh",
mesh = "twelve-twelve-oc.obj",
tiles = {img.."_wood.png^[transformR90"},
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
})
--Crafts--------------------------------------------------------
--slope
minetest.register_craft({
output = "mywoodslopes:"..mat.."_slope 3",
recipe = {
{"", "",""},
{item, "",""},
{item, item,""},
}
})
--slope icorner
minetest.register_craft({
output = "mywoodslopes:"..mat.."_icorner 3",
recipe = {
{"", "",""},
{"", item,""},
{item,"", item},
}
})
--slope ocorner
minetest.register_craft({
output = "mywoodslopes:"..mat.."_ocorner 3",
recipe = {
{"", "",""},
{item, "",item},
{"", item,""},
}
})
--rotated-----------------------------------------------
--slope
minetest.register_craft({
output = "mywoodslopes:"..mat.."_slope_r 1",
recipe = {
{"", "",""},
{"", "mywoodslopes:"..mat.."_slope",""},
{"", "",""},
}
})
--slope icorner
minetest.register_craft({
output = "mywoodslopes:"..mat.."_icorner_r 1",
recipe = {
{"", "",""},
{"", "mywoodslopes:"..mat.."_icorner",""},
{"", "",""},
}
})
--slope ocorner
minetest.register_craft({
output = "mywoodslopes:"..mat.."_ocorner_r 1",
recipe = {
{"", "",""},
{"", "mywoodslopes:"..mat.."_ocorner",""},
{"", "",""},
}
})
--]]
end