Don't spawn vines on group:leafdecay
[minetest_hades/hades_revisited.git] / mods / columnia / columnia.lua
blobde19772bc9222cf157bf9cac19e320cc97420cd8
1 local S = minetest.get_translator("columnia")
3 columnia.registered_materials = {}
5 function columnia.register_all(craft, desc, image, groups, sounds, mat)
7 if not mat then
8 mat = string.gsub(craft, ":", "_")
9 end
11 if not desc then
12 desc = minetest.registered_items[craft].description
13 end
15 if not image then
16 image = minetest.registered_items[craft].tiles[1]
17 end
19 if not groups then
20 groups = table.copy(minetest.registered_items[craft].groups)
21 end
22 groups.not_in_creative_inventory = 1
23 groups.wood = nil
24 groups.wool = nil
25 groups.stone = nil
27 if not sounds then
28 sounds = minetest.registered_items[craft].sounds
29 end
31 local on_place = function(itemstack, placer, pointed_thing)
32 if pointed_thing.type ~= "node" then
33 return itemstack
34 end
36 local p0 = pointed_thing.under
37 local p1 = pointed_thing.above
38 local param2 = 0
40 local placer_pos = placer:get_pos()
41 if placer_pos then
42 local dir = {
43 x = p1.x - placer_pos.x,
44 y = p1.y - placer_pos.y,
45 z = p1.z - placer_pos.z
47 param2 = minetest.dir_to_facedir(dir)
48 end
50 if p0.y-1 == p1.y then
51 param2 = param2 + 20
52 if param2 == 21 then
53 param2 = 23
54 elseif param2 == 23 then
55 param2 = 21
56 end
57 end
59 return minetest.item_place(itemstack, placer, pointed_thing, param2)
60 end
62 columnia.registered_materials[craft] = mat
64 minetest.register_node("columnia:column_mid_"..mat, {
65 description = S("@1 Column", desc),
66 drawtype = "nodebox",
67 tiles = {image},
68 paramtype = "light",
69 paramtype2 = "facedir",
70 sunlight_propagates = true,
71 is_ground_content = false,
72 groups = groups,
73 node_box = {
74 type = "fixed",
75 fixed = {
76 {-0.25, -0.5, -0.25, 0.25, 0.5, 0.25},
79 on_place = on_place,
80 on_rotate = "simple",
81 sounds = sounds,
84 minetest.register_node("columnia:column_top_"..mat, {
85 description = S("@1 Column Top", desc),
86 drawtype = "nodebox",
87 tiles = {image},
88 paramtype = "light",
89 paramtype2 = "facedir",
90 sunlight_propagates = true,
91 is_ground_content = false,
92 groups = groups,
93 node_box = {
94 type = "fixed",
95 fixed = {
96 {-0.25, -0.5, -0.25, 0.25, 0.5, 0.25},
97 {-0.5, 0.25, -0.5, 0.5, 0.5, 0.5},
98 {-0.375, 0, -0.375, 0.375, 0.5, 0.375},
101 on_place = on_place,
102 on_rotate = "simple",
103 sounds = sounds,
106 minetest.register_node("columnia:column_bottom_"..mat, {
107 description = S("@1 Column Bottom", desc),
108 drawtype = "nodebox",
109 tiles = {image},
110 paramtype = "light",
111 paramtype2 = "facedir",
112 sunlight_propagates = true,
113 is_ground_content = false,
114 groups = groups,
115 node_box = {
116 type = "fixed",
117 fixed = {
118 {-0.25, -0.5, -0.25, 0.25, 0.5, 0.25},
119 {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
120 {-0.375, -0.5, -0.375, 0.375, 0, 0.375},
123 on_place = on_place,
124 on_rotate = "simple",
125 sounds = sounds,
128 minetest.register_node("columnia:column_crosslink_"..mat, {
129 description = S("@1 Column Crosslink", desc),
130 drawtype = "nodebox",
131 tiles = {image},
132 paramtype = "light",
133 paramtype2 = "facedir",
134 sunlight_propagates = true,
135 is_ground_content = false,
136 groups = groups,
137 node_box = {
138 type = "fixed",
139 fixed = {
140 {-0.25, -0.5, -0.25, 0.25, 0.5, 0.25},
141 {-0.5, 0, -0.25, 0.5, 0.5, 0.25},
142 {-0.25, 0, -0.5, 0.25, 0.5, 0.5},
143 {-0.4375, 0.0625, -0.4375, 0.4375, 0.4375, 0.4375},
146 on_place = on_place,
147 on_rotate = "simple",
148 sounds = sounds,
151 minetest.register_node("columnia:column_link_"..mat, {
152 description = S("@1 Column Link", desc),
153 drawtype = "nodebox",
154 tiles = {image},
155 paramtype = "light",
156 paramtype2 = "facedir",
157 sunlight_propagates = true,
158 is_ground_content = false,
159 groups = groups,
160 node_box = {
161 type = "fixed",
162 fixed = {
163 {-0.25, 0, -0.5, 0.25, 0.5, 0.5},
166 on_place = on_place,
167 on_rotate = "simple",
168 sounds = sounds,
171 minetest.register_node("columnia:column_linkdown_"..mat, {
172 description = S("@1 Column Link Down", desc),
173 drawtype = "nodebox",
174 tiles = {image},
175 paramtype = "light",
176 paramtype2 = "facedir",
177 sunlight_propagates = true,
178 is_ground_content = false,
179 groups = groups,
180 node_box = {
181 type = "fixed",
182 fixed = {
183 {-0.25, 0, -0.5, 0.25, 0.5, 0.5},
184 {-0.125, -0.5, -0.125, 0.125, 0, 0.125},
185 {-0.1875, -0.5, -0.1875, 0.1875, -0.375, 0.1875},
186 {-0.1875, -0.125, -0.1875, 0.1875, 0, 0.1875},
189 on_place = on_place,
190 on_rotate = "simple",
191 sounds = sounds,
194 minetest.register_node("columnia:column_linkcross_"..mat, {
195 description = S("@1 Column Link Cross", desc),
196 drawtype = "nodebox",
197 tiles = {image},
198 paramtype = "light",
199 paramtype2 = "facedir",
200 sunlight_propagates = true,
201 is_ground_content = false,
202 groups = groups,
203 node_box = {
204 type = "fixed",
205 fixed = {
206 {-0.25, 0, -0.5, 0.25, 0.5, 0.5},
207 {-0.5, 0, -0.25, 0.5, 0.5, 0.25},
210 on_place = on_place,
211 on_rotate = "simple",
212 sounds = sounds,
215 minetest.register_node("columnia:column_linkcrossdown_"..mat, {
216 description = S("@1 Column Link Cross Down", desc),
217 drawtype = "nodebox",
218 tiles = {image},
219 paramtype = "light",
220 paramtype2 = "facedir",
221 sunlight_propagates = true,
222 is_ground_content = false,
223 groups = groups,
224 node_box = {
225 type = "fixed",
226 fixed = {
227 {-0.25, 0, -0.5, 0.25, 0.5, 0.5},
228 {-0.5, 0, -0.25, 0.5, 0.5, 0.25},
229 {-0.1875, -0.125, -0.1875, 0.1875, 0, 0.1875},
230 {-0.1875, -0.5, -0.1875, 0.1875, -0.375, 0.1875},
231 {-0.125, -0.375, -0.125, 0.125, -0.125, 0.125},
234 on_place = on_place,
235 on_rotate = "simple",
236 sounds = sounds,
239 minetest.register_node("columnia:column_linkvertical_"..mat, {
240 description = S("@1 Column Link Vertical", desc),
241 drawtype = "nodebox",
242 tiles = {image},
243 paramtype = "light",
244 paramtype2 = "facedir",
245 sunlight_propagates = true,
246 is_ground_content = false,
247 groups = groups,
248 node_box = {
249 type = "fixed",
250 fixed = {
251 {-0.1875, 0.375, -0.1875, 0.1875, 0.5, 0.1875},
252 {-0.125, -0.375, -0.125, 0.125, -0.125, 0.125},
253 {-0.1875, -0.125, -0.1875, 0.1875, 0.125, 0.1875},
254 {-0.1875, -0.5, -0.1875, 0.1875, -0.375, 0.1875},
255 {-0.125, 0.125, -0.125, 0.125, 0.375, 0.125},
258 on_place = on_place,
259 on_rotate = "simple",
260 sounds = sounds,
263 minetest.register_node("columnia:column_linkangle_"..mat, {
264 description = S("@1 Column Link Corner", desc),
265 drawtype = "nodebox",
266 tiles = {image},
267 paramtype = "light",
268 paramtype2 = "facedir",
269 sunlight_propagates = true,
270 is_ground_content = false,
271 groups = groups,
272 node_box = {
273 type = "fixed",
274 fixed = {
275 {-0.25, 0, -0.25, 0.25, 0.5, 0.5},
276 {0.25, 0, -0.25, 0.5, 0.5, 0.25},
279 on_place = on_place,
280 on_rotate = "simple",
281 sounds = sounds,
284 minetest.register_node("columnia:column_linkangle_down_"..mat, {
285 description = S("@1 Column Link Corner Down", desc),
286 drawtype = "nodebox",
287 tiles = {image},
288 paramtype = "light",
289 paramtype2 = "facedir",
290 sunlight_propagates = true,
291 is_ground_content = false,
292 groups = groups,
293 node_box = {
294 type = "fixed",
295 fixed = {
296 {-0.25, 0, -0.25, 0.25, 0.5, 0.5},
297 {0.25, 0, -0.25, 0.5, 0.5, 0.25},
298 {-0.1875, -0.125, -0.1875, 0.1875, 0, 0.1875},
299 {-0.1875, -0.5, -0.1875, 0.1875, -0.375, 0.1875},
300 {-0.125, -0.375, -0.125, 0.125, -0.125, 0.125},
303 on_place = on_place,
304 on_rotate = "simple",
305 sounds = sounds,
308 minetest.register_node("columnia:column_linktee_"..mat, {
309 description = S("@1 Column Link T-Form", desc),
310 drawtype = "nodebox",
311 tiles = {image},
312 paramtype = "light",
313 paramtype2 = "facedir",
314 sunlight_propagates = true,
315 is_ground_content = false,
316 groups = groups,
317 node_box = {
318 type = "fixed",
319 fixed = {
320 {-0.25, 0, -0.5, 0.25, 0.5, 0.5},
321 {0.25, 0, -0.25, 0.5, 0.5, 0.25},
324 on_place = on_place,
325 on_rotate = "simple",
326 sounds = sounds,
329 minetest.register_node("columnia:column_linktee_down_"..mat, {
330 description = S("@1 Column Link T-Form Down", desc),
331 drawtype = "nodebox",
332 tiles = {image},
333 paramtype = "light",
334 paramtype2 = "facedir",
335 sunlight_propagates = true,
336 is_ground_content = false,
337 groups = groups,
338 node_box = {
339 type = "fixed",
340 fixed = {
341 {-0.25, 0, -0.5, 0.25, 0.5, 0.5},
342 {0.25, 0, -0.25, 0.5, 0.5, 0.25},
343 {-0.1875, -0.125, -0.1875, 0.1875, 0, 0.1875},
344 {-0.1875, -0.5, -0.1875, 0.1875, -0.375, 0.1875},
345 {-0.125, -0.375, -0.125, 0.125, -0.125, 0.125},
348 on_place = on_place,
349 on_rotate = "simple",
350 sounds = sounds,
353 minetest.register_node("columnia:column_stairsub_"..mat, {
354 description = desc.." Stair Substructure",
355 drawtype = "nodebox",
356 tiles = {image},
357 paramtype = "light",
358 paramtype2 = "facedir",
359 --sunlight_propagates = true,
360 is_ground_content = false,
361 groups = groups,
362 node_box = {
363 type = "fixed",
364 fixed = {
365 {-0.5, 0.4375, -0.5, 0.5, 0.5, 0.5},
366 {-0.5, -0.5, 0.4375, 0.5, 0.4375, 0.5},
367 {-0.5, -0.4375, 0.375, 0.5, 0.4375, 0.4375},
368 {-0.5, -0.375, 0.3125, 0.5, 0.4375, 0.375},
369 {-0.5, -0.3125, 0.25, 0.5, 0.4375, 0.3125},
370 {-0.5, -0.25, 0.1875, 0.5, 0.4375, 0.25},
371 {-0.5, -0.1875, 0.125, 0.5, 0.4375, 0.1875},
372 {-0.5, -0.125, 0.0625, 0.5, 0.4375, 0.125},
373 {-0.5, -0.0625, 0, 0.5, 0.4375, 0.0625},
374 {-0.5, 0, -0.0625, 0.5, 0.4375, 0},
375 {-0.5, 0.0625, -0.125, 0.5, 0.4375, -0.0625},
376 {-0.5, 0.125, -0.1875, 0.5, 0.4375, -0.125},
377 {-0.5, 0.1875, -0.25, 0.5, 0.4375, -0.1875},
378 {-0.5, 0.25, -0.3125, 0.5, 0.4375, -0.25},
379 {-0.5, 0.3125, -0.375, 0.5, 0.4375, -0.3125},
380 {-0.5, 0.375, -0.4375, 0.5, 0.4375, -0.375},
383 on_place = on_place,
384 on_rotate = "simple",
385 sounds = sounds,
388 minetest.register_node("columnia:column_stairsubpillar_"..mat, {
389 description = desc.." Stair Substructure Pillar",
390 drawtype = "nodebox",
391 tiles = {image},
392 paramtype = "light",
393 paramtype2 = "facedir",
394 --sunlight_propagates = true,
395 is_ground_content = false,
396 groups = groups,
397 node_box = {
398 type = "fixed",
399 fixed = {
400 {-0.5, 0.4375, -0.5, 0.5, 0.5, 0.5},
401 {-0.5, -0.5, 0.4375, 0.5, 0.4375, 0.5},
402 {-0.5, -0.4375, 0.375, 0.5, 0.4375, 0.4375},
403 {-0.5, -0.375, 0.3125, 0.5, 0.4375, 0.375},
404 {-0.5, -0.3125, 0.25, 0.5, 0.4375, 0.3125},
405 {-0.5, -0.25, 0.1875, 0.5, 0.4375, 0.25},
406 {-0.5, -0.1875, 0.125, 0.5, 0.4375, 0.1875},
407 {-0.5, -0.125, 0.0625, 0.5, 0.4375, 0.125},
408 {-0.5, -0.0625, 0, 0.5, 0.4375, 0.0625},
409 {-0.5, 0, -0.0625, 0.5, 0.4375, 0},
410 {-0.5, 0.0625, -0.125, 0.5, 0.4375, -0.0625},
411 {-0.5, 0.125, -0.1875, 0.5, 0.4375, -0.125},
412 {-0.5, 0.1875, -0.25, 0.5, 0.4375, -0.1875},
413 {-0.5, 0.25, -0.3125, 0.5, 0.4375, -0.25},
414 {-0.5, 0.3125, -0.375, 0.5, 0.4375, -0.3125},
415 {-0.5, 0.375, -0.4375, 0.5, 0.4375, -0.375},
416 {-0.25, -0.5, -0.25, 0.25, 0.4375, 0.25},
419 on_place = on_place,
420 on_rotate = "simple",
421 sounds = sounds,