README.txt files: Change 'LGPL 2.1' to 'LGPLv2.1+'. Remove 'WTFPL'
[oweals/minetest_game.git] / mods / stairs / init.lua
1 -- Minetest 0.4 mod: stairs
2 -- See README.txt for licensing and other information.
3
4
5 -- Global namespace for functions
6
7 stairs = {}
8
9
10 -- Register aliases for new pine node names
11
12 minetest.register_alias("stairs:stair_pinewood", "stairs:stair_pine_wood")
13 minetest.register_alias("stairs:slab_pinewood", "stairs:slab_pine_wood")
14
15
16 -- Get setting for replace ABM
17
18 local replace = minetest.settings:get_bool("enable_stairs_replace_abm")
19
20 local function rotate_and_place(itemstack, placer, pointed_thing)
21         local p0 = pointed_thing.under
22         local p1 = pointed_thing.above
23         local param2 = 0
24
25         if placer then
26                 local placer_pos = placer:get_pos()
27                 if placer_pos then
28                         param2 = minetest.dir_to_facedir(vector.subtract(p1, placer_pos))
29                 end
30
31                 local finepos = minetest.pointed_thing_to_face_pos(placer, pointed_thing)
32                 local fpos = finepos.y % 1
33
34                 if p0.y - 1 == p1.y or (fpos > 0 and fpos < 0.5)
35                                 or (fpos < -0.5 and fpos > -0.999999999) then
36                         param2 = param2 + 20
37                         if param2 == 21 then
38                                 param2 = 23
39                         elseif param2 == 23 then
40                                 param2 = 21
41                         end
42                 end
43         end
44         return minetest.item_place(itemstack, placer, pointed_thing, param2)
45 end
46
47
48 -- Register stair
49 -- Node will be called stairs:stair_<subname>
50
51 function stairs.register_stair(subname, recipeitem, groups, images, description, sounds)
52         -- Set backface culling and world-aligned textures
53         local stair_images = {}
54         for i, image in ipairs(images) do
55                 if type(image) == "string" then
56                         stair_images[i] = {
57                                 name = image,
58                                 backface_culling = true,
59                                 align_style = "world",
60                         }
61                 else
62                         stair_images[i] = table.copy(image)
63                         if stair_images[i].backface_culling == nil then
64                                 stair_images[i].backface_culling = true
65                         end
66                         if stair_images[i].align_style == nil then
67                                 stair_images[i].align_style = "world"
68                         end
69                 end
70         end
71         local new_groups = table.copy(groups)
72         new_groups.stair = 1
73         minetest.register_node(":stairs:stair_" .. subname, {
74                 description = description,
75                 drawtype = "nodebox",
76                 tiles = stair_images,
77                 paramtype = "light",
78                 paramtype2 = "facedir",
79                 is_ground_content = false,
80                 groups = new_groups,
81                 sounds = sounds,
82                 node_box = {
83                         type = "fixed",
84                         fixed = {
85                                 {-0.5, -0.5, -0.5, 0.5, 0.0, 0.5},
86                                 {-0.5, 0.0, 0.0, 0.5, 0.5, 0.5},
87                         },
88                 },
89                 on_place = function(itemstack, placer, pointed_thing)
90                         if pointed_thing.type ~= "node" then
91                                 return itemstack
92                         end
93
94                         return rotate_and_place(itemstack, placer, pointed_thing)
95                 end,
96         })
97
98         -- for replace ABM
99         if replace then
100                 minetest.register_node(":stairs:stair_" .. subname .. "upside_down", {
101                         replace_name = "stairs:stair_" .. subname,
102                         groups = {slabs_replace = 1},
103                 })
104         end
105
106         if recipeitem then
107                 -- Recipe matches appearence in inventory
108                 minetest.register_craft({
109                         output = 'stairs:stair_' .. subname .. ' 8',
110                         recipe = {
111                                 {"", "", recipeitem},
112                                 {"", recipeitem, recipeitem},
113                                 {recipeitem, recipeitem, recipeitem},
114                         },
115                 })
116
117                 -- Use stairs to craft full blocks again (1:1)
118                 minetest.register_craft({
119                         output = recipeitem .. ' 3',
120                         recipe = {
121                                 {'stairs:stair_' .. subname, 'stairs:stair_' .. subname},
122                                 {'stairs:stair_' .. subname, 'stairs:stair_' .. subname},
123                         },
124                 })
125
126                 -- Fuel
127                 local baseburntime = minetest.get_craft_result({
128                         method = "fuel",
129                         width = 1,
130                         items = {recipeitem}
131                 }).time
132                 if baseburntime > 0 then
133                         minetest.register_craft({
134                                 type = "fuel",
135                                 recipe = 'stairs:stair_' .. subname,
136                                 burntime = math.floor(baseburntime * 0.75),
137                         })
138                 end
139         end
140 end
141
142
143 -- Slab facedir to placement 6d matching table
144 local slab_trans_dir = {[0] = 8, 0, 2, 1, 3, 4}
145
146
147 -- Register slab
148 -- Node will be called stairs:slab_<subname>
149
150 function stairs.register_slab(subname, recipeitem, groups, images, description, sounds)
151         -- Set world-aligned textures
152         local slab_images = {}
153         for i, image in ipairs(images) do
154                 if type(image) == "string" then
155                         slab_images[i] = {
156                                 name = image,
157                                 align_style = "world",
158                         }
159                 else
160                         slab_images[i] = table.copy(image)
161                         if image.align_style == nil then
162                                 slab_images[i].align_style = "world"
163                         end
164                 end
165         end
166         local new_groups = table.copy(groups)
167         new_groups.slab = 1
168         minetest.register_node(":stairs:slab_" .. subname, {
169                 description = description,
170                 drawtype = "nodebox",
171                 tiles = slab_images,
172                 paramtype = "light",
173                 paramtype2 = "facedir",
174                 is_ground_content = false,
175                 groups = new_groups,
176                 sounds = sounds,
177                 node_box = {
178                         type = "fixed",
179                         fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
180                 },
181                 on_place = function(itemstack, placer, pointed_thing)
182                         local under = minetest.get_node(pointed_thing.under)
183                         local wield_item = itemstack:get_name()
184                         local player_name = placer and placer:get_player_name() or ""
185                         local creative_enabled = (creative and creative.is_enabled_for
186                                         and creative.is_enabled_for(player_name))
187
188                         if under and under.name:find("stairs:slab_") then
189                                 -- place slab using under node orientation
190                                 local dir = minetest.dir_to_facedir(vector.subtract(
191                                         pointed_thing.above, pointed_thing.under), true)
192
193                                 local p2 = under.param2
194
195                                 -- combine two slabs if possible
196                                 if slab_trans_dir[math.floor(p2 / 4)] == dir
197                                                 and wield_item == under.name then
198
199                                         if not recipeitem then
200                                                 return itemstack
201                                         end
202                                         if minetest.is_protected(pointed_thing.under, player_name) and not
203                                                         minetest.check_player_privs(player_name, "protection_bypass") then
204                                                 minetest.record_protection_violation(pointed_thing.under,
205                                                         player_name)
206                                                 return
207                                         end
208                                         minetest.set_node(pointed_thing.under, {name = recipeitem, param2 = p2})
209                                         if not creative_enabled then
210                                                 itemstack:take_item()
211                                         end
212                                         return itemstack
213                                 end
214
215                                 -- Placing a slab on an upside down slab should make it right-side up.
216                                 if p2 >= 20 and dir == 8 then
217                                         p2 = p2 - 20
218                                 -- same for the opposite case: slab below normal slab
219                                 elseif p2 <= 3 and dir == 4 then
220                                         p2 = p2 + 20
221                                 end
222
223                                 -- else attempt to place node with proper param2
224                                 minetest.item_place_node(ItemStack(wield_item), placer, pointed_thing, p2)
225                                 if not creative_enabled then
226                                         itemstack:take_item()
227                                 end
228                                 return itemstack
229                         else
230                                 return rotate_and_place(itemstack, placer, pointed_thing)
231                         end
232                 end,
233         })
234
235         -- for replace ABM
236         if replace then
237                 minetest.register_node(":stairs:slab_" .. subname .. "upside_down", {
238                         replace_name = "stairs:slab_".. subname,
239                         groups = {slabs_replace = 1},
240                 })
241         end
242
243         if recipeitem then
244                 minetest.register_craft({
245                         output = 'stairs:slab_' .. subname .. ' 6',
246                         recipe = {
247                                 {recipeitem, recipeitem, recipeitem},
248                         },
249                 })
250
251                 -- Use 2 slabs to craft a full block again (1:1)
252                 minetest.register_craft({
253                         output = recipeitem,
254                         recipe = {
255                                 {'stairs:slab_' .. subname},
256                                 {'stairs:slab_' .. subname},
257                         },
258                 })
259
260                 -- Fuel
261                 local baseburntime = minetest.get_craft_result({
262                         method = "fuel",
263                         width = 1,
264                         items = {recipeitem}
265                 }).time
266                 if baseburntime > 0 then
267                         minetest.register_craft({
268                                 type = "fuel",
269                                 recipe = 'stairs:slab_' .. subname,
270                                 burntime = math.floor(baseburntime * 0.5),
271                         })
272                 end
273         end
274 end
275
276
277 -- Optionally replace old "upside_down" nodes with new param2 versions.
278 -- Disabled by default.
279
280 if replace then
281         minetest.register_abm({
282                 label = "Slab replace",
283                 nodenames = {"group:slabs_replace"},
284                 interval = 16,
285                 chance = 1,
286                 action = function(pos, node)
287                         node.name = minetest.registered_nodes[node.name].replace_name
288                         node.param2 = node.param2 + 20
289                         if node.param2 == 21 then
290                                 node.param2 = 23
291                         elseif node.param2 == 23 then
292                                 node.param2 = 21
293                         end
294                         minetest.set_node(pos, node)
295                 end,
296         })
297 end
298
299
300 -- Register inner stair
301 -- Node will be called stairs:stair_inner_<subname>
302
303 function stairs.register_stair_inner(subname, recipeitem, groups, images, description, sounds)
304         -- Set backface culling and world-aligned textures
305         local stair_images = {}
306         for i, image in ipairs(images) do
307                 if type(image) == "string" then
308                         stair_images[i] = {
309                                 name = image,
310                                 backface_culling = true,
311                                 align_style = "world",
312                         }
313                 else
314                         stair_images[i] = table.copy(image)
315                         if stair_images[i].backface_culling == nil then
316                                 stair_images[i].backface_culling = true
317                         end
318                         if stair_images[i].align_style == nil then
319                                 stair_images[i].align_style = "world"
320                         end
321                 end
322         end
323         local new_groups = table.copy(groups)
324         new_groups.stair = 1
325         minetest.register_node(":stairs:stair_inner_" .. subname, {
326                 description = "Inner " .. description,
327                 drawtype = "nodebox",
328                 tiles = stair_images,
329                 paramtype = "light",
330                 paramtype2 = "facedir",
331                 is_ground_content = false,
332                 groups = new_groups,
333                 sounds = sounds,
334                 node_box = {
335                         type = "fixed",
336                         fixed = {
337                                 {-0.5, -0.5, -0.5, 0.5, 0.0, 0.5},
338                                 {-0.5, 0.0, 0.0, 0.5, 0.5, 0.5},
339                                 {-0.5, 0.0, -0.5, 0.0, 0.5, 0.0},
340                         },
341                 },
342                 on_place = function(itemstack, placer, pointed_thing)
343                         if pointed_thing.type ~= "node" then
344                                 return itemstack
345                         end
346
347                         return rotate_and_place(itemstack, placer, pointed_thing)
348                 end,
349         })
350
351         if recipeitem then
352                 minetest.register_craft({
353                         output = 'stairs:stair_inner_' .. subname .. ' 7',
354                         recipe = {
355                                 { "", recipeitem, ""},
356                                 { recipeitem, "", recipeitem},
357                                 {recipeitem, recipeitem, recipeitem},
358                         },
359                 })
360
361                 -- Fuel
362                 local baseburntime = minetest.get_craft_result({
363                         method = "fuel",
364                         width = 1,
365                         items = {recipeitem}
366                 }).time
367                 if baseburntime > 0 then
368                         minetest.register_craft({
369                                 type = "fuel",
370                                 recipe = 'stairs:stair_inner_' .. subname,
371                                 burntime = math.floor(baseburntime * 0.875),
372                         })
373                 end
374         end
375 end
376
377
378 -- Register outer stair
379 -- Node will be called stairs:stair_outer_<subname>
380
381 function stairs.register_stair_outer(subname, recipeitem, groups, images, description, sounds)
382         -- Set backface culling and world-aligned textures
383         local stair_images = {}
384         for i, image in ipairs(images) do
385                 if type(image) == "string" then
386                         stair_images[i] = {
387                                 name = image,
388                                 backface_culling = true,
389                                 align_style = "world",
390                         }
391                 else
392                         stair_images[i] = table.copy(image)
393                         if stair_images[i].backface_culling == nil then
394                                 stair_images[i].backface_culling = true
395                         end
396                         if stair_images[i].align_style == nil then
397                                 stair_images[i].align_style = "world"
398                         end
399                 end
400         end
401         local new_groups = table.copy(groups)
402         new_groups.stair = 1
403         minetest.register_node(":stairs:stair_outer_" .. subname, {
404                 description = "Outer " .. description,
405                 drawtype = "nodebox",
406                 tiles = stair_images,
407                 paramtype = "light",
408                 paramtype2 = "facedir",
409                 is_ground_content = false,
410                 groups = new_groups,
411                 sounds = sounds,
412                 node_box = {
413                         type = "fixed",
414                         fixed = {
415                                 {-0.5, -0.5, -0.5, 0.5, 0.0, 0.5},
416                                 {-0.5, 0.0, 0.0, 0.0, 0.5, 0.5},
417                         },
418                 },
419                 on_place = function(itemstack, placer, pointed_thing)
420                         if pointed_thing.type ~= "node" then
421                                 return itemstack
422                         end
423
424                         return rotate_and_place(itemstack, placer, pointed_thing)
425                 end,
426         })
427
428         if recipeitem then
429                 minetest.register_craft({
430                         output = 'stairs:stair_outer_' .. subname .. ' 6',
431                         recipe = {
432                                 { "", "", ""},
433                                 { "", recipeitem, ""},
434                                 {recipeitem, recipeitem, recipeitem},
435                         },
436                 })
437
438                 -- Fuel
439                 local baseburntime = minetest.get_craft_result({
440                         method = "fuel",
441                         width = 1,
442                         items = {recipeitem}
443                 }).time
444                 if baseburntime > 0 then
445                         minetest.register_craft({
446                                 type = "fuel",
447                                 recipe = 'stairs:stair_outer_' .. subname,
448                                 burntime = math.floor(baseburntime * 0.625),
449                         })
450                 end
451         end
452 end
453
454
455 -- Stair/slab registration function.
456 -- Nodes will be called stairs:{stair,slab}_<subname>
457
458 function stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab, sounds)
459         stairs.register_stair(subname, recipeitem, groups, images, desc_stair, sounds)
460         stairs.register_stair_inner(subname, recipeitem, groups, images, desc_stair, sounds)
461         stairs.register_stair_outer(subname, recipeitem, groups, images, desc_stair, sounds)
462         stairs.register_slab(subname, recipeitem, groups, images, desc_slab, sounds)
463 end
464
465
466 -- Register default stairs and slabs
467
468 stairs.register_stair_and_slab(
469         "wood",
470         "default:wood",
471         {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
472         {"default_wood.png"},
473         "Wooden Stair",
474         "Wooden Slab",
475         default.node_sound_wood_defaults()
476 )
477
478 stairs.register_stair_and_slab(
479         "junglewood",
480         "default:junglewood",
481         {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
482         {"default_junglewood.png"},
483         "Jungle Wood Stair",
484         "Jungle Wood Slab",
485         default.node_sound_wood_defaults()
486 )
487
488 stairs.register_stair_and_slab(
489         "pine_wood",
490         "default:pine_wood",
491         {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
492         {"default_pine_wood.png"},
493         "Pine Wood Stair",
494         "Pine Wood Slab",
495         default.node_sound_wood_defaults()
496 )
497
498 stairs.register_stair_and_slab(
499         "acacia_wood",
500         "default:acacia_wood",
501         {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
502         {"default_acacia_wood.png"},
503         "Acacia Wood Stair",
504         "Acacia Wood Slab",
505         default.node_sound_wood_defaults()
506 )
507
508 stairs.register_stair_and_slab(
509         "aspen_wood",
510         "default:aspen_wood",
511         {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
512         {"default_aspen_wood.png"},
513         "Aspen Wood Stair",
514         "Aspen Wood Slab",
515         default.node_sound_wood_defaults()
516 )
517
518 stairs.register_stair_and_slab(
519         "stone",
520         "default:stone",
521         {cracky = 3},
522         {"default_stone.png"},
523         "Stone Stair",
524         "Stone Slab",
525         default.node_sound_stone_defaults()
526 )
527
528 stairs.register_stair_and_slab(
529         "cobble",
530         "default:cobble",
531         {cracky = 3},
532         {"default_cobble.png"},
533         "Cobblestone Stair",
534         "Cobblestone Slab",
535         default.node_sound_stone_defaults()
536 )
537
538 stairs.register_stair_and_slab(
539         "mossycobble",
540         "default:mossycobble",
541         {cracky = 3},
542         {"default_mossycobble.png"},
543         "Mossy Cobblestone Stair",
544         "Mossy Cobblestone Slab",
545         default.node_sound_stone_defaults()
546 )
547
548 stairs.register_stair_and_slab(
549         "stonebrick",
550         "default:stonebrick",
551         {cracky = 2},
552         {"default_stone_brick.png"},
553         "Stone Brick Stair",
554         "Stone Brick Slab",
555         default.node_sound_stone_defaults()
556 )
557
558 stairs.register_stair_and_slab(
559         "stone_block",
560         "default:stone_block",
561         {cracky = 2},
562         {"default_stone_block.png"},
563         "Stone Block Stair",
564         "Stone Block Slab",
565         default.node_sound_stone_defaults()
566 )
567
568 stairs.register_stair_and_slab(
569         "desert_stone",
570         "default:desert_stone",
571         {cracky = 3},
572         {"default_desert_stone.png"},
573         "Desert Stone Stair",
574         "Desert Stone Slab",
575         default.node_sound_stone_defaults()
576 )
577
578 stairs.register_stair_and_slab(
579         "desert_cobble",
580         "default:desert_cobble",
581         {cracky = 3},
582         {"default_desert_cobble.png"},
583         "Desert Cobblestone Stair",
584         "Desert Cobblestone Slab",
585         default.node_sound_stone_defaults()
586 )
587
588 stairs.register_stair_and_slab(
589         "desert_stonebrick",
590         "default:desert_stonebrick",
591         {cracky = 2},
592         {"default_desert_stone_brick.png"},
593         "Desert Stone Brick Stair",
594         "Desert Stone Brick Slab",
595         default.node_sound_stone_defaults()
596 )
597
598 stairs.register_stair_and_slab(
599         "desert_stone_block",
600         "default:desert_stone_block",
601         {cracky = 2},
602         {"default_desert_stone_block.png"},
603         "Desert Stone Block Stair",
604         "Desert Stone Block Slab",
605         default.node_sound_stone_defaults()
606 )
607
608 stairs.register_stair_and_slab(
609         "sandstone",
610         "default:sandstone",
611         {crumbly = 1, cracky = 3},
612         {"default_sandstone.png"},
613         "Sandstone Stair",
614         "Sandstone Slab",
615         default.node_sound_stone_defaults()
616 )
617
618 stairs.register_stair_and_slab(
619         "sandstonebrick",
620         "default:sandstonebrick",
621         {cracky = 2},
622         {"default_sandstone_brick.png"},
623         "Sandstone Brick Stair",
624         "Sandstone Brick Slab",
625         default.node_sound_stone_defaults()
626 )
627
628 stairs.register_stair_and_slab(
629         "sandstone_block",
630         "default:sandstone_block",
631         {cracky = 2},
632         {"default_sandstone_block.png"},
633         "Sandstone Block Stair",
634         "Sandstone Block Slab",
635         default.node_sound_stone_defaults()
636 )
637
638 stairs.register_stair_and_slab(
639         "desert_sandstone",
640         "default:desert_sandstone",
641         {crumbly = 1, cracky = 3},
642         {"default_desert_sandstone.png"},
643         "Desert Sandstone Stair",
644         "Desert Sandstone Slab",
645         default.node_sound_stone_defaults()
646 )
647
648 stairs.register_stair_and_slab(
649         "desert_sandstone_brick",
650         "default:desert_sandstone_brick",
651         {cracky = 2},
652         {"default_desert_sandstone_brick.png"},
653         "Desert Sandstone Brick Stair",
654         "Desert Sandstone Brick Slab",
655         default.node_sound_stone_defaults()
656 )
657
658 stairs.register_stair_and_slab(
659         "desert_sandstone_block",
660         "default:desert_sandstone_block",
661         {cracky = 2},
662         {"default_desert_sandstone_block.png"},
663         "Desert Sandstone Block Stair",
664         "Desert Sandstone Block Slab",
665         default.node_sound_stone_defaults()
666 )
667
668 stairs.register_stair_and_slab(
669         "silver_sandstone",
670         "default:silver_sandstone",
671         {crumbly = 1, cracky = 3},
672         {"default_silver_sandstone.png"},
673         "Silver Sandstone Stair",
674         "Silver Sandstone Slab",
675         default.node_sound_stone_defaults()
676 )
677
678 stairs.register_stair_and_slab(
679         "silver_sandstone_brick",
680         "default:silver_sandstone_brick",
681         {cracky = 2},
682         {"default_silver_sandstone_brick.png"},
683         "Silver Sandstone Brick Stair",
684         "Silver Sandstone Brick Slab",
685         default.node_sound_stone_defaults()
686 )
687
688 stairs.register_stair_and_slab(
689         "silver_sandstone_block",
690         "default:silver_sandstone_block",
691         {cracky = 2},
692         {"default_silver_sandstone_block.png"},
693         "Silver Sandstone Block Stair",
694         "Silver Sandstone Block Slab",
695         default.node_sound_stone_defaults()
696 )
697
698 stairs.register_stair_and_slab(
699         "obsidian",
700         "default:obsidian",
701         {cracky = 1, level = 2},
702         {"default_obsidian.png"},
703         "Obsidian Stair",
704         "Obsidian Slab",
705         default.node_sound_stone_defaults()
706 )
707
708 stairs.register_stair_and_slab(
709         "obsidianbrick",
710         "default:obsidianbrick",
711         {cracky = 1, level = 2},
712         {"default_obsidian_brick.png"},
713         "Obsidian Brick Stair",
714         "Obsidian Brick Slab",
715         default.node_sound_stone_defaults()
716 )
717
718 stairs.register_stair_and_slab(
719         "obsidian_block",
720         "default:obsidian_block",
721         {cracky = 1, level = 2},
722         {"default_obsidian_block.png"},
723         "Obsidian Block Stair",
724         "Obsidian Block Slab",
725         default.node_sound_stone_defaults()
726 )
727
728 stairs.register_stair_and_slab(
729         "brick",
730         "default:brick",
731         {cracky = 3},
732         {"default_brick.png"},
733         "Brick Stair",
734         "Brick Slab",
735         default.node_sound_stone_defaults()
736 )
737
738 stairs.register_stair_and_slab(
739         "steelblock",
740         "default:steelblock",
741         {cracky = 1, level = 2},
742         {"default_steel_block.png"},
743         "Steel Block Stair",
744         "Steel Block Slab",
745         default.node_sound_metal_defaults()
746 )
747
748 stairs.register_stair_and_slab(
749         "tinblock",
750         "default:tinblock",
751         {cracky = 1, level = 2},
752         {"default_tin_block.png"},
753         "Tin Block Stair",
754         "Tin Block Slab",
755         default.node_sound_metal_defaults()
756 )
757
758 stairs.register_stair_and_slab(
759         "copperblock",
760         "default:copperblock",
761         {cracky = 1, level = 2},
762         {"default_copper_block.png"},
763         "Copper Block Stair",
764         "Copper Block Slab",
765         default.node_sound_metal_defaults()
766 )
767
768 stairs.register_stair_and_slab(
769         "bronzeblock",
770         "default:bronzeblock",
771         {cracky = 1, level = 2},
772         {"default_bronze_block.png"},
773         "Bronze Block Stair",
774         "Bronze Block Slab",
775         default.node_sound_metal_defaults()
776 )
777
778 stairs.register_stair_and_slab(
779         "goldblock",
780         "default:goldblock",
781         {cracky = 1},
782         {"default_gold_block.png"},
783         "Gold Block Stair",
784         "Gold Block Slab",
785         default.node_sound_metal_defaults()
786 )
787
788 stairs.register_stair_and_slab(
789         "ice",
790         "default:ice",
791         {cracky = 3, puts_out_fire = 1, cools_lava = 1, slippery = 3},
792         {"default_ice.png"},
793         "Ice Stair",
794         "Ice Slab",
795         default.node_sound_glass_defaults()
796 )
797
798 stairs.register_stair_and_slab(
799         "snowblock",
800         "default:snowblock",
801         {crumbly = 3, puts_out_fire = 1, cools_lava = 1, snowy = 1},
802         {"default_snow.png"},
803         "Snow Block Stair",
804         "Snow Block Slab",
805         default.node_sound_snow_defaults()
806 )