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
26 groups
.claybricks
= nil
30 sounds
= minetest
.registered_items
[craft
].sounds
33 local on_place
= function(itemstack
, placer
, pointed_thing
)
34 if pointed_thing
.type ~= "node" then
38 local p0
= pointed_thing
.under
39 local p1
= pointed_thing
.above
42 local placer_pos
= placer
:get_pos()
45 x
= p1
.x
- placer_pos
.x
,
46 y
= p1
.y
- placer_pos
.y
,
47 z
= p1
.z
- placer_pos
.z
49 param2
= minetest
.dir_to_facedir(dir
)
52 if p0
.y
-1 == p1
.y
then
56 elseif param2
== 23 then
61 return minetest
.item_place(itemstack
, placer
, pointed_thing
, param2
)
64 columnia
.registered_materials
[craft
] = mat
66 -- Make it a world-aligned tile if align_style is not set
68 if type(image
) == "table" then
69 tile
= table.copy(image
)
70 if tile
.align_style
== nil then
71 tile
.align_style
= "world"
74 tile
= { name
= image
, align_style
= "world" }
78 minetest
.register_node("columnia:column_mid_"..mat
, {
79 description
= S("@1 Column", desc
),
83 paramtype2
= "facedir",
84 sunlight_propagates
= true,
85 is_ground_content
= false,
90 {-0.25, -0.5, -0.25, 0.25, 0.5, 0.25},
96 _hades_shaper_next
= "columnia:column_top_"..mat
,
99 local mod_screwdriver
= minetest
.get_modpath("screwdriver")
100 local on_rotate_column_top
, on_rotate_column_bottom
101 if mod_screwdriver
then
102 on_rotate_column_top
= function(pos
, node
, user
, mode
, new_param2
)
103 if mode
== screwdriver
.ROTATE_AXIS
then
104 node
.name
= "columnia:column_bottom_"..mat
105 minetest
.swap_node(pos
, node
)
109 on_rotate_column_bottom
= function(pos
, node
, user
, mode
, new_param2
)
110 if mode
== screwdriver
.ROTATE_AXIS
then
111 node
.name
= "columnia:column_top_"..mat
112 minetest
.swap_node(pos
, node
)
118 minetest
.register_node("columnia:column_top_"..mat
, {
119 description
= S("@1 Column Top", desc
),
120 drawtype
= "nodebox",
123 paramtype2
= "facedir",
124 sunlight_propagates
= true,
125 is_ground_content
= false,
130 {-0.25, -0.5, -0.25, 0.25, 0, 0.25},
131 {-0.375, 0, -0.375, 0.375, 0.25, 0.375},
132 {-0.5, 0.25, -0.5, 0.5, 0.5, 0.5},
136 on_rotate
= on_rotate_column_top
,
138 _hades_shaper_next
= "columnia:column_bottom_"..mat
,
141 minetest
.register_node("columnia:column_bottom_"..mat
, {
142 description
= S("@1 Column Bottom", desc
),
143 drawtype
= "nodebox",
146 paramtype2
= "facedir",
147 sunlight_propagates
= true,
148 is_ground_content
= false,
153 {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
154 {-0.375, -0.25, -0.375, 0.375, 0, 0.375},
155 {-0.25, 0, -0.25, 0.25, 0.5, 0.25},
159 on_rotate
= on_rotate_column_bottom
,
161 _hades_shaper_next
= "columnia:column_mid_"..mat
,
164 minetest
.register_node("columnia:column_crosslink_"..mat
, {
165 description
= S("@1 Column Crosslink", desc
),
166 drawtype
= "nodebox",
169 paramtype2
= "facedir",
170 sunlight_propagates
= true,
171 is_ground_content
= false,
176 {-0.25, -0.5, -0.25, 0.25, 0.5, 0.25},
177 {-0.5, 0, -0.25, 0.5, 0.5, 0.25},
178 {-0.25, 0, -0.5, 0.25, 0.5, 0.5},
179 {-0.4375, 0.0625, -0.4375, 0.4375, 0.4375, 0.4375},
183 on_rotate
= "simple",
187 minetest
.register_node("columnia:column_link_"..mat
, {
188 description
= S("@1 Column Link", desc
),
189 drawtype
= "nodebox",
192 paramtype2
= "facedir",
193 sunlight_propagates
= true,
194 is_ground_content
= false,
199 {-0.5, 0, -0.25, 0.5, 0.5, 0.25},
203 on_rotate
= "simple",
205 _hades_shaper_next
= "columnia:column_linktee_"..mat
,
208 minetest
.register_node("columnia:column_linkdown_"..mat
, {
209 description
= S("@1 Column Link Down", desc
),
210 drawtype
= "nodebox",
213 paramtype2
= "facedir",
214 sunlight_propagates
= true,
215 is_ground_content
= false,
220 {-0.5, 0, -0.25, 0.5, 0.5, 0.25},
221 {-0.125, -0.5, -0.125, 0.125, 0, 0.125},
222 {-0.1875, -0.5, -0.1875, 0.1875, -0.375, 0.1875},
223 {-0.1875, -0.125, -0.1875, 0.1875, 0, 0.1875},
227 on_rotate
= "simple",
229 _hades_shaper_next
= "columnia:column_linktee_down_"..mat
,
232 minetest
.register_node("columnia:column_linkcross_"..mat
, {
233 description
= S("@1 Column Link Cross", desc
),
234 drawtype
= "nodebox",
237 paramtype2
= "facedir",
238 sunlight_propagates
= true,
239 is_ground_content
= false,
244 {-0.25, 0, -0.5, 0.25, 0.5, 0.5},
245 {-0.5, 0, -0.25, 0.5, 0.5, 0.25},
249 on_rotate
= "simple",
251 _hades_shaper_next
= "columnia:column_linkangle_"..mat
,
254 minetest
.register_node("columnia:column_linkcrossdown_"..mat
, {
255 description
= S("@1 Column Link Cross Down", desc
),
256 drawtype
= "nodebox",
259 paramtype2
= "facedir",
260 sunlight_propagates
= true,
261 is_ground_content
= false,
266 {-0.25, 0, -0.5, 0.25, 0.5, 0.5},
267 {-0.5, 0, -0.25, 0.5, 0.5, 0.25},
268 {-0.1875, -0.125, -0.1875, 0.1875, 0, 0.1875},
269 {-0.1875, -0.5, -0.1875, 0.1875, -0.375, 0.1875},
270 {-0.125, -0.375, -0.125, 0.125, -0.125, 0.125},
274 on_rotate
= "simple",
276 _hades_shaper_next
= "columnia:column_linkangle_down_"..mat
,
279 minetest
.register_node("columnia:column_linkvertical_"..mat
, {
280 description
= S("@1 Column Link Vertical", desc
),
281 drawtype
= "nodebox",
284 paramtype2
= "facedir",
285 sunlight_propagates
= true,
286 is_ground_content
= false,
291 {-0.1875, 0.375, -0.1875, 0.1875, 0.5, 0.1875},
292 {-0.125, -0.375, -0.125, 0.125, -0.125, 0.125},
293 {-0.1875, -0.125, -0.1875, 0.1875, 0.125, 0.1875},
294 {-0.1875, -0.5, -0.1875, 0.1875, -0.375, 0.1875},
295 {-0.125, 0.125, -0.125, 0.125, 0.375, 0.125},
299 on_rotate
= "simple",
303 minetest
.register_node("columnia:column_linkangle_"..mat
, {
304 description
= S("@1 Column Link Corner", desc
),
305 drawtype
= "nodebox",
308 paramtype2
= "facedir",
309 sunlight_propagates
= true,
310 is_ground_content
= false,
315 {-0.25, 0, -0.25, 0.5, 0.5, 0.25},
316 {-0.25, 0, -0.5, 0.25, 0.5, -0.25},
320 on_rotate
= "simple",
322 _hades_shaper_next
= "columnia:column_link_"..mat
,
325 minetest
.register_node("columnia:column_linkangle_down_"..mat
, {
326 description
= S("@1 Column Link Corner Down", desc
),
327 drawtype
= "nodebox",
330 paramtype2
= "facedir",
331 sunlight_propagates
= true,
332 is_ground_content
= false,
337 {-0.25, 0, -0.25, 0.5, 0.5, 0.25},
338 {-0.25, 0, -0.5, 0.25, 0.5, -0.25},
339 {-0.1875, -0.125, -0.1875, 0.1875, 0, 0.1875},
340 {-0.1875, -0.5, -0.1875, 0.1875, -0.375, 0.1875},
341 {-0.125, -0.375, -0.125, 0.125, -0.125, 0.125},
345 on_rotate
= "simple",
347 _hades_shaper_next
= "columnia:column_linkdown_"..mat
,
350 minetest
.register_node("columnia:column_linktee_"..mat
, {
351 description
= S("@1 Column Link T-Form", desc
),
352 drawtype
= "nodebox",
355 paramtype2
= "facedir",
356 sunlight_propagates
= true,
357 is_ground_content
= false,
362 {-0.5, 0, -0.25, 0.5, 0.5, 0.25},
363 {-0.25, 0, -0.5, 0.25, 0.5, -0.25},
367 on_rotate
= "simple",
369 _hades_shaper_next
= "columnia:column_linkcross_"..mat
,
372 minetest
.register_node("columnia:column_linktee_down_"..mat
, {
373 description
= S("@1 Column Link T-Form Down", desc
),
374 drawtype
= "nodebox",
377 paramtype2
= "facedir",
378 sunlight_propagates
= true,
379 is_ground_content
= false,
384 {-0.5, 0, -0.25, 0.5, 0.5, 0.25},
385 {-0.25, 0, -0.5, 0.25, 0.5, -0.25},
386 {-0.1875, -0.125, -0.1875, 0.1875, 0, 0.1875},
387 {-0.1875, -0.5, -0.1875, 0.1875, -0.375, 0.1875},
388 {-0.125, -0.375, -0.125, 0.125, -0.125, 0.125},
392 on_rotate
= "simple",
394 _hades_shaper_next
= "columnia:column_linkcrossdown_"..mat
,
397 minetest
.register_node("columnia:column_stairsub_"..mat
, {
398 description
= S("@1 Stair Substructure", desc
),
399 drawtype
= "nodebox",
402 paramtype2
= "facedir",
403 --sunlight_propagates = true,
404 is_ground_content
= false,
409 {-0.5, 0.4375, -0.5, 0.5, 0.5, 0.5},
410 {-0.5, -0.5, 0.4375, 0.5, 0.4375, 0.5},
411 {-0.5, -0.4375, 0.375, 0.5, 0.4375, 0.4375},
412 {-0.5, -0.375, 0.3125, 0.5, 0.4375, 0.375},
413 {-0.5, -0.3125, 0.25, 0.5, 0.4375, 0.3125},
414 {-0.5, -0.25, 0.1875, 0.5, 0.4375, 0.25},
415 {-0.5, -0.1875, 0.125, 0.5, 0.4375, 0.1875},
416 {-0.5, -0.125, 0.0625, 0.5, 0.4375, 0.125},
417 {-0.5, -0.0625, 0, 0.5, 0.4375, 0.0625},
418 {-0.5, 0, -0.0625, 0.5, 0.4375, 0},
419 {-0.5, 0.0625, -0.125, 0.5, 0.4375, -0.0625},
420 {-0.5, 0.125, -0.1875, 0.5, 0.4375, -0.125},
421 {-0.5, 0.1875, -0.25, 0.5, 0.4375, -0.1875},
422 {-0.5, 0.25, -0.3125, 0.5, 0.4375, -0.25},
423 {-0.5, 0.3125, -0.375, 0.5, 0.4375, -0.3125},
424 {-0.5, 0.375, -0.4375, 0.5, 0.4375, -0.375},
428 on_rotate
= "simple",
430 _hades_shaper_next
= "columnia:column_stairsubpillar_"..mat
,
433 minetest
.register_node("columnia:column_stairsubpillar_"..mat
, {
434 description
= S("@1 Stair Substructure Pillar", desc
),
435 drawtype
= "nodebox",
438 paramtype2
= "facedir",
439 --sunlight_propagates = true,
440 is_ground_content
= false,
445 {-0.5, 0.4375, -0.5, 0.5, 0.5, 0.5},
446 {-0.5, -0.5, 0.4375, 0.5, 0.4375, 0.5},
447 {-0.5, -0.4375, 0.375, 0.5, 0.4375, 0.4375},
448 {-0.5, -0.375, 0.3125, 0.5, 0.4375, 0.375},
449 {-0.5, -0.3125, 0.25, 0.5, 0.4375, 0.3125},
450 {-0.5, -0.25, 0.1875, 0.5, 0.4375, 0.25},
451 {-0.5, -0.1875, 0.125, 0.5, 0.4375, 0.1875},
452 {-0.5, -0.125, 0.0625, 0.5, 0.4375, 0.125},
453 {-0.5, -0.0625, 0, 0.5, 0.4375, 0.0625},
454 {-0.5, 0, -0.0625, 0.5, 0.4375, 0},
455 {-0.5, 0.0625, -0.125, 0.5, 0.4375, -0.0625},
456 {-0.5, 0.125, -0.1875, 0.5, 0.4375, -0.125},
457 {-0.5, 0.1875, -0.25, 0.5, 0.4375, -0.1875},
458 {-0.5, 0.25, -0.3125, 0.5, 0.4375, -0.25},
459 {-0.5, 0.3125, -0.375, 0.5, 0.4375, -0.3125},
460 {-0.5, 0.375, -0.4375, 0.5, 0.4375, -0.375},
461 {-0.25, -0.5, -0.25, 0.25, 0.4375, 0.25},
465 on_rotate
= "simple",
467 _hades_shaper_next
= "columnia:column_stairsub_"..mat
,