-
Notifications
You must be signed in to change notification settings - Fork 2
/
nodes.lua
2957 lines (2620 loc) · 82.2 KB
/
nodes.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
-- mods/default/nodes.lua
-- support for MT game translation.
local S = default.get_translator
--[[ Node name convention:
Although many node names are in combined-word form, the required form for new
node names is words separated by underscores. If both forms are used in written
language (for example pinewood and pine wood) the underscore form should be used.
--]]
--[[ Index:
Stone
-----
(1. Material 2. Cobble variant 3. Brick variant 4. Modified forms)
default:stone
default:cobble
default:stonebrick
default:stone_block
default:mossycobble
default:desert_stone
default:desert_cobble
default:desert_stonebrick
default:desert_stone_block
default:sandstone
default:sandstonebrick
default:sandstone_block
default:desert_sandstone
default:desert_sandstone_brick
default:desert_sandstone_block
default:silver_sandstone
default:silver_sandstone_brick
default:silver_sandstone_block
default:obsidian
default:obsidianbrick
default:obsidian_block
Soft / Non-Stone
----------------
(1. Material 2. Modified forms)
default:dirt
default:dirt_with_grass
default:dirt_with_grass_footsteps
default:dirt_with_dry_grass
default:dirt_with_snow
default:dirt_with_rainforest_litter
default:dirt_with_coniferous_litter
default:dry_dirt
default:dry_dirt_with_dry_grass
default:permafrost
default:permafrost_with_stones
default:permafrost_with_moss
default:sand
default:desert_sand
default:silver_sand
default:gravel
default:clay
default:snow
default:snowblock
default:ice
default:cave_ice
Trees
-----
(1. Trunk 2. Fabricated trunk 3. Leaves 4. Sapling 5. Fruits)
default:tree
default:wood
default:leaves
default:sapling
default:apple
default:jungletree
default:junglewood
default:jungleleaves
default:junglesapling
default:emergent_jungle_sapling
default:pine_tree
default:pine_wood
default:pine_needles
default:pine_sapling
default:acacia_tree
default:acacia_wood
default:acacia_leaves
default:acacia_sapling
default:aspen_tree
default:aspen_wood
default:aspen_leaves
default:aspen_sapling
Ores
----
(1. In stone 2. Blocks)
default:stone_with_coal
default:coalblock
default:stone_with_iron
default:steelblock
default:stone_with_copper
default:copperblock
default:stone_with_tin
default:tinblock
default:bronzeblock
default:stone_with_gold
default:goldblock
default:stone_with_mese
default:mese
default:stone_with_diamond
default:diamondblock
Plantlife
---------
default:cactus
default:large_cactus_seedling
default:papyrus
default:dry_shrub
default:junglegrass
default:grass_1
default:grass_2
default:grass_3
default:grass_4
default:grass_5
default:dry_grass_1
default:dry_grass_2
default:dry_grass_3
default:dry_grass_4
default:dry_grass_5
default:fern_1
default:fern_2
default:fern_3
default:marram_grass_1
default:marram_grass_2
default:marram_grass_3
default:bush_stem
default:bush_leaves
default:bush_sapling
default:acacia_bush_stem
default:acacia_bush_leaves
default:acacia_bush_sapling
default:pine_bush_stem
default:pine_bush_needles
default:pine_bush_sapling
default:blueberry_bush_leaves_with_berries
default:blueberry_bush_leaves
default:blueberry_bush_sapling
default:sand_with_kelp
Corals
------
default:coral_green
default:coral_pink
default:coral_cyan
default:coral_brown
default:coral_orange
default:coral_skeleton
Liquids
-------
(1. Source 2. Flowing)
default:water_source
default:water_flowing
default:river_water_source
default:river_water_flowing
default:lava_source
default:lava_flowing
Tools / "Advanced" crafting / Non-"natural"
-------------------------------------------
default:bookshelf
default:sign_wall_wood
default:sign_wall_steel
default:ladder_wood
default:ladder_steel
default:fence_wood
default:fence_acacia_wood
default:fence_junglewood
default:fence_pine_wood
default:fence_aspen_wood
default:fence_rail_wood
default:fence_rail_acacia_wood
default:fence_rail_junglewood
default:fence_rail_pine_wood
default:fence_rail_aspen_wood
default:glass
default:obsidian_glass
default:brick
default:meselamp
default:mese_post_light
default:mese_post_light_acacia_wood
default:mese_post_light_junglewood
default:mese_post_light_pine_wood
default:mese_post_light_aspen_wood
Misc
----
default:cloud
--]]
-- Required wrapper to allow customization of default.after_place_leaves
local function after_place_leaves(...)
return default.after_place_leaves(...)
end
-- Required wrapper to allow customization of default.grow_sapling
local function grow_sapling(...)
return default.grow_sapling(...)
end
--
-- Stone
--
minetest.register_node("default:stone", {
description = S("Stone"),
tiles = {"default_stone.png"},
groups = {cracky = 3, stone = 1},
drop = "default:cobble",
legacy_mineral = true,
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:cobble", {
description = S("Cobblestone"),
tiles = {"default_cobble.png"},
is_ground_content = false,
groups = {cracky = 3, stone = 2},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:stonebrick", {
description = S("Stone Brick"),
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"default_stone_brick.png"},
is_ground_content = false,
groups = {cracky = 2, stone = 1},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:stone_block", {
description = S("Stone Block"),
tiles = {"default_stone_block.png"},
is_ground_content = false,
groups = {cracky = 2, stone = 1},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:mossycobble", {
description = S("Mossy Cobblestone"),
tiles = {"default_mossycobble.png"},
is_ground_content = false,
groups = {cracky = 3, stone = 1},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:desert_stone", {
description = S("Desert Stone"),
tiles = {"default_desert_stone.png"},
groups = {cracky = 3, stone = 1},
drop = "default:desert_cobble",
legacy_mineral = true,
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:desert_cobble", {
description = S("Desert Cobblestone"),
tiles = {"default_desert_cobble.png"},
is_ground_content = false,
groups = {cracky = 3, stone = 2},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:desert_stonebrick", {
description = S("Desert Stone Brick"),
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"default_desert_stone_brick.png"},
is_ground_content = false,
groups = {cracky = 2, stone = 1},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:desert_stone_block", {
description = S("Desert Stone Block"),
tiles = {"default_desert_stone_block.png"},
is_ground_content = false,
groups = {cracky = 2, stone = 1},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:sandstone", {
description = S("Sandstone"),
tiles = {"default_sandstone.png"},
groups = {crumbly = 1, cracky = 3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:sandstonebrick", {
description = S("Sandstone Brick"),
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"default_sandstone_brick.png"},
is_ground_content = false,
groups = {cracky = 2},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:sandstone_block", {
description = S("Sandstone Block"),
tiles = {"default_sandstone_block.png"},
is_ground_content = false,
groups = {cracky = 2},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:desert_sandstone", {
description = S("Desert Sandstone"),
tiles = {"default_desert_sandstone.png"},
groups = {crumbly = 1, cracky = 3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:desert_sandstone_brick", {
description = S("Desert Sandstone Brick"),
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"default_desert_sandstone_brick.png"},
is_ground_content = false,
groups = {cracky = 2},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:desert_sandstone_block", {
description = S("Desert Sandstone Block"),
tiles = {"default_desert_sandstone_block.png"},
is_ground_content = false,
groups = {cracky = 2},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:silver_sandstone", {
description = S("Silver Sandstone"),
tiles = {"default_silver_sandstone.png"},
groups = {crumbly = 1, cracky = 3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:silver_sandstone_brick", {
description = S("Silver Sandstone Brick"),
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"default_silver_sandstone_brick.png"},
is_ground_content = false,
groups = {cracky = 2},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:silver_sandstone_block", {
description = S("Silver Sandstone Block"),
tiles = {"default_silver_sandstone_block.png"},
is_ground_content = false,
groups = {cracky = 2},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:obsidian", {
description = S("Obsidian"),
tiles = {"default_obsidian.png"},
sounds = default.node_sound_stone_defaults(),
groups = {cracky = 1, level = 2},
})
minetest.register_node("default:obsidianbrick", {
description = S("Obsidian Brick"),
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"default_obsidian_brick.png"},
is_ground_content = false,
sounds = default.node_sound_stone_defaults(),
groups = {cracky = 1, level = 2},
})
minetest.register_node("default:obsidian_block", {
description = S("Obsidian Block"),
tiles = {"default_obsidian_block.png"},
is_ground_content = false,
sounds = default.node_sound_stone_defaults(),
groups = {cracky = 1, level = 2},
})
--
-- Soft / Non-Stone
--
minetest.register_node("default:dirt", {
description = S("Dirt"),
tiles = {"default_dirt.png"},
groups = {crumbly = 3, soil = 1},
sounds = default.node_sound_dirt_defaults(),
})
minetest.register_node("default:dirt_with_grass", {
description = S("Dirt with Grass"),
tiles = {"default_grass.png", "default_dirt.png",
{name = "default_dirt.png^default_grass_side.png",
tileable_vertical = false}},
groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
drop = "default:dirt",
sounds = default.node_sound_dirt_defaults({
footstep = {name = "default_grass_footstep", gain = 0.25},
}),
})
minetest.register_node("default:dirt_with_grass_footsteps", {
description = S("Dirt with Grass and Footsteps"),
tiles = {"default_grass.png^default_footprint.png", "default_dirt.png",
{name = "default_dirt.png^default_grass_side.png",
tileable_vertical = false}},
groups = {crumbly = 3, soil = 1, not_in_creative_inventory = 1},
drop = "default:dirt",
sounds = default.node_sound_dirt_defaults({
footstep = {name = "default_grass_footstep", gain = 0.25},
}),
})
minetest.register_node("default:dirt_with_dry_grass", {
description = S("Dirt with Savanna Grass"),
tiles = {"default_dry_grass.png",
"default_dirt.png",
{name = "default_dirt.png^default_dry_grass_side.png",
tileable_vertical = false}},
groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
drop = "default:dirt",
sounds = default.node_sound_dirt_defaults({
footstep = {name = "default_grass_footstep", gain = 0.4},
}),
})
minetest.register_node("default:dirt_with_snow", {
description = S("Dirt with Snow"),
tiles = {"default_snow.png", "default_dirt.png",
{name = "default_dirt.png^default_snow_side.png",
tileable_vertical = false}},
groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1, snowy = 1},
drop = "default:dirt",
sounds = default.node_sound_dirt_defaults({
footstep = {name = "default_snow_footstep", gain = 0.2},
}),
})
minetest.register_node("default:dirt_with_rainforest_litter", {
description = S("Dirt with Rainforest Litter"),
tiles = {
"default_rainforest_litter.png",
"default_dirt.png",
{name = "default_dirt.png^default_rainforest_litter_side.png",
tileable_vertical = false}
},
groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
drop = "default:dirt",
sounds = default.node_sound_dirt_defaults({
footstep = {name = "default_grass_footstep", gain = 0.4},
}),
})
minetest.register_node("default:dirt_with_coniferous_litter", {
description = S("Dirt with Coniferous Litter"),
tiles = {
"default_coniferous_litter.png",
"default_dirt.png",
{name = "default_dirt.png^default_coniferous_litter_side.png",
tileable_vertical = false}
},
groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
drop = "default:dirt",
sounds = default.node_sound_dirt_defaults({
footstep = {name = "default_grass_footstep", gain = 0.4},
}),
})
minetest.register_node("default:dry_dirt", {
description = S("Savanna Dirt"),
tiles = {"default_dry_dirt.png"},
groups = {crumbly = 3, soil = 1},
sounds = default.node_sound_dirt_defaults(),
})
minetest.register_node("default:dry_dirt_with_dry_grass", {
description = S("Savanna Dirt with Savanna Grass"),
tiles = {"default_dry_grass.png", "default_dry_dirt.png",
{name = "default_dry_dirt.png^default_dry_grass_side.png",
tileable_vertical = false}},
groups = {crumbly = 3, soil = 1},
drop = "default:dry_dirt",
sounds = default.node_sound_dirt_defaults({
footstep = {name = "default_grass_footstep", gain = 0.4},
}),
})
minetest.register_node("default:permafrost", {
description = S("Permafrost"),
tiles = {"default_permafrost.png"},
groups = {cracky = 3},
sounds = default.node_sound_dirt_defaults(),
})
minetest.register_node("default:permafrost_with_stones", {
description = S("Permafrost with Stones"),
tiles = {"default_permafrost.png^default_stones.png",
"default_permafrost.png",
"default_permafrost.png^default_stones_side.png"},
groups = {cracky = 3},
sounds = default.node_sound_gravel_defaults(),
})
minetest.register_node("default:permafrost_with_moss", {
description = S("Permafrost with Moss"),
tiles = {"default_moss.png", "default_permafrost.png",
{name = "default_permafrost.png^default_moss_side.png",
tileable_vertical = false}},
groups = {cracky = 3},
sounds = default.node_sound_dirt_defaults({
footstep = {name = "default_grass_footstep", gain = 0.25},
}),
})
minetest.register_node("default:sand", {
description = S("Sand"),
tiles = {"default_sand.png"},
groups = {crumbly = 3, falling_node = 1, sand = 1},
sounds = default.node_sound_sand_defaults(),
})
minetest.register_node("default:desert_sand", {
description = S("Desert Sand"),
tiles = {"default_desert_sand.png"},
groups = {crumbly = 3, falling_node = 1, sand = 1},
sounds = default.node_sound_sand_defaults(),
})
minetest.register_node("default:silver_sand", {
description = S("Silver Sand"),
tiles = {"default_silver_sand.png"},
groups = {crumbly = 3, falling_node = 1, sand = 1},
sounds = default.node_sound_sand_defaults(),
})
minetest.register_node("default:gravel", {
description = S("Gravel"),
tiles = {"default_gravel.png"},
groups = {crumbly = 2, falling_node = 1},
sounds = default.node_sound_gravel_defaults(),
drop = {
max_items = 1,
items = {
{items = {"default:flint"}, rarity = 16},
{items = {"default:gravel"}}
}
}
})
minetest.register_node("default:clay", {
description = S("Clay"),
tiles = {"default_clay.png"},
groups = {crumbly = 3},
drop = "default:clay_lump 4",
sounds = default.node_sound_dirt_defaults(),
})
minetest.register_node("default:snow", {
description = S("Snow"),
tiles = {"default_snow.png"},
inventory_image = "default_snowball.png",
wield_image = "default_snowball.png",
paramtype = "light",
buildable_to = true,
floodable = true,
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
},
},
collision_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, -6 / 16, 0.5},
},
},
groups = {crumbly = 3, falling_node = 1, snowy = 1},
sounds = default.node_sound_snow_defaults(),
on_construct = function(pos)
pos.y = pos.y - 1
if minetest.get_node(pos).name == "default:dirt_with_grass" then
minetest.set_node(pos, {name = "default:dirt_with_snow"})
end
end,
})
minetest.register_node("default:snowblock", {
description = S("Snow Block"),
tiles = {"default_snow.png"},
groups = {crumbly = 3, cools_lava = 1, snowy = 1},
sounds = default.node_sound_snow_defaults(),
on_construct = function(pos)
pos.y = pos.y - 1
if minetest.get_node(pos).name == "default:dirt_with_grass" then
minetest.set_node(pos, {name = "default:dirt_with_snow"})
end
end,
})
-- 'is ground content = false' to avoid tunnels in sea ice or ice rivers
minetest.register_node("default:ice", {
description = S("Ice"),
tiles = {"default_ice.png"},
is_ground_content = false,
paramtype = "light",
groups = {cracky = 3, cools_lava = 1, slippery = 3},
sounds = default.node_sound_ice_defaults(),
})
-- Mapgen-placed ice with 'is ground content = true' to contain tunnels
minetest.register_node("default:cave_ice", {
description = S("Cave Ice"),
tiles = {"default_ice.png"},
paramtype = "light",
groups = {cracky = 3, cools_lava = 1, slippery = 3,
not_in_creative_inventory = 1},
drop = "default:ice",
sounds = default.node_sound_ice_defaults(),
})
--
-- Trees
--
minetest.register_node("default:tree", {
description = S("Apple Tree"),
tiles = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"},
paramtype2 = "facedir",
is_ground_content = false,
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node
})
minetest.register_node("default:wood", {
description = S("Apple Wood Planks"),
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"default_wood.png"},
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("default:sapling", {
description = S("Apple Tree Sapling"),
drawtype = "plantlike",
tiles = {"default_sapling.png"},
inventory_image = "default_sapling.png",
wield_image = "default_sapling.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
on_timer = grow_sapling,
selection_box = {
type = "fixed",
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
},
groups = {snappy = 2, dig_immediate = 3, flammable = 2,
attached_node = 1, sapling = 1},
sounds = default.node_sound_leaves_defaults(),
on_construct = function(pos)
minetest.get_node_timer(pos):start(math.random(300, 1500))
end,
on_place = function(itemstack, placer, pointed_thing)
itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
"default:sapling",
-- minp, maxp to be checked, relative to sapling pos
-- minp_relative.y = 1 because sapling pos has been checked
{x = -3, y = 1, z = -3},
{x = 3, y = 6, z = 3},
-- maximum interval of interior volume check
4)
return itemstack
end,
})
minetest.register_node("default:leaves", {
description = S("Apple Tree Leaves"),
drawtype = "allfaces_optional",
waving = 1,
tiles = {"default_leaves.png"},
special_tiles = {"default_leaves_simple.png"},
paramtype = "light",
is_ground_content = false,
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
drop = {
max_items = 1,
items = {
{
-- player will get sapling with 1/20 chance
items = {"default:sapling"},
rarity = 20,
},
{
-- player will get leaves only if he get no saplings,
-- this is because max_items is 1
items = {"default:leaves"},
}
}
},
sounds = default.node_sound_leaves_defaults(),
after_place_node = after_place_leaves,
})
minetest.register_node("default:apple", {
description = S("Apple"),
drawtype = "plantlike",
tiles = {"default_apple.png"},
inventory_image = "default_apple.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
is_ground_content = false,
selection_box = {
type = "fixed",
fixed = {-3 / 16, -7 / 16, -3 / 16, 3 / 16, 4 / 16, 3 / 16}
},
groups = {fleshy = 3, dig_immediate = 3, flammable = 2,
leafdecay = 3, leafdecay_drop = 1, food_apple = 1},
on_use = minetest.item_eat(2),
sounds = default.node_sound_leaves_defaults(),
after_place_node = function(pos, placer, itemstack)
minetest.set_node(pos, {name = "default:apple", param2 = 1})
end,
after_dig_node = function(pos, oldnode, oldmetadata, digger)
if oldnode.param2 == 0 then
minetest.set_node(pos, {name = "default:apple_mark"})
minetest.get_node_timer(pos):start(math.random(300, 1500))
end
end,
})
minetest.register_node("default:apple_mark", {
description = S("Apple Marker"),
inventory_image = "default_apple.png^default_invisible_node_overlay.png",
wield_image = "default_apple.png^default_invisible_node_overlay.png",
drawtype = "airlike",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
groups = {not_in_creative_inventory = 1},
on_timer = function(pos, elapsed)
if not minetest.find_node_near(pos, 1, "default:leaves") then
minetest.remove_node(pos)
elseif minetest.get_node_light(pos) < 11 then
minetest.get_node_timer(pos):start(200)
else
minetest.set_node(pos, {name = "default:apple"})
end
end
})
minetest.register_node("default:jungletree", {
description = S("Jungle Tree"),
tiles = {"default_jungletree_top.png", "default_jungletree_top.png",
"default_jungletree.png"},
paramtype2 = "facedir",
is_ground_content = false,
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node
})
minetest.register_node("default:junglewood", {
description = S("Jungle Wood Planks"),
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"default_junglewood.png"},
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("default:jungleleaves", {
description = S("Jungle Tree Leaves"),
drawtype = "allfaces_optional",
waving = 1,
tiles = {"default_jungleleaves.png"},
special_tiles = {"default_jungleleaves_simple.png"},
paramtype = "light",
is_ground_content = false,
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
drop = {
max_items = 1,
items = {
{items = {"default:junglesapling"}, rarity = 20},
{items = {"default:jungleleaves"}}
}
},
sounds = default.node_sound_leaves_defaults(),
after_place_node = after_place_leaves,
})
minetest.register_node("default:junglesapling", {
description = S("Jungle Tree Sapling"),
drawtype = "plantlike",
tiles = {"default_junglesapling.png"},
inventory_image = "default_junglesapling.png",
wield_image = "default_junglesapling.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
on_timer = grow_sapling,
selection_box = {
type = "fixed",
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
},
groups = {snappy = 2, dig_immediate = 3, flammable = 2,
attached_node = 1, sapling = 1},
sounds = default.node_sound_leaves_defaults(),
on_construct = function(pos)
minetest.get_node_timer(pos):start(math.random(300, 1500))
end,
on_place = function(itemstack, placer, pointed_thing)
itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
"default:junglesapling",
-- minp, maxp to be checked, relative to sapling pos
-- minp_relative.y = 1 because sapling pos has been checked
{x = -2, y = 1, z = -2},
{x = 2, y = 15, z = 2},
-- maximum interval of interior volume check
4)
return itemstack
end,
})
minetest.register_node("default:emergent_jungle_sapling", {
description = S("Emergent Jungle Tree Sapling"),
drawtype = "plantlike",
tiles = {"default_emergent_jungle_sapling.png"},
inventory_image = "default_emergent_jungle_sapling.png",
wield_image = "default_emergent_jungle_sapling.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
on_timer = grow_sapling,
selection_box = {
type = "fixed",
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
},
groups = {snappy = 2, dig_immediate = 3, flammable = 2,
attached_node = 1, sapling = 1},
sounds = default.node_sound_leaves_defaults(),
on_construct = function(pos)
minetest.get_node_timer(pos):start(math.random(300, 1500))
end,
on_place = function(itemstack, placer, pointed_thing)
itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
"default:emergent_jungle_sapling",
-- minp, maxp to be checked, relative to sapling pos
{x = -3, y = -5, z = -3},
{x = 3, y = 31, z = 3},
-- maximum interval of interior volume check
4)
return itemstack
end,
})
minetest.register_node("default:pine_tree", {
description = S("Pine Tree"),
tiles = {"default_pine_tree_top.png", "default_pine_tree_top.png",
"default_pine_tree.png"},
paramtype2 = "facedir",
is_ground_content = false,
groups = {tree = 1, choppy = 3, oddly_breakable_by_hand = 1, flammable = 3},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node
})
minetest.register_node("default:pine_wood", {
description = S("Pine Wood Planks"),
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"default_pine_wood.png"},
is_ground_content = false,
groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("default:pine_needles",{
description = S("Pine Needles"),
drawtype = "allfaces_optional",
tiles = {"default_pine_needles.png"},
waving = 1,
paramtype = "light",
is_ground_content = false,
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
drop = {
max_items = 1,
items = {
{items = {"default:pine_sapling"}, rarity = 20},
{items = {"default:pine_needles"}}
}
},
sounds = default.node_sound_leaves_defaults(),
after_place_node = after_place_leaves,
})
minetest.register_node("default:pine_sapling", {
description = S("Pine Tree Sapling"),
drawtype = "plantlike",
tiles = {"default_pine_sapling.png"},
inventory_image = "default_pine_sapling.png",
wield_image = "default_pine_sapling.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
on_timer = grow_sapling,
selection_box = {
type = "fixed",
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}