1 local S
= minetest
.get_translator("columnia")
3 columnia
.registered_materials
= {}
5 function columnia
.register_all(craft
, desc
, image
, groups
, sounds
, mat
)
8 mat
= string.gsub(craft
, ":", "_")
12 desc
= minetest
.registered_items
[craft
].description
16 image
= minetest
.registered_items
[craft
].tiles
[1]
20 groups
= table.copy(minetest
.registered_items
[craft
].groups
)
22 groups
.not_in_creative_inventory
= 1
28 sounds
= minetest
.registered_items
[craft
].sounds
31 local on_place
= function(itemstack
, placer
, pointed_thing
)
32 if pointed_thing
.type ~= "node" then
36 local p0
= pointed_thing
.under
37 local p1
= pointed_thing
.above
40 local placer_pos
= placer
:get_pos()
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
)
50 if p0
.y
-1 == p1
.y
then
54 elseif param2
== 23 then
59 return minetest
.item_place(itemstack
, placer
, pointed_thing
, param2
)
62 columnia
.registered_materials
[craft
] = mat
64 minetest
.register_node("columnia:column_mid_"..mat
, {
65 description
= S("@1 Column", desc
),
69 paramtype2
= "facedir",
70 sunlight_propagates
= true,
71 is_ground_content
= false,
76 {-0.25, -0.5, -0.25, 0.25, 0.5, 0.25},
84 minetest
.register_node("columnia:column_top_"..mat
, {
85 description
= S("@1 Column Top", desc
),
89 paramtype2
= "facedir",
90 sunlight_propagates
= true,
91 is_ground_content
= false,
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},
102 on_rotate
= "simple",
106 minetest
.register_node("columnia:column_bottom_"..mat
, {
107 description
= S("@1 Column Bottom", desc
),
108 drawtype
= "nodebox",
111 paramtype2
= "facedir",
112 sunlight_propagates
= true,
113 is_ground_content
= false,
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},
124 on_rotate
= "simple",
128 minetest
.register_node("columnia:column_crosslink_"..mat
, {
129 description
= S("@1 Column Crosslink", desc
),
130 drawtype
= "nodebox",
133 paramtype2
= "facedir",
134 sunlight_propagates
= true,
135 is_ground_content
= false,
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},
147 on_rotate
= "simple",
151 minetest
.register_node("columnia:column_link_"..mat
, {
152 description
= S("@1 Column Link", desc
),
153 drawtype
= "nodebox",
156 paramtype2
= "facedir",
157 sunlight_propagates
= true,
158 is_ground_content
= false,
163 {-0.25, 0, -0.5, 0.25, 0.5, 0.5},
167 on_rotate
= "simple",
171 minetest
.register_node("columnia:column_linkdown_"..mat
, {
172 description
= S("@1 Column Link Down", desc
),
173 drawtype
= "nodebox",
176 paramtype2
= "facedir",
177 sunlight_propagates
= true,
178 is_ground_content
= false,
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},
190 on_rotate
= "simple",
194 minetest
.register_node("columnia:column_linkcross_"..mat
, {
195 description
= S("@1 Column Link Cross", desc
),
196 drawtype
= "nodebox",
199 paramtype2
= "facedir",
200 sunlight_propagates
= true,
201 is_ground_content
= false,
206 {-0.25, 0, -0.5, 0.25, 0.5, 0.5},
207 {-0.5, 0, -0.25, 0.5, 0.5, 0.25},
211 on_rotate
= "simple",
215 minetest
.register_node("columnia:column_linkcrossdown_"..mat
, {
216 description
= S("@1 Column Link Cross Down", desc
),
217 drawtype
= "nodebox",
220 paramtype2
= "facedir",
221 sunlight_propagates
= true,
222 is_ground_content
= false,
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},
235 on_rotate
= "simple",
239 minetest
.register_node("columnia:column_linkvertical_"..mat
, {
240 description
= S("@1 Column Link Vertical", desc
),
241 drawtype
= "nodebox",
244 paramtype2
= "facedir",
245 sunlight_propagates
= true,
246 is_ground_content
= false,
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},
259 on_rotate
= "simple",
263 minetest
.register_node("columnia:column_linkangle_"..mat
, {
264 description
= S("@1 Column Link Corner", desc
),
265 drawtype
= "nodebox",
268 paramtype2
= "facedir",
269 sunlight_propagates
= true,
270 is_ground_content
= false,
275 {-0.25, 0, -0.25, 0.25, 0.5, 0.5},
276 {0.25, 0, -0.25, 0.5, 0.5, 0.25},
280 on_rotate
= "simple",
284 minetest
.register_node("columnia:column_linkangle_down_"..mat
, {
285 description
= S("@1 Column Link Corner Down", desc
),
286 drawtype
= "nodebox",
289 paramtype2
= "facedir",
290 sunlight_propagates
= true,
291 is_ground_content
= false,
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},
304 on_rotate
= "simple",
308 minetest
.register_node("columnia:column_linktee_"..mat
, {
309 description
= S("@1 Column Link T-Form", desc
),
310 drawtype
= "nodebox",
313 paramtype2
= "facedir",
314 sunlight_propagates
= true,
315 is_ground_content
= false,
320 {-0.25, 0, -0.5, 0.25, 0.5, 0.5},
321 {0.25, 0, -0.25, 0.5, 0.5, 0.25},
325 on_rotate
= "simple",
329 minetest
.register_node("columnia:column_linktee_down_"..mat
, {
330 description
= S("@1 Column Link T-Form Down", desc
),
331 drawtype
= "nodebox",
334 paramtype2
= "facedir",
335 sunlight_propagates
= true,
336 is_ground_content
= false,
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},
349 on_rotate
= "simple",
353 minetest
.register_node("columnia:column_stairsub_"..mat
, {
354 description
= desc
.." Stair Substructure",
355 drawtype
= "nodebox",
358 paramtype2
= "facedir",
359 --sunlight_propagates = true,
360 is_ground_content
= false,
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},
384 on_rotate
= "simple",
388 minetest
.register_node("columnia:column_stairsubpillar_"..mat
, {
389 description
= desc
.." Stair Substructure Pillar",
390 drawtype
= "nodebox",
393 paramtype2
= "facedir",
394 --sunlight_propagates = true,
395 is_ground_content
= false,
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},
420 on_rotate
= "simple",