48
48
-- Register stair
49
49
-- Node will be called stairs:stair_<subname>
50
50
51
- function stairs .register_stair (subname , recipeitem , groups , images , description , sounds )
51
+ function stairs .register_stair (subname , recipeitem , groups , images , description ,
52
+ sounds , worldaligntex )
52
53
-- Set backface culling and world-aligned textures
53
54
local stair_images = {}
54
55
for i , image in ipairs (images ) do
55
56
if type (image ) == " string" then
56
57
stair_images [i ] = {
57
58
name = image ,
58
59
backface_culling = true ,
59
- align_style = " world" ,
60
60
}
61
+ if worldaligntex then
62
+ stair_images [i ].align_style = " world"
63
+ end
61
64
else
62
65
stair_images [i ] = table .copy (image )
63
66
if stair_images [i ].backface_culling == nil then
64
67
stair_images [i ].backface_culling = true
65
68
end
66
- if stair_images [i ].align_style == nil then
69
+ if worldaligntex and stair_images [i ].align_style == nil then
67
70
stair_images [i ].align_style = " world"
68
71
end
69
72
end
@@ -147,18 +150,21 @@ local slab_trans_dir = {[0] = 8, 0, 2, 1, 3, 4}
147
150
-- Register slab
148
151
-- Node will be called stairs:slab_<subname>
149
152
150
- function stairs .register_slab (subname , recipeitem , groups , images , description , sounds )
153
+ function stairs .register_slab (subname , recipeitem , groups , images , description ,
154
+ sounds , worldaligntex )
151
155
-- Set world-aligned textures
152
156
local slab_images = {}
153
157
for i , image in ipairs (images ) do
154
158
if type (image ) == " string" then
155
159
slab_images [i ] = {
156
160
name = image ,
157
- align_style = " world" ,
158
161
}
162
+ if worldaligntex then
163
+ slab_images [i ].align_style = " world"
164
+ end
159
165
else
160
166
slab_images [i ] = table .copy (image )
161
- if image .align_style == nil then
167
+ if worldaligntex and image .align_style == nil then
162
168
slab_images [i ].align_style = " world"
163
169
end
164
170
end
@@ -300,22 +306,25 @@ end
300
306
-- Register inner stair
301
307
-- Node will be called stairs:stair_inner_<subname>
302
308
303
- function stairs .register_stair_inner (subname , recipeitem , groups , images , description , sounds )
309
+ function stairs .register_stair_inner (subname , recipeitem , groups , images ,
310
+ description , sounds , worldaligntex )
304
311
-- Set backface culling and world-aligned textures
305
312
local stair_images = {}
306
313
for i , image in ipairs (images ) do
307
314
if type (image ) == " string" then
308
315
stair_images [i ] = {
309
316
name = image ,
310
317
backface_culling = true ,
311
- align_style = " world" ,
312
318
}
319
+ if worldaligntex then
320
+ stair_images [i ].align_style = " world"
321
+ end
313
322
else
314
323
stair_images [i ] = table .copy (image )
315
324
if stair_images [i ].backface_culling == nil then
316
325
stair_images [i ].backface_culling = true
317
326
end
318
- if stair_images [i ].align_style == nil then
327
+ if worldaligntex and stair_images [i ].align_style == nil then
319
328
stair_images [i ].align_style = " world"
320
329
end
321
330
end
@@ -378,22 +387,25 @@ end
378
387
-- Register outer stair
379
388
-- Node will be called stairs:stair_outer_<subname>
380
389
381
- function stairs .register_stair_outer (subname , recipeitem , groups , images , description , sounds )
390
+ function stairs .register_stair_outer (subname , recipeitem , groups , images ,
391
+ description , sounds , worldaligntex )
382
392
-- Set backface culling and world-aligned textures
383
393
local stair_images = {}
384
394
for i , image in ipairs (images ) do
385
395
if type (image ) == " string" then
386
396
stair_images [i ] = {
387
397
name = image ,
388
398
backface_culling = true ,
389
- align_style = " world" ,
390
399
}
400
+ if worldaligntex then
401
+ stair_images [i ].align_style = " world"
402
+ end
391
403
else
392
404
stair_images [i ] = table .copy (image )
393
405
if stair_images [i ].backface_culling == nil then
394
406
stair_images [i ].backface_culling = true
395
407
end
396
- if stair_images [i ].align_style == nil then
408
+ if worldaligntex and stair_images [i ].align_style == nil then
397
409
stair_images [i ].align_style = " world"
398
410
end
399
411
end
@@ -455,11 +467,16 @@ end
455
467
-- Stair/slab registration function.
456
468
-- Nodes will be called stairs:{stair,slab}_<subname>
457
469
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 )
470
+ function stairs .register_stair_and_slab (subname , recipeitem , groups , images ,
471
+ desc_stair , desc_slab , sounds , worldaligntex )
472
+ stairs .register_stair (subname , recipeitem , groups , images , desc_stair ,
473
+ sounds , worldaligntex )
474
+ stairs .register_stair_inner (subname , recipeitem , groups , images , desc_stair ,
475
+ sounds , worldaligntex )
476
+ stairs .register_stair_outer (subname , recipeitem , groups , images , desc_stair ,
477
+ sounds , worldaligntex )
478
+ stairs .register_slab (subname , recipeitem , groups , images , desc_slab ,
479
+ sounds , worldaligntex )
463
480
end
464
481
465
482
@@ -472,7 +489,8 @@ stairs.register_stair_and_slab(
472
489
{" default_wood.png" },
473
490
" Wooden Stair" ,
474
491
" Wooden Slab" ,
475
- default .node_sound_wood_defaults ()
492
+ default .node_sound_wood_defaults (),
493
+ false
476
494
)
477
495
478
496
stairs .register_stair_and_slab (
@@ -482,7 +500,8 @@ stairs.register_stair_and_slab(
482
500
{" default_junglewood.png" },
483
501
" Jungle Wood Stair" ,
484
502
" Jungle Wood Slab" ,
485
- default .node_sound_wood_defaults ()
503
+ default .node_sound_wood_defaults (),
504
+ false
486
505
)
487
506
488
507
stairs .register_stair_and_slab (
@@ -492,7 +511,8 @@ stairs.register_stair_and_slab(
492
511
{" default_pine_wood.png" },
493
512
" Pine Wood Stair" ,
494
513
" Pine Wood Slab" ,
495
- default .node_sound_wood_defaults ()
514
+ default .node_sound_wood_defaults (),
515
+ false
496
516
)
497
517
498
518
stairs .register_stair_and_slab (
@@ -502,7 +522,8 @@ stairs.register_stair_and_slab(
502
522
{" default_acacia_wood.png" },
503
523
" Acacia Wood Stair" ,
504
524
" Acacia Wood Slab" ,
505
- default .node_sound_wood_defaults ()
525
+ default .node_sound_wood_defaults (),
526
+ false
506
527
)
507
528
508
529
stairs .register_stair_and_slab (
@@ -512,7 +533,8 @@ stairs.register_stair_and_slab(
512
533
{" default_aspen_wood.png" },
513
534
" Aspen Wood Stair" ,
514
535
" Aspen Wood Slab" ,
515
- default .node_sound_wood_defaults ()
536
+ default .node_sound_wood_defaults (),
537
+ false
516
538
)
517
539
518
540
stairs .register_stair_and_slab (
@@ -522,7 +544,8 @@ stairs.register_stair_and_slab(
522
544
{" default_stone.png" },
523
545
" Stone Stair" ,
524
546
" Stone Slab" ,
525
- default .node_sound_stone_defaults ()
547
+ default .node_sound_stone_defaults (),
548
+ true
526
549
)
527
550
528
551
stairs .register_stair_and_slab (
@@ -532,7 +555,8 @@ stairs.register_stair_and_slab(
532
555
{" default_cobble.png" },
533
556
" Cobblestone Stair" ,
534
557
" Cobblestone Slab" ,
535
- default .node_sound_stone_defaults ()
558
+ default .node_sound_stone_defaults (),
559
+ true
536
560
)
537
561
538
562
stairs .register_stair_and_slab (
@@ -542,7 +566,8 @@ stairs.register_stair_and_slab(
542
566
{" default_mossycobble.png" },
543
567
" Mossy Cobblestone Stair" ,
544
568
" Mossy Cobblestone Slab" ,
545
- default .node_sound_stone_defaults ()
569
+ default .node_sound_stone_defaults (),
570
+ true
546
571
)
547
572
548
573
stairs .register_stair_and_slab (
@@ -552,7 +577,8 @@ stairs.register_stair_and_slab(
552
577
{" default_stone_brick.png" },
553
578
" Stone Brick Stair" ,
554
579
" Stone Brick Slab" ,
555
- default .node_sound_stone_defaults ()
580
+ default .node_sound_stone_defaults (),
581
+ false
556
582
)
557
583
558
584
stairs .register_stair_and_slab (
@@ -562,7 +588,8 @@ stairs.register_stair_and_slab(
562
588
{" default_stone_block.png" },
563
589
" Stone Block Stair" ,
564
590
" Stone Block Slab" ,
565
- default .node_sound_stone_defaults ()
591
+ default .node_sound_stone_defaults (),
592
+ true
566
593
)
567
594
568
595
stairs .register_stair_and_slab (
@@ -572,7 +599,8 @@ stairs.register_stair_and_slab(
572
599
{" default_desert_stone.png" },
573
600
" Desert Stone Stair" ,
574
601
" Desert Stone Slab" ,
575
- default .node_sound_stone_defaults ()
602
+ default .node_sound_stone_defaults (),
603
+ true
576
604
)
577
605
578
606
stairs .register_stair_and_slab (
@@ -582,7 +610,8 @@ stairs.register_stair_and_slab(
582
610
{" default_desert_cobble.png" },
583
611
" Desert Cobblestone Stair" ,
584
612
" Desert Cobblestone Slab" ,
585
- default .node_sound_stone_defaults ()
613
+ default .node_sound_stone_defaults (),
614
+ true
586
615
)
587
616
588
617
stairs .register_stair_and_slab (
@@ -592,7 +621,8 @@ stairs.register_stair_and_slab(
592
621
{" default_desert_stone_brick.png" },
593
622
" Desert Stone Brick Stair" ,
594
623
" Desert Stone Brick Slab" ,
595
- default .node_sound_stone_defaults ()
624
+ default .node_sound_stone_defaults (),
625
+ false
596
626
)
597
627
598
628
stairs .register_stair_and_slab (
@@ -602,7 +632,8 @@ stairs.register_stair_and_slab(
602
632
{" default_desert_stone_block.png" },
603
633
" Desert Stone Block Stair" ,
604
634
" Desert Stone Block Slab" ,
605
- default .node_sound_stone_defaults ()
635
+ default .node_sound_stone_defaults (),
636
+ true
606
637
)
607
638
608
639
stairs .register_stair_and_slab (
@@ -612,7 +643,8 @@ stairs.register_stair_and_slab(
612
643
{" default_sandstone.png" },
613
644
" Sandstone Stair" ,
614
645
" Sandstone Slab" ,
615
- default .node_sound_stone_defaults ()
646
+ default .node_sound_stone_defaults (),
647
+ true
616
648
)
617
649
618
650
stairs .register_stair_and_slab (
@@ -622,7 +654,8 @@ stairs.register_stair_and_slab(
622
654
{" default_sandstone_brick.png" },
623
655
" Sandstone Brick Stair" ,
624
656
" Sandstone Brick Slab" ,
625
- default .node_sound_stone_defaults ()
657
+ default .node_sound_stone_defaults (),
658
+ false
626
659
)
627
660
628
661
stairs .register_stair_and_slab (
@@ -632,7 +665,8 @@ stairs.register_stair_and_slab(
632
665
{" default_sandstone_block.png" },
633
666
" Sandstone Block Stair" ,
634
667
" Sandstone Block Slab" ,
635
- default .node_sound_stone_defaults ()
668
+ default .node_sound_stone_defaults (),
669
+ true
636
670
)
637
671
638
672
stairs .register_stair_and_slab (
@@ -642,7 +676,8 @@ stairs.register_stair_and_slab(
642
676
{" default_desert_sandstone.png" },
643
677
" Desert Sandstone Stair" ,
644
678
" Desert Sandstone Slab" ,
645
- default .node_sound_stone_defaults ()
679
+ default .node_sound_stone_defaults (),
680
+ true
646
681
)
647
682
648
683
stairs .register_stair_and_slab (
@@ -652,7 +687,8 @@ stairs.register_stair_and_slab(
652
687
{" default_desert_sandstone_brick.png" },
653
688
" Desert Sandstone Brick Stair" ,
654
689
" Desert Sandstone Brick Slab" ,
655
- default .node_sound_stone_defaults ()
690
+ default .node_sound_stone_defaults (),
691
+ false
656
692
)
657
693
658
694
stairs .register_stair_and_slab (
@@ -662,7 +698,8 @@ stairs.register_stair_and_slab(
662
698
{" default_desert_sandstone_block.png" },
663
699
" Desert Sandstone Block Stair" ,
664
700
" Desert Sandstone Block Slab" ,
665
- default .node_sound_stone_defaults ()
701
+ default .node_sound_stone_defaults (),
702
+ true
666
703
)
667
704
668
705
stairs .register_stair_and_slab (
@@ -672,7 +709,8 @@ stairs.register_stair_and_slab(
672
709
{" default_silver_sandstone.png" },
673
710
" Silver Sandstone Stair" ,
674
711
" Silver Sandstone Slab" ,
675
- default .node_sound_stone_defaults ()
712
+ default .node_sound_stone_defaults (),
713
+ true
676
714
)
677
715
678
716
stairs .register_stair_and_slab (
@@ -682,7 +720,8 @@ stairs.register_stair_and_slab(
682
720
{" default_silver_sandstone_brick.png" },
683
721
" Silver Sandstone Brick Stair" ,
684
722
" Silver Sandstone Brick Slab" ,
685
- default .node_sound_stone_defaults ()
723
+ default .node_sound_stone_defaults (),
724
+ false
686
725
)
687
726
688
727
stairs .register_stair_and_slab (
@@ -692,7 +731,8 @@ stairs.register_stair_and_slab(
692
731
{" default_silver_sandstone_block.png" },
693
732
" Silver Sandstone Block Stair" ,
694
733
" Silver Sandstone Block Slab" ,
695
- default .node_sound_stone_defaults ()
734
+ default .node_sound_stone_defaults (),
735
+ true
696
736
)
697
737
698
738
stairs .register_stair_and_slab (
@@ -702,7 +742,8 @@ stairs.register_stair_and_slab(
702
742
{" default_obsidian.png" },
703
743
" Obsidian Stair" ,
704
744
" Obsidian Slab" ,
705
- default .node_sound_stone_defaults ()
745
+ default .node_sound_stone_defaults (),
746
+ true
706
747
)
707
748
708
749
stairs .register_stair_and_slab (
@@ -712,7 +753,8 @@ stairs.register_stair_and_slab(
712
753
{" default_obsidian_brick.png" },
713
754
" Obsidian Brick Stair" ,
714
755
" Obsidian Brick Slab" ,
715
- default .node_sound_stone_defaults ()
756
+ default .node_sound_stone_defaults (),
757
+ false
716
758
)
717
759
718
760
stairs .register_stair_and_slab (
@@ -722,7 +764,8 @@ stairs.register_stair_and_slab(
722
764
{" default_obsidian_block.png" },
723
765
" Obsidian Block Stair" ,
724
766
" Obsidian Block Slab" ,
725
- default .node_sound_stone_defaults ()
767
+ default .node_sound_stone_defaults (),
768
+ true
726
769
)
727
770
728
771
stairs .register_stair_and_slab (
@@ -732,7 +775,8 @@ stairs.register_stair_and_slab(
732
775
{" default_brick.png" },
733
776
" Brick Stair" ,
734
777
" Brick Slab" ,
735
- default .node_sound_stone_defaults ()
778
+ default .node_sound_stone_defaults (),
779
+ false
736
780
)
737
781
738
782
stairs .register_stair_and_slab (
@@ -742,7 +786,8 @@ stairs.register_stair_and_slab(
742
786
{" default_steel_block.png" },
743
787
" Steel Block Stair" ,
744
788
" Steel Block Slab" ,
745
- default .node_sound_metal_defaults ()
789
+ default .node_sound_metal_defaults (),
790
+ true
746
791
)
747
792
748
793
stairs .register_stair_and_slab (
@@ -752,7 +797,8 @@ stairs.register_stair_and_slab(
752
797
{" default_tin_block.png" },
753
798
" Tin Block Stair" ,
754
799
" Tin Block Slab" ,
755
- default .node_sound_metal_defaults ()
800
+ default .node_sound_metal_defaults (),
801
+ true
756
802
)
757
803
758
804
stairs .register_stair_and_slab (
@@ -762,7 +808,8 @@ stairs.register_stair_and_slab(
762
808
{" default_copper_block.png" },
763
809
" Copper Block Stair" ,
764
810
" Copper Block Slab" ,
765
- default .node_sound_metal_defaults ()
811
+ default .node_sound_metal_defaults (),
812
+ true
766
813
)
767
814
768
815
stairs .register_stair_and_slab (
@@ -772,7 +819,8 @@ stairs.register_stair_and_slab(
772
819
{" default_bronze_block.png" },
773
820
" Bronze Block Stair" ,
774
821
" Bronze Block Slab" ,
775
- default .node_sound_metal_defaults ()
822
+ default .node_sound_metal_defaults (),
823
+ true
776
824
)
777
825
778
826
stairs .register_stair_and_slab (
@@ -782,7 +830,8 @@ stairs.register_stair_and_slab(
782
830
{" default_gold_block.png" },
783
831
" Gold Block Stair" ,
784
832
" Gold Block Slab" ,
785
- default .node_sound_metal_defaults ()
833
+ default .node_sound_metal_defaults (),
834
+ true
786
835
)
787
836
788
837
stairs .register_stair_and_slab (
@@ -792,7 +841,8 @@ stairs.register_stair_and_slab(
792
841
{" default_ice.png" },
793
842
" Ice Stair" ,
794
843
" Ice Slab" ,
795
- default .node_sound_glass_defaults ()
844
+ default .node_sound_glass_defaults (),
845
+ true
796
846
)
797
847
798
848
stairs .register_stair_and_slab (
@@ -802,5 +852,6 @@ stairs.register_stair_and_slab(
802
852
{" default_snow.png" },
803
853
" Snow Block Stair" ,
804
854
" Snow Block Slab" ,
805
- default .node_sound_snow_defaults ()
855
+ default .node_sound_snow_defaults (),
856
+ true
806
857
)
0 commit comments