@@ -500,16 +500,30 @@ minetest.register_node("default:sapling", {
500
500
sunlight_propagates = true ,
501
501
walkable = false ,
502
502
on_timer = default .grow_sapling ,
503
- on_construct = function (pos )
504
- minetest .get_node_timer (pos ):start (math.random (2400 ,4800 ))
505
- end ,
506
503
selection_box = {
507
504
type = " fixed" ,
508
505
fixed = {- 0.3 , - 0.5 , - 0.3 , 0.3 , 0.35 , 0.3 }
509
506
},
510
507
groups = {snappy = 2 , dig_immediate = 3 , flammable = 2 ,
511
508
attached_node = 1 , sapling = 1 },
512
509
sounds = default .node_sound_leaves_defaults (),
510
+
511
+ on_construct = function (pos )
512
+ minetest .get_node_timer (pos ):start (math.random (2400 ,4800 ))
513
+ end ,
514
+
515
+ on_place = function (itemstack , placer , pointed_thing )
516
+ itemstack = default .sapling_on_place (itemstack , placer , pointed_thing ,
517
+ " default:sapling" ,
518
+ -- minp, maxp to be checked, relative to sapling pos
519
+ -- minp_relative.y = 1 because sapling pos has been checked
520
+ {x = - 2 , y = 1 , z = - 2 },
521
+ {x = 2 , y = 6 , z = 2 },
522
+ -- maximum interval of interior volume check
523
+ 4 )
524
+
525
+ return itemstack
526
+ end ,
513
527
})
514
528
515
529
minetest .register_node (" default:leaves" , {
@@ -624,16 +638,30 @@ minetest.register_node("default:junglesapling", {
624
638
sunlight_propagates = true ,
625
639
walkable = false ,
626
640
on_timer = default .grow_sapling ,
627
- on_construct = function (pos )
628
- minetest .get_node_timer (pos ):start (math.random (2400 ,4800 ))
629
- end ,
630
641
selection_box = {
631
642
type = " fixed" ,
632
643
fixed = {- 0.3 , - 0.5 , - 0.3 , 0.3 , 0.35 , 0.3 }
633
644
},
634
645
groups = {snappy = 2 , dig_immediate = 3 , flammable = 2 ,
635
646
attached_node = 1 , sapling = 1 },
636
647
sounds = default .node_sound_leaves_defaults (),
648
+
649
+ on_construct = function (pos )
650
+ minetest .get_node_timer (pos ):start (math.random (2400 ,4800 ))
651
+ end ,
652
+
653
+ on_place = function (itemstack , placer , pointed_thing )
654
+ itemstack = default .sapling_on_place (itemstack , placer , pointed_thing ,
655
+ " default:junglesapling" ,
656
+ -- minp, maxp to be checked, relative to sapling pos
657
+ -- minp_relative.y = 1 because sapling pos has been checked
658
+ {x = - 2 , y = 1 , z = - 2 },
659
+ {x = 2 , y = 15 , z = 2 },
660
+ -- maximum interval of interior volume check
661
+ 4 )
662
+
663
+ return itemstack
664
+ end ,
637
665
})
638
666
639
667
@@ -691,16 +719,30 @@ minetest.register_node("default:pine_sapling", {
691
719
sunlight_propagates = true ,
692
720
walkable = false ,
693
721
on_timer = default .grow_sapling ,
694
- on_construct = function (pos )
695
- minetest .get_node_timer (pos ):start (math.random (2400 ,4800 ))
696
- end ,
697
722
selection_box = {
698
723
type = " fixed" ,
699
724
fixed = {- 0.3 , - 0.5 , - 0.3 , 0.3 , 0.35 , 0.3 }
700
725
},
701
726
groups = {snappy = 2 , dig_immediate = 3 , flammable = 2 ,
702
727
attached_node = 1 , sapling = 1 },
703
728
sounds = default .node_sound_leaves_defaults (),
729
+
730
+ on_construct = function (pos )
731
+ minetest .get_node_timer (pos ):start (math.random (2400 ,4800 ))
732
+ end ,
733
+
734
+ on_place = function (itemstack , placer , pointed_thing )
735
+ itemstack = default .sapling_on_place (itemstack , placer , pointed_thing ,
736
+ " default:pine_sapling" ,
737
+ -- minp, maxp to be checked, relative to sapling pos
738
+ -- minp_relative.y = 1 because sapling pos has been checked
739
+ {x = - 2 , y = 1 , z = - 2 },
740
+ {x = 2 , y = 12 , z = 2 },
741
+ -- maximum interval of interior volume check
742
+ 4 )
743
+
744
+ return itemstack
745
+ end ,
704
746
})
705
747
706
748
@@ -758,16 +800,30 @@ minetest.register_node("default:acacia_sapling", {
758
800
sunlight_propagates = true ,
759
801
walkable = false ,
760
802
on_timer = default .grow_sapling ,
761
- on_construct = function (pos )
762
- minetest .get_node_timer (pos ):start (math.random (2400 ,4800 ))
763
- end ,
764
803
selection_box = {
765
804
type = " fixed" ,
766
805
fixed = {- 0.3 , - 0.5 , - 0.3 , 0.3 , 0.35 , 0.3 }
767
806
},
768
807
groups = {snappy = 2 , dig_immediate = 3 , flammable = 2 ,
769
808
attached_node = 1 , sapling = 1 },
770
809
sounds = default .node_sound_leaves_defaults (),
810
+
811
+ on_construct = function (pos )
812
+ minetest .get_node_timer (pos ):start (math.random (2400 ,4800 ))
813
+ end ,
814
+
815
+ on_place = function (itemstack , placer , pointed_thing )
816
+ itemstack = default .sapling_on_place (itemstack , placer , pointed_thing ,
817
+ " default:acacia_sapling" ,
818
+ -- minp, maxp to be checked, relative to sapling pos
819
+ -- minp_relative.y = 1 because sapling pos has been checked
820
+ {x = - 4 , y = 1 , z = - 4 },
821
+ {x = 4 , y = 6 , z = 4 },
822
+ -- maximum interval of interior volume check
823
+ 4 )
824
+
825
+ return itemstack
826
+ end ,
771
827
})
772
828
773
829
minetest .register_node (" default:aspen_tree" , {
@@ -824,17 +880,32 @@ minetest.register_node("default:aspen_sapling", {
824
880
sunlight_propagates = true ,
825
881
walkable = false ,
826
882
on_timer = default .grow_sapling ,
827
- on_construct = function (pos )
828
- minetest .get_node_timer (pos ):start (math.random (2400 ,4800 ))
829
- end ,
830
883
selection_box = {
831
884
type = " fixed" ,
832
885
fixed = {- 0.3 , - 0.5 , - 0.3 , 0.3 , 0.35 , 0.3 }
833
886
},
834
887
groups = {snappy = 2 , dig_immediate = 3 , flammable = 2 ,
835
888
attached_node = 1 , sapling = 1 },
836
889
sounds = default .node_sound_leaves_defaults (),
890
+
891
+ on_construct = function (pos )
892
+ minetest .get_node_timer (pos ):start (math.random (2400 ,4800 ))
893
+ end ,
894
+
895
+ on_place = function (itemstack , placer , pointed_thing )
896
+ itemstack = default .sapling_on_place (itemstack , placer , pointed_thing ,
897
+ " default:aspen_sapling" ,
898
+ -- minp, maxp to be checked, relative to sapling pos
899
+ -- minp_relative.y = 1 because sapling pos has been checked
900
+ {x = - 2 , y = 1 , z = - 2 },
901
+ {x = 2 , y = 12 , z = 2 },
902
+ -- maximum interval of interior volume check
903
+ 4 )
904
+
905
+ return itemstack
906
+ end ,
837
907
})
908
+
838
909
--
839
910
-- Ores
840
911
--
0 commit comments