Default: Remove unnecessary leaf 'visual scale'
[oweals/minetest_game.git] / mods / default / nodes.lua
1 -- mods/default/nodes.lua
2
3
4 --[[ Node name convention:
5
6 Although many node names are in combined-word form, the required form for new
7 node names is words separated by underscores. If both forms are used in written
8 language (for example pinewood and pine wood) the underscore form should be used.
9
10 --]]
11
12
13 --[[ Index:
14
15 Stone
16 -----
17 (1. Material 2. Cobble variant 3. Brick variant 4. Modified forms)
18
19 default:stone
20 default:cobble
21 default:stonebrick
22 default:stone_block
23 default:mossycobble
24
25 default:desert_stone
26 default:desert_cobble
27 default:desert_stonebrick
28 default:desert_stone_block
29
30 default:sandstone
31 default:sandstonebrick
32 default:sandstone_block
33
34 default:obsidian
35 default:obsidianbrick
36 default:obsidian_block
37
38 Soft / Non-Stone
39 ----------------
40 (1. Material 2. Modified forms)
41
42 default:dirt
43 default:dirt_with_grass
44 default:dirt_with_grass_footsteps
45 default:dirt_with_dry_grass
46 default:dirt_with_snow
47
48 default:sand
49 default:desert_sand
50 default:silver_sand
51
52 default:gravel
53
54 default:clay
55
56 default:snow
57 default:snowblock
58
59 default:ice
60
61 Trees
62 -----
63 (1. Trunk 2. Fabricated trunk 3. Leaves 4. Sapling 5. Fruits)
64
65 default:tree
66 default:wood
67 default:leaves
68 default:sapling
69 default:apple
70
71 default:jungletree
72 default:junglewood
73 default:jungleleaves
74 default:junglesapling
75
76 default:pine_tree
77 default:pine_wood
78 default:pine_needles
79 default:pine_sapling
80
81 default:acacia_tree
82 default:acacia_wood
83 default:acacia_leaves
84 default:acacia_sapling
85
86 default:aspen_tree
87 default:aspen_wood
88 default:aspen_leaves
89 default:aspen_sapling
90
91 Ores
92 ----
93 (1. In stone 2. Blocks)
94
95 default:stone_with_coal
96 default:coalblock
97
98 default:stone_with_iron
99 default:steelblock
100
101 default:stone_with_copper
102 default:copperblock
103 default:bronzeblock
104
105 default:stone_with_gold
106 default:goldblock
107
108 default:stone_with_mese
109 default:mese
110
111 default:stone_with_diamond
112 default:diamondblock
113
114 Plantlife
115 ---------
116
117 default:cactus
118 default:papyrus
119 default:dry_shrub
120 default:junglegrass
121
122 default:grass_1
123 default:grass_2
124 default:grass_3
125 default:grass_4
126 default:grass_5
127
128 default:dry_grass_1
129 default:dry_grass_2
130 default:dry_grass_3
131 default:dry_grass_4
132 default:dry_grass_5
133
134 default:bush_stem
135 default:bush_leaves
136 default:acacia_bush_stem
137 default:acacia_bush_leaves
138
139 Corals
140 ------
141
142 default:coral_brown
143 default:coral_orange
144 default:coral_skeleton
145
146 Liquids
147 -------
148 (1. Source 2. Flowing)
149
150 default:water_source
151 default:water_flowing
152
153 default:river_water_source
154 default:river_water_flowing
155
156 default:lava_source
157 default:lava_flowing
158
159 Tools / "Advanced" crafting / Non-"natural"
160 -------------------------------------------
161
162 default:torch
163
164 default:chest
165 default:chest_locked
166
167 default:bookshelf
168
169 default:sign_wall_wood
170 default:sign_wall_steel
171
172 default:ladder_wood
173 default:ladder_steel
174
175 default:fence_wood
176 default:fence_acacia_wood
177 default:fence_junglewood
178 default:fence_pine_wood
179 default:fence_aspen_wood
180
181 default:glass
182 default:obsidian_glass
183
184 default:rail
185
186 default:brick
187
188 default:meselamp
189
190 Misc
191 ----
192
193 default:cloud
194
195 --]]
196
197 --
198 -- Stone
199 --
200
201 minetest.register_node("default:stone", {
202         description = "Stone",
203         tiles = {"default_stone.png"},
204         groups = {cracky = 3, stone = 1},
205         drop = 'default:cobble',
206         legacy_mineral = true,
207         sounds = default.node_sound_stone_defaults(),
208 })
209
210 minetest.register_node("default:cobble", {
211         description = "Cobblestone",
212         tiles = {"default_cobble.png"},
213         is_ground_content = false,
214         groups = {cracky = 3, stone = 2},
215         sounds = default.node_sound_stone_defaults(),
216 })
217
218 minetest.register_node("default:stonebrick", {
219         description = "Stone Brick",
220         paramtype2 = "facedir",
221         place_param2 = 0,
222         tiles = {"default_stone_brick.png"},
223         is_ground_content = false,
224         groups = {cracky = 2, stone = 1},
225         sounds = default.node_sound_stone_defaults(),
226 })
227
228 minetest.register_node("default:stone_block", {
229         description = "Stone Block",
230         tiles = {"default_stone_block.png"},
231         is_ground_content = false,
232         groups = {cracky = 2, stone = 1},
233         sounds = default.node_sound_stone_defaults(),
234 })
235
236 minetest.register_node("default:mossycobble", {
237         description = "Mossy Cobblestone",
238         tiles = {"default_mossycobble.png"},
239         is_ground_content = false,
240         groups = {cracky = 3, stone = 1},
241         sounds = default.node_sound_stone_defaults(),
242 })
243
244
245 minetest.register_node("default:desert_stone", {
246         description = "Desert Stone",
247         tiles = {"default_desert_stone.png"},
248         groups = {cracky = 3, stone = 1},
249         drop = 'default:desert_cobble',
250         legacy_mineral = true,
251         sounds = default.node_sound_stone_defaults(),
252 })
253
254 minetest.register_node("default:desert_cobble", {
255         description = "Desert Cobblestone",
256         tiles = {"default_desert_cobble.png"},
257         is_ground_content = false,
258         groups = {cracky = 3, stone = 2},
259         sounds = default.node_sound_stone_defaults(),
260 })
261
262 minetest.register_node("default:desert_stonebrick", {
263         description = "Desert Stone Brick",
264         paramtype2 = "facedir",
265         place_param2 = 0,
266         tiles = {"default_desert_stone_brick.png"},
267         is_ground_content = false,
268         groups = {cracky = 2, stone = 1},
269         sounds = default.node_sound_stone_defaults(),
270 })
271
272 minetest.register_node("default:desert_stone_block", {
273         description = "Desert Stone Block",
274         tiles = {"default_desert_stone_block.png"},
275         is_ground_content = false,
276         groups = {cracky = 2, stone = 1},
277         sounds = default.node_sound_stone_defaults(),
278 })
279
280
281 minetest.register_node("default:sandstone", {
282         description = "Sandstone",
283         tiles = {"default_sandstone.png"},
284         groups = {crumbly = 1, cracky = 3},
285         sounds = default.node_sound_stone_defaults(),
286 })
287
288 minetest.register_node("default:sandstonebrick", {
289         description = "Sandstone Brick",
290         paramtype2 = "facedir",
291         place_param2 = 0,
292         tiles = {"default_sandstone_brick.png"},
293         is_ground_content = false,
294         groups = {cracky = 2},
295         sounds = default.node_sound_stone_defaults(),
296 })
297
298 minetest.register_node("default:sandstone_block", {
299         description = "Sandstone Block",
300         tiles = {"default_sandstone_block.png"},
301         is_ground_content = false,
302         groups = {cracky = 2},
303         sounds = default.node_sound_stone_defaults(),
304 })
305
306
307 minetest.register_node("default:obsidian", {
308         description = "Obsidian",
309         tiles = {"default_obsidian.png"},
310         sounds = default.node_sound_stone_defaults(),
311         groups = {cracky = 1, level = 2},
312 })
313
314 minetest.register_node("default:obsidianbrick", {
315         description = "Obsidian Brick",
316         paramtype2 = "facedir",
317         place_param2 = 0,
318         tiles = {"default_obsidian_brick.png"},
319         is_ground_content = false,
320         sounds = default.node_sound_stone_defaults(),
321         groups = {cracky = 1, level = 2},
322 })
323
324 minetest.register_node("default:obsidian_block", {
325         description = "Obsidian Block",
326         tiles = {"default_obsidian_block.png"},
327         is_ground_content = false,
328         sounds = default.node_sound_stone_defaults(),
329         groups = {cracky = 1, level = 2},
330 })
331
332 --
333 -- Soft / Non-Stone
334 --
335
336 minetest.register_node("default:dirt", {
337         description = "Dirt",
338         tiles = {"default_dirt.png"},
339         groups = {crumbly = 3, soil = 1},
340         sounds = default.node_sound_dirt_defaults(),
341 })
342
343 minetest.register_node("default:dirt_with_grass", {
344         description = "Dirt with Grass",
345         tiles = {"default_grass.png", "default_dirt.png",
346                 {name = "default_dirt.png^default_grass_side.png",
347                         tileable_vertical = false}},
348         groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
349         drop = 'default:dirt',
350         sounds = default.node_sound_dirt_defaults({
351                 footstep = {name = "default_grass_footstep", gain = 0.25},
352         }),
353 })
354
355 minetest.register_node("default:dirt_with_grass_footsteps", {
356         description = "Dirt with Grass and Footsteps",
357         tiles = {"default_grass.png^default_footprint.png", "default_dirt.png",
358                 {name = "default_dirt.png^default_grass_side.png",
359                         tileable_vertical = false}},
360         groups = {crumbly = 3, soil = 1, not_in_creative_inventory = 1},
361         drop = 'default:dirt',
362         sounds = default.node_sound_dirt_defaults({
363                 footstep = {name = "default_grass_footstep", gain = 0.25},
364         }),
365 })
366
367 minetest.register_node("default:dirt_with_dry_grass", {
368         description = "Dirt with Dry Grass",
369         tiles = {"default_dry_grass.png",
370                 "default_dirt.png",
371                 {name = "default_dirt.png^default_dry_grass_side.png",
372                         tileable_vertical = false}},
373         groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
374         drop = 'default:dirt',
375         sounds = default.node_sound_dirt_defaults({
376                 footstep = {name = "default_grass_footstep", gain = 0.4},
377         }),
378 })
379
380 minetest.register_node("default:dirt_with_snow", {
381         description = "Dirt with Snow",
382         tiles = {"default_snow.png", "default_dirt.png",
383                 {name = "default_dirt.png^default_snow_side.png",
384                         tileable_vertical = false}},
385         groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
386         drop = 'default:dirt',
387         sounds = default.node_sound_dirt_defaults({
388                 footstep = {name = "default_snow_footstep", gain = 0.15},
389         }),
390 })
391
392 minetest.register_node("default:sand", {
393         description = "Sand",
394         tiles = {"default_sand.png"},
395         groups = {crumbly = 3, falling_node = 1, sand = 1},
396         sounds = default.node_sound_sand_defaults(),
397 })
398
399 minetest.register_node("default:desert_sand", {
400         description = "Desert Sand",
401         tiles = {"default_desert_sand.png"},
402         groups = {crumbly = 3, falling_node = 1, sand = 1},
403         sounds = default.node_sound_sand_defaults(),
404 })
405
406 minetest.register_node("default:silver_sand", {
407         description = "Silver Sand",
408         tiles = {"default_silver_sand.png"},
409         groups = {crumbly = 3, falling_node = 1, sand = 1},
410         sounds = default.node_sound_sand_defaults(),
411 })
412
413
414 minetest.register_node("default:gravel", {
415         description = "Gravel",
416         tiles = {"default_gravel.png"},
417         groups = {crumbly = 2, falling_node = 1},
418         sounds = default.node_sound_gravel_defaults(),
419         drop = {
420                 max_items = 1,
421                 items = {
422                         {items = {'default:flint'}, rarity = 16},
423                         {items = {'default:gravel'}}
424                 }
425         }
426 })
427
428 minetest.register_node("default:clay", {
429         description = "Clay",
430         tiles = {"default_clay.png"},
431         groups = {crumbly = 3},
432         drop = 'default:clay_lump 4',
433         sounds = default.node_sound_dirt_defaults(),
434 })
435
436
437 minetest.register_node("default:snow", {
438         description = "Snow",
439         tiles = {"default_snow.png"},
440         inventory_image = "default_snowball.png",
441         wield_image = "default_snowball.png",
442         paramtype = "light",
443         buildable_to = true,
444         floodable = true,
445         walkable = false,
446         drawtype = "nodebox",
447         node_box = {
448                 type = "fixed",
449                 fixed = {
450                         {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
451                 },
452         },
453         groups = {crumbly = 3, falling_node = 1, puts_out_fire = 1},
454         sounds = default.node_sound_dirt_defaults({
455                 footstep = {name = "default_snow_footstep", gain = 0.15},
456                 dug = {name = "default_snow_footstep", gain = 0.2},
457                 dig = {name = "default_snow_footstep", gain = 0.2}
458         }),
459
460         on_construct = function(pos)
461                 pos.y = pos.y - 1
462                 if minetest.get_node(pos).name == "default:dirt_with_grass" then
463                         minetest.set_node(pos, {name = "default:dirt_with_snow"})
464                 end
465         end,
466 })
467
468 minetest.register_node("default:snowblock", {
469         description = "Snow Block",
470         tiles = {"default_snow.png"},
471         groups = {crumbly = 3, puts_out_fire = 1},
472         sounds = default.node_sound_dirt_defaults({
473                 footstep = {name = "default_snow_footstep", gain = 0.15},
474                 dug = {name = "default_snow_footstep", gain = 0.2},
475                 dig = {name = "default_snow_footstep", gain = 0.2}
476         }),
477 })
478
479 minetest.register_node("default:ice", {
480         description = "Ice",
481         tiles = {"default_ice.png"},
482         is_ground_content = false,
483         paramtype = "light",
484         groups = {cracky = 3, puts_out_fire = 1},
485         sounds = default.node_sound_glass_defaults(),
486 })
487
488 --
489 -- Trees
490 --
491
492 minetest.register_node("default:tree", {
493         description = "Tree",
494         tiles = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"},
495         paramtype2 = "facedir",
496         is_ground_content = false,
497         groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
498         sounds = default.node_sound_wood_defaults(),
499
500         on_place = minetest.rotate_node
501 })
502
503 minetest.register_node("default:wood", {
504         description = "Wooden Planks",
505         paramtype2 = "facedir",
506         place_param2 = 0,
507         tiles = {"default_wood.png"},
508         is_ground_content = false,
509         groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
510         sounds = default.node_sound_wood_defaults(),
511 })
512
513 minetest.register_node("default:sapling", {
514         description = "Sapling",
515         drawtype = "plantlike",
516         visual_scale = 1.0,
517         tiles = {"default_sapling.png"},
518         inventory_image = "default_sapling.png",
519         wield_image = "default_sapling.png",
520         paramtype = "light",
521         sunlight_propagates = true,
522         walkable = false,
523         on_timer = default.grow_sapling,
524         selection_box = {
525                 type = "fixed",
526                 fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
527         },
528         groups = {snappy = 2, dig_immediate = 3, flammable = 2,
529                 attached_node = 1, sapling = 1},
530         sounds = default.node_sound_leaves_defaults(),
531
532         on_construct = function(pos)
533                 minetest.get_node_timer(pos):start(math.random(2400,4800))
534         end,
535
536         on_place = function(itemstack, placer, pointed_thing)
537                 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
538                         "default:sapling",
539                         -- minp, maxp to be checked, relative to sapling pos
540                         -- minp_relative.y = 1 because sapling pos has been checked
541                         {x = -2, y = 1, z = -2},
542                         {x = 2, y = 6, z = 2},
543                         -- maximum interval of interior volume check
544                         4)
545
546                 return itemstack
547         end,
548 })
549
550 minetest.register_node("default:leaves", {
551         description = "Leaves",
552         drawtype = "allfaces_optional",
553         waving = 1,
554         tiles = {"default_leaves.png"},
555         special_tiles = {"default_leaves_simple.png"},
556         paramtype = "light",
557         is_ground_content = false,
558         groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
559         drop = {
560                 max_items = 1,
561                 items = {
562                         {
563                                 -- player will get sapling with 1/20 chance
564                                 items = {'default:sapling'},
565                                 rarity = 20,
566                         },
567                         {
568                                 -- player will get leaves only if he get no saplings,
569                                 -- this is because max_items is 1
570                                 items = {'default:leaves'},
571                         }
572                 }
573         },
574         sounds = default.node_sound_leaves_defaults(),
575
576         after_place_node = default.after_place_leaves,
577 })
578
579 minetest.register_node("default:apple", {
580         description = "Apple",
581         drawtype = "plantlike",
582         visual_scale = 1.0,
583         tiles = {"default_apple.png"},
584         inventory_image = "default_apple.png",
585         paramtype = "light",
586         sunlight_propagates = true,
587         walkable = false,
588         is_ground_content = false,
589         selection_box = {
590                 type = "fixed",
591                 fixed = {-0.2, -0.5, -0.2, 0.2, 0, 0.2}
592         },
593         groups = {fleshy = 3, dig_immediate = 3, flammable = 2,
594                 leafdecay = 3, leafdecay_drop = 1},
595         on_use = minetest.item_eat(2),
596         sounds = default.node_sound_leaves_defaults(),
597
598         after_place_node = function(pos, placer, itemstack)
599                 if placer:is_player() then
600                         minetest.set_node(pos, {name = "default:apple", param2 = 1})
601                 end
602         end,
603 })
604
605
606 minetest.register_node("default:jungletree", {
607         description = "Jungle Tree",
608         tiles = {"default_jungletree_top.png", "default_jungletree_top.png",
609                 "default_jungletree.png"},
610         paramtype2 = "facedir",
611         is_ground_content = false,
612         groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
613         sounds = default.node_sound_wood_defaults(),
614
615         on_place = minetest.rotate_node
616 })
617
618 minetest.register_node("default:junglewood", {
619         description = "Junglewood Planks",
620         paramtype2 = "facedir",
621         place_param2 = 0,
622         tiles = {"default_junglewood.png"},
623         is_ground_content = false,
624         groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
625         sounds = default.node_sound_wood_defaults(),
626 })
627
628 minetest.register_node("default:jungleleaves", {
629         description = "Jungle Leaves",
630         drawtype = "allfaces_optional",
631         waving = 1,
632         tiles = {"default_jungleleaves.png"},
633         special_tiles = {"default_jungleleaves_simple.png"},
634         paramtype = "light",
635         is_ground_content = false,
636         groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
637         drop = {
638                 max_items = 1,
639                 items = {
640                         {items = {'default:junglesapling'}, rarity = 20},
641                         {items = {'default:jungleleaves'}}
642                 }
643         },
644         sounds = default.node_sound_leaves_defaults(),
645
646         after_place_node = default.after_place_leaves,
647 })
648
649 minetest.register_node("default:junglesapling", {
650         description = "Jungle Sapling",
651         drawtype = "plantlike",
652         visual_scale = 1.0,
653         tiles = {"default_junglesapling.png"},
654         inventory_image = "default_junglesapling.png",
655         wield_image = "default_junglesapling.png",
656         paramtype = "light",
657         sunlight_propagates = true,
658         walkable = false,
659         on_timer = default.grow_sapling,
660         selection_box = {
661                 type = "fixed",
662                 fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
663         },
664         groups = {snappy = 2, dig_immediate = 3, flammable = 2,
665                 attached_node = 1, sapling = 1},
666         sounds = default.node_sound_leaves_defaults(),
667
668         on_construct = function(pos)
669                 minetest.get_node_timer(pos):start(math.random(2400,4800))
670         end,
671
672         on_place = function(itemstack, placer, pointed_thing)
673                 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
674                         "default:junglesapling",
675                         -- minp, maxp to be checked, relative to sapling pos
676                         -- minp_relative.y = 1 because sapling pos has been checked
677                         {x = -2, y = 1, z = -2},
678                         {x = 2, y = 15, z = 2},
679                         -- maximum interval of interior volume check
680                         4)
681
682                 return itemstack
683         end,
684 })
685
686
687 minetest.register_node("default:pine_tree", {
688         description = "Pine Tree",
689         tiles = {"default_pine_tree_top.png", "default_pine_tree_top.png",
690                 "default_pine_tree.png"},
691         paramtype2 = "facedir",
692         is_ground_content = false,
693         groups = {tree = 1, choppy = 3, oddly_breakable_by_hand = 1, flammable = 3},
694         sounds = default.node_sound_wood_defaults(),
695
696         on_place = minetest.rotate_node
697 })
698
699 minetest.register_node("default:pine_wood", {
700         description = "Pine Wood Planks",
701         paramtype2 = "facedir",
702         place_param2 = 0,
703         tiles = {"default_pine_wood.png"},
704         is_ground_content = false,
705         groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
706         sounds = default.node_sound_wood_defaults(),
707 })
708
709 minetest.register_node("default:pine_needles",{
710         description = "Pine Needles",
711         drawtype = "allfaces_optional",
712         tiles = {"default_pine_needles.png"},
713         waving = 1,
714         paramtype = "light",
715         is_ground_content = false,
716         groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
717         drop = {
718                 max_items = 1,
719                 items = {
720                         {items = {"default:pine_sapling"}, rarity = 20},
721                         {items = {"default:pine_needles"}}
722                 }
723         },
724         sounds = default.node_sound_leaves_defaults(),
725
726         after_place_node = default.after_place_leaves,
727 })
728
729 minetest.register_node("default:pine_sapling", {
730         description = "Pine Sapling",
731         drawtype = "plantlike",
732         visual_scale = 1.0,
733         tiles = {"default_pine_sapling.png"},
734         inventory_image = "default_pine_sapling.png",
735         wield_image = "default_pine_sapling.png",
736         paramtype = "light",
737         sunlight_propagates = true,
738         walkable = false,
739         on_timer = default.grow_sapling,
740         selection_box = {
741                 type = "fixed",
742                 fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
743         },
744         groups = {snappy = 2, dig_immediate = 3, flammable = 3,
745                 attached_node = 1, sapling = 1},
746         sounds = default.node_sound_leaves_defaults(),
747
748         on_construct = function(pos)
749                 minetest.get_node_timer(pos):start(math.random(2400,4800))
750         end,
751
752         on_place = function(itemstack, placer, pointed_thing)
753                 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
754                         "default:pine_sapling",
755                         -- minp, maxp to be checked, relative to sapling pos
756                         -- minp_relative.y = 1 because sapling pos has been checked
757                         {x = -2, y = 1, z = -2},
758                         {x = 2, y = 12, z = 2},
759                         -- maximum interval of interior volume check
760                         4)
761
762                 return itemstack
763         end,
764 })
765
766
767 minetest.register_node("default:acacia_tree", {
768         description = "Acacia Tree",
769         tiles = {"default_acacia_tree_top.png", "default_acacia_tree_top.png",
770                 "default_acacia_tree.png"},
771         paramtype2 = "facedir",
772         is_ground_content = false,
773         groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
774         sounds = default.node_sound_wood_defaults(),
775
776         on_place = minetest.rotate_node
777 })
778
779 minetest.register_node("default:acacia_wood", {
780         description = "Acacia Wood Planks",
781         paramtype2 = "facedir",
782         place_param2 = 0,
783         tiles = {"default_acacia_wood.png"},
784         is_ground_content = false,
785         groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
786         sounds = default.node_sound_wood_defaults(),
787 })
788
789 minetest.register_node("default:acacia_leaves", {
790         description = "Acacia Leaves",
791         drawtype = "allfaces_optional",
792         tiles = {"default_acacia_leaves.png"},
793         waving = 1,
794         paramtype = "light",
795         is_ground_content = false,
796         groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
797         drop = {
798                 max_items = 1,
799                 items = {
800                         {items = {"default:acacia_sapling"}, rarity = 20},
801                         {items = {"default:acacia_leaves"}}
802                 }
803         },
804         sounds = default.node_sound_leaves_defaults(),
805
806         after_place_node = default.after_place_leaves,
807 })
808
809 minetest.register_node("default:acacia_sapling", {
810         description = "Acacia Tree Sapling",
811         drawtype = "plantlike",
812         visual_scale = 1.0,
813         tiles = {"default_acacia_sapling.png"},
814         inventory_image = "default_acacia_sapling.png",
815         wield_image = "default_acacia_sapling.png",
816         paramtype = "light",
817         sunlight_propagates = true,
818         walkable = false,
819         on_timer = default.grow_sapling,
820         selection_box = {
821                 type = "fixed",
822                 fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
823         },
824         groups = {snappy = 2, dig_immediate = 3, flammable = 2,
825                 attached_node = 1, sapling = 1},
826         sounds = default.node_sound_leaves_defaults(),
827
828         on_construct = function(pos)
829                 minetest.get_node_timer(pos):start(math.random(2400,4800))
830         end,
831
832         on_place = function(itemstack, placer, pointed_thing)
833                 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
834                         "default:acacia_sapling",
835                         -- minp, maxp to be checked, relative to sapling pos
836                         -- minp_relative.y = 1 because sapling pos has been checked
837                         {x = -4, y = 1, z = -4},
838                         {x = 4, y = 6, z = 4},
839                         -- maximum interval of interior volume check
840                         4)
841
842                 return itemstack
843         end,
844 })
845
846 minetest.register_node("default:aspen_tree", {
847         description = "Aspen Tree",
848         tiles = {"default_aspen_tree_top.png", "default_aspen_tree_top.png",
849                 "default_aspen_tree.png"},
850         paramtype2 = "facedir",
851         is_ground_content = false,
852         groups = {tree = 1, choppy = 3, oddly_breakable_by_hand = 1, flammable = 3},
853         sounds = default.node_sound_wood_defaults(),
854
855         on_place = minetest.rotate_node
856 })
857
858 minetest.register_node("default:aspen_wood", {
859         description = "Aspen Wood Planks",
860         paramtype2 = "facedir",
861         place_param2 = 0,
862         tiles = {"default_aspen_wood.png"},
863         is_ground_content = false,
864         groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
865         sounds = default.node_sound_wood_defaults(),
866 })
867
868 minetest.register_node("default:aspen_leaves", {
869         description = "Aspen Leaves",
870         drawtype = "allfaces_optional",
871         tiles = {"default_aspen_leaves.png"},
872         waving = 1,
873         paramtype = "light",
874         is_ground_content = false,
875         groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
876         drop = {
877                 max_items = 1,
878                 items = {
879                         {items = {"default:aspen_sapling"}, rarity = 20},
880                         {items = {"default:aspen_leaves"}}
881                 }
882         },
883         sounds = default.node_sound_leaves_defaults(),
884
885         after_place_node = default.after_place_leaves,
886 })
887
888 minetest.register_node("default:aspen_sapling", {
889         description = "Aspen Tree Sapling",
890         drawtype = "plantlike",
891         visual_scale = 1.0,
892         tiles = {"default_aspen_sapling.png"},
893         inventory_image = "default_aspen_sapling.png",
894         wield_image = "default_aspen_sapling.png",
895         paramtype = "light",
896         sunlight_propagates = true,
897         walkable = false,
898         on_timer = default.grow_sapling,
899         selection_box = {
900                 type = "fixed",
901                 fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
902         },
903         groups = {snappy = 2, dig_immediate = 3, flammable = 3,
904                 attached_node = 1, sapling = 1},
905         sounds = default.node_sound_leaves_defaults(),
906
907         on_construct = function(pos)
908                 minetest.get_node_timer(pos):start(math.random(2400,4800))
909         end,
910
911         on_place = function(itemstack, placer, pointed_thing)
912                 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
913                         "default:aspen_sapling",
914                         -- minp, maxp to be checked, relative to sapling pos
915                         -- minp_relative.y = 1 because sapling pos has been checked
916                         {x = -2, y = 1, z = -2},
917                         {x = 2, y = 12, z = 2},
918                         -- maximum interval of interior volume check
919                         4)
920
921                 return itemstack
922         end,
923 })
924
925 --
926 -- Ores
927 --
928
929 minetest.register_node("default:stone_with_coal", {
930         description = "Coal Ore",
931         tiles = {"default_stone.png^default_mineral_coal.png"},
932         groups = {cracky = 3},
933         drop = 'default:coal_lump',
934         sounds = default.node_sound_stone_defaults(),
935 })
936
937 minetest.register_node("default:coalblock", {
938         description = "Coal Block",
939         tiles = {"default_coal_block.png"},
940         is_ground_content = false,
941         groups = {cracky = 3},
942         sounds = default.node_sound_stone_defaults(),
943 })
944
945
946 minetest.register_node("default:stone_with_iron", {
947         description = "Iron Ore",
948         tiles = {"default_stone.png^default_mineral_iron.png"},
949         groups = {cracky = 2},
950         drop = 'default:iron_lump',
951         sounds = default.node_sound_stone_defaults(),
952 })
953
954 minetest.register_node("default:steelblock", {
955         description = "Steel Block",
956         tiles = {"default_steel_block.png"},
957         is_ground_content = false,
958         groups = {cracky = 1, level = 2},
959         sounds = default.node_sound_metal_defaults(),
960 })
961
962
963 minetest.register_node("default:stone_with_copper", {
964         description = "Copper Ore",
965         tiles = {"default_stone.png^default_mineral_copper.png"},
966         groups = {cracky = 2},
967         drop = 'default:copper_lump',
968         sounds = default.node_sound_stone_defaults(),
969 })
970
971 minetest.register_node("default:copperblock", {
972         description = "Copper Block",
973         tiles = {"default_copper_block.png"},
974         is_ground_content = false,
975         groups = {cracky = 1, level = 2},
976         sounds = default.node_sound_metal_defaults(),
977 })
978
979 minetest.register_node("default:bronzeblock", {
980         description = "Bronze Block",
981         tiles = {"default_bronze_block.png"},
982         is_ground_content = false,
983         groups = {cracky = 1, level = 2},
984         sounds = default.node_sound_metal_defaults(),
985 })
986
987
988 minetest.register_node("default:stone_with_mese", {
989         description = "Mese Ore",
990         tiles = {"default_stone.png^default_mineral_mese.png"},
991         groups = {cracky = 1},
992         drop = "default:mese_crystal",
993         sounds = default.node_sound_stone_defaults(),
994 })
995
996 minetest.register_node("default:mese", {
997         description = "Mese Block",
998         tiles = {"default_mese_block.png"},
999         paramtype = "light",
1000         groups = {cracky = 1, level = 2},
1001         sounds = default.node_sound_stone_defaults(),
1002         light_source = 3,
1003 })
1004
1005
1006 minetest.register_node("default:stone_with_gold", {
1007         description = "Gold Ore",
1008         tiles = {"default_stone.png^default_mineral_gold.png"},
1009         groups = {cracky = 2},
1010         drop = "default:gold_lump",
1011         sounds = default.node_sound_stone_defaults(),
1012 })
1013
1014 minetest.register_node("default:goldblock", {
1015         description = "Gold Block",
1016         tiles = {"default_gold_block.png"},
1017         is_ground_content = false,
1018         groups = {cracky = 1},
1019         sounds = default.node_sound_metal_defaults(),
1020 })
1021
1022
1023 minetest.register_node("default:stone_with_diamond", {
1024         description = "Diamond Ore",
1025         tiles = {"default_stone.png^default_mineral_diamond.png"},
1026         groups = {cracky = 1},
1027         drop = "default:diamond",
1028         sounds = default.node_sound_stone_defaults(),
1029 })
1030
1031 minetest.register_node("default:diamondblock", {
1032         description = "Diamond Block",
1033         tiles = {"default_diamond_block.png"},
1034         is_ground_content = false,
1035         groups = {cracky = 1, level = 3},
1036         sounds = default.node_sound_stone_defaults(),
1037 })
1038
1039 --
1040 -- Plantlife (non-cubic)
1041 --
1042
1043 minetest.register_node("default:cactus", {
1044         description = "Cactus",
1045         tiles = {"default_cactus_top.png", "default_cactus_top.png",
1046                 "default_cactus_side.png"},
1047         paramtype2 = "facedir",
1048         groups = {snappy = 1, choppy = 3},
1049         sounds = default.node_sound_wood_defaults(),
1050         on_place = minetest.rotate_node,
1051 })
1052
1053 minetest.register_node("default:papyrus", {
1054         description = "Papyrus",
1055         drawtype = "plantlike",
1056         tiles = {"default_papyrus.png"},
1057         inventory_image = "default_papyrus.png",
1058         wield_image = "default_papyrus.png",
1059         paramtype = "light",
1060         sunlight_propagates = true,
1061         walkable = false,
1062         selection_box = {
1063                 type = "fixed",
1064                 fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
1065         },
1066         groups = {snappy = 3, flammable = 2},
1067         sounds = default.node_sound_leaves_defaults(),
1068
1069         after_dig_node = function(pos, node, metadata, digger)
1070                 default.dig_up(pos, node, digger)
1071         end,
1072 })
1073
1074 minetest.register_node("default:dry_shrub", {
1075         description = "Dry Shrub",
1076         drawtype = "plantlike",
1077         waving = 1,
1078         visual_scale = 1.0,
1079         tiles = {"default_dry_shrub.png"},
1080         inventory_image = "default_dry_shrub.png",
1081         wield_image = "default_dry_shrub.png",
1082         paramtype = "light",
1083         sunlight_propagates = true,
1084         walkable = false,
1085         buildable_to = true,
1086         groups = {snappy = 3, flammable = 3, attached_node = 1},
1087         sounds = default.node_sound_leaves_defaults(),
1088         selection_box = {
1089                 type = "fixed",
1090                 fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
1091         },
1092 })
1093
1094 minetest.register_node("default:junglegrass", {
1095         description = "Jungle Grass",
1096         drawtype = "plantlike",
1097         waving = 1,
1098         visual_scale = 1.3,
1099         tiles = {"default_junglegrass.png"},
1100         inventory_image = "default_junglegrass.png",
1101         wield_image = "default_junglegrass.png",
1102         paramtype = "light",
1103         sunlight_propagates = true,
1104         walkable = false,
1105         buildable_to = true,
1106         groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1, flammable = 1},
1107         sounds = default.node_sound_leaves_defaults(),
1108         selection_box = {
1109                 type = "fixed",
1110                 fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
1111         },
1112 })
1113
1114
1115 minetest.register_node("default:grass_1", {
1116         description = "Grass",
1117         drawtype = "plantlike",
1118         waving = 1,
1119         tiles = {"default_grass_1.png"},
1120         -- Use texture of a taller grass stage in inventory
1121         inventory_image = "default_grass_3.png",
1122         wield_image = "default_grass_3.png",
1123         paramtype = "light",
1124         sunlight_propagates = true,
1125         walkable = false,
1126         buildable_to = true,
1127         groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1, flammable = 1},
1128         sounds = default.node_sound_leaves_defaults(),
1129         selection_box = {
1130                 type = "fixed",
1131                 fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
1132         },
1133
1134         on_place = function(itemstack, placer, pointed_thing)
1135                 -- place a random grass node
1136                 local stack = ItemStack("default:grass_" .. math.random(1,5))
1137                 local ret = minetest.item_place(stack, placer, pointed_thing)
1138                 return ItemStack("default:grass_1 " ..
1139                         itemstack:get_count() - (1 - ret:get_count()))
1140         end,
1141 })
1142
1143 for i = 2, 5 do
1144         minetest.register_node("default:grass_" .. i, {
1145                 description = "Grass",
1146                 drawtype = "plantlike",
1147                 waving = 1,
1148                 tiles = {"default_grass_" .. i .. ".png"},
1149                 inventory_image = "default_grass_" .. i .. ".png",
1150                 wield_image = "default_grass_" .. i .. ".png",
1151                 paramtype = "light",
1152                 sunlight_propagates = true,
1153                 walkable = false,
1154                 buildable_to = true,
1155                 drop = "default:grass_1",
1156                 groups = {snappy = 3, flora = 1, attached_node = 1,
1157                         not_in_creative_inventory = 1, grass = 1, flammable = 1},
1158                 sounds = default.node_sound_leaves_defaults(),
1159                 selection_box = {
1160                         type = "fixed",
1161                         fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
1162                 },
1163         })
1164 end
1165
1166
1167 minetest.register_node("default:dry_grass_1", {
1168         description = "Dry Grass",
1169         drawtype = "plantlike",
1170         waving = 1,
1171         tiles = {"default_dry_grass_1.png"},
1172         inventory_image = "default_dry_grass_3.png",
1173         wield_image = "default_dry_grass_3.png",
1174         paramtype = "light",
1175         sunlight_propagates = true,
1176         walkable = false,
1177         buildable_to = true,
1178         groups = {snappy = 3, flammable = 3, flora = 1,
1179                 attached_node = 1, dry_grass = 1},
1180         sounds = default.node_sound_leaves_defaults(),
1181         selection_box = {
1182                 type = "fixed",
1183                 fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
1184         },
1185
1186         on_place = function(itemstack, placer, pointed_thing)
1187                 -- place a random dry grass node
1188                 local stack = ItemStack("default:dry_grass_" .. math.random(1, 5))
1189                 local ret = minetest.item_place(stack, placer, pointed_thing)
1190                 return ItemStack("default:dry_grass_1 " ..
1191                         itemstack:get_count() - (1 - ret:get_count()))
1192         end,
1193 })
1194
1195 for i = 2, 5 do
1196         minetest.register_node("default:dry_grass_" .. i, {
1197                 description = "Dry Grass",
1198                 drawtype = "plantlike",
1199                 waving = 1,
1200                 tiles = {"default_dry_grass_" .. i .. ".png"},
1201                 inventory_image = "default_dry_grass_" .. i .. ".png",
1202                 wield_image = "default_dry_grass_" .. i .. ".png",
1203                 paramtype = "light",
1204                 sunlight_propagates = true,
1205                 walkable = false,
1206                 buildable_to = true,
1207                 groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1,
1208                         not_in_creative_inventory=1, dry_grass = 1},
1209                 drop = "default:dry_grass_1",
1210                 sounds = default.node_sound_leaves_defaults(),
1211                 selection_box = {
1212                         type = "fixed",
1213                         fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
1214                 },
1215         })
1216 end
1217
1218
1219 minetest.register_node("default:bush_stem", {
1220         description = "Bush Stem",
1221         drawtype = "plantlike",
1222         visual_scale = 1.18,
1223         tiles = {"default_bush_stem.png"},
1224         inventory_image = "default_bush_stem.png",
1225         wield_image = "default_bush_stem.png",
1226         paramtype = "light",
1227         sunlight_propagates = true,
1228         groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
1229         sounds = default.node_sound_wood_defaults(),
1230 })
1231
1232 minetest.register_node("default:bush_leaves", {
1233         description = "Bush Leaves",
1234         drawtype = "allfaces_optional",
1235         waving = 1,
1236         tiles = {"default_leaves_simple.png"},
1237         paramtype = "light",
1238         groups = {snappy = 3, flammable = 2, leaves = 1},
1239         sounds = default.node_sound_leaves_defaults(),
1240 })
1241
1242 minetest.register_node("default:acacia_bush_stem", {
1243         description = "Acacia Bush Stem",
1244         drawtype = "plantlike",
1245         visual_scale = 1.18,
1246         tiles = {"default_acacia_bush_stem.png"},
1247         inventory_image = "default_acacia_bush_stem.png",
1248         wield_image = "default_acacia_bush_stem.png",
1249         paramtype = "light",
1250         sunlight_propagates = true,
1251         groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
1252         sounds = default.node_sound_wood_defaults(),
1253 })
1254
1255 minetest.register_node("default:acacia_bush_leaves", {
1256         description = "Acacia Bush Leaves",
1257         drawtype = "allfaces_optional",
1258         waving = 1,
1259         tiles = {"default_acacia_leaves.png"},
1260         paramtype = "light",
1261         groups = {snappy = 3, flammable = 2, leaves = 1},
1262         sounds = default.node_sound_leaves_defaults(),
1263 })
1264
1265
1266 --
1267 -- Corals
1268 --
1269
1270 minetest.register_node("default:coral_brown", {
1271         description = "Brown Coral",
1272         tiles = {"default_coral_brown.png"},
1273         groups = {cracky = 3},
1274         drop = "default:coral_skeleton",
1275         sounds = default.node_sound_stone_defaults(),
1276 })
1277
1278 minetest.register_node("default:coral_orange", {
1279         description = "Orange Coral",
1280         tiles = {"default_coral_orange.png"},
1281         groups = {cracky = 3},
1282         drop = "default:coral_skeleton",
1283         sounds = default.node_sound_stone_defaults(),
1284 })
1285
1286 minetest.register_node("default:coral_skeleton", {
1287         description = "Coral Skeleton",
1288         tiles = {"default_coral_skeleton.png"},
1289         groups = {cracky = 3},
1290         sounds = default.node_sound_stone_defaults(),
1291 })
1292
1293
1294 --
1295 -- Liquids
1296 --
1297
1298 minetest.register_node("default:water_source", {
1299         description = "Water Source",
1300         drawtype = "liquid",
1301         tiles = {
1302                 {
1303                         name = "default_water_source_animated.png",
1304                         animation = {
1305                                 type = "vertical_frames",
1306                                 aspect_w = 16,
1307                                 aspect_h = 16,
1308                                 length = 2.0,
1309                         },
1310                 },
1311         },
1312         special_tiles = {
1313                 -- New-style water source material (mostly unused)
1314                 {
1315                         name = "default_water_source_animated.png",
1316                         animation = {
1317                                 type = "vertical_frames",
1318                                 aspect_w = 16,
1319                                 aspect_h = 16,
1320                                 length = 2.0,
1321                         },
1322                         backface_culling = false,
1323                 },
1324         },
1325         alpha = 160,
1326         paramtype = "light",
1327         walkable = false,
1328         pointable = false,
1329         diggable = false,
1330         buildable_to = true,
1331         is_ground_content = false,
1332         drop = "",
1333         drowning = 1,
1334         liquidtype = "source",
1335         liquid_alternative_flowing = "default:water_flowing",
1336         liquid_alternative_source = "default:water_source",
1337         liquid_viscosity = 1,
1338         post_effect_color = {a = 103, r = 30, g = 60, b = 90},
1339         groups = {water = 3, liquid = 3, puts_out_fire = 1},
1340 })
1341
1342 minetest.register_node("default:water_flowing", {
1343         description = "Flowing Water",
1344         drawtype = "flowingliquid",
1345         tiles = {"default_water.png"},
1346         special_tiles = {
1347                 {
1348                         name = "default_water_flowing_animated.png",
1349                         backface_culling = false,
1350                         animation = {
1351                                 type = "vertical_frames",
1352                                 aspect_w = 16,
1353                                 aspect_h = 16,
1354                                 length = 0.8,
1355                         },
1356                 },
1357                 {
1358                         name = "default_water_flowing_animated.png",
1359                         backface_culling = true,
1360                         animation = {
1361                                 type = "vertical_frames",
1362                                 aspect_w = 16,
1363                                 aspect_h = 16,
1364                                 length = 0.8,
1365                         },
1366                 },
1367         },
1368         alpha = 160,
1369         paramtype = "light",
1370         paramtype2 = "flowingliquid",
1371         walkable = false,
1372         pointable = false,
1373         diggable = false,
1374         buildable_to = true,
1375         is_ground_content = false,
1376         drop = "",
1377         drowning = 1,
1378         liquidtype = "flowing",
1379         liquid_alternative_flowing = "default:water_flowing",
1380         liquid_alternative_source = "default:water_source",
1381         liquid_viscosity = 1,
1382         post_effect_color = {a = 103, r = 30, g = 60, b = 90},
1383         groups = {water = 3, liquid = 3, puts_out_fire = 1,
1384                 not_in_creative_inventory = 1},
1385 })
1386
1387
1388 minetest.register_node("default:river_water_source", {
1389         description = "River Water Source",
1390         drawtype = "liquid",
1391         tiles = {
1392                 {
1393                         name = "default_river_water_source_animated.png",
1394                         animation = {
1395                                 type = "vertical_frames",
1396                                 aspect_w = 16,
1397                                 aspect_h = 16,
1398                                 length = 2.0,
1399                         },
1400                 },
1401         },
1402         special_tiles = {
1403                 {
1404                         name = "default_river_water_source_animated.png",
1405                         animation = {
1406                                 type = "vertical_frames",
1407                                 aspect_w = 16,
1408                                 aspect_h = 16,
1409                                 length = 2.0,
1410                         },
1411                         backface_culling = false,
1412                 },
1413         },
1414         alpha = 160,
1415         paramtype = "light",
1416         walkable = false,
1417         pointable = false,
1418         diggable = false,
1419         buildable_to = true,
1420         is_ground_content = false,
1421         drop = "",
1422         drowning = 1,
1423         liquidtype = "source",
1424         liquid_alternative_flowing = "default:river_water_flowing",
1425         liquid_alternative_source = "default:river_water_source",
1426         liquid_viscosity = 1,
1427         liquid_renewable = false,
1428         liquid_range = 2,
1429         post_effect_color = {a = 103, r = 30, g = 76, b = 90},
1430         groups = {water = 3, liquid = 3, puts_out_fire = 1},
1431 })
1432
1433 minetest.register_node("default:river_water_flowing", {
1434         description = "Flowing River Water",
1435         drawtype = "flowingliquid",
1436         tiles = {"default_river_water.png"},
1437         special_tiles = {
1438                 {
1439                         name = "default_river_water_flowing_animated.png",
1440                         backface_culling = false,
1441                         animation = {
1442                                 type = "vertical_frames",
1443                                 aspect_w = 16,
1444                                 aspect_h = 16,
1445                                 length = 0.8,
1446                         },
1447                 },
1448                 {
1449                         name = "default_river_water_flowing_animated.png",
1450                         backface_culling = true,
1451                         animation = {
1452                                 type = "vertical_frames",
1453                                 aspect_w = 16,
1454                                 aspect_h = 16,
1455                                 length = 0.8,
1456                         },
1457                 },
1458         },
1459         alpha = 160,
1460         paramtype = "light",
1461         paramtype2 = "flowingliquid",
1462         walkable = false,
1463         pointable = false,
1464         diggable = false,
1465         buildable_to = true,
1466         is_ground_content = false,
1467         drop = "",
1468         drowning = 1,
1469         liquidtype = "flowing",
1470         liquid_alternative_flowing = "default:river_water_flowing",
1471         liquid_alternative_source = "default:river_water_source",
1472         liquid_viscosity = 1,
1473         liquid_renewable = false,
1474         liquid_range = 2,
1475         post_effect_color = {a = 103, r = 30, g = 76, b = 90},
1476         groups = {water = 3, liquid = 3, puts_out_fire = 1,
1477                 not_in_creative_inventory = 1},
1478 })
1479
1480
1481 minetest.register_node("default:lava_source", {
1482         description = "Lava Source",
1483         drawtype = "liquid",
1484         tiles = {
1485                 {
1486                         name = "default_lava_source_animated.png",
1487                         animation = {
1488                                 type = "vertical_frames",
1489                                 aspect_w = 16,
1490                                 aspect_h = 16,
1491                                 length = 3.0,
1492                         },
1493                 },
1494         },
1495         special_tiles = {
1496                 -- New-style lava source material (mostly unused)
1497                 {
1498                         name = "default_lava_source_animated.png",
1499                         animation = {
1500                                 type = "vertical_frames",
1501                                 aspect_w = 16,
1502                                 aspect_h = 16,
1503                                 length = 3.0,
1504                         },
1505                         backface_culling = false,
1506                 },
1507         },
1508         paramtype = "light",
1509         light_source = default.LIGHT_MAX - 1,
1510         walkable = false,
1511         pointable = false,
1512         diggable = false,
1513         buildable_to = true,
1514         is_ground_content = false,
1515         drop = "",
1516         drowning = 1,
1517         liquidtype = "source",
1518         liquid_alternative_flowing = "default:lava_flowing",
1519         liquid_alternative_source = "default:lava_source",
1520         liquid_viscosity = 7,
1521         liquid_renewable = false,
1522         damage_per_second = 4 * 2,
1523         post_effect_color = {a = 191, r = 255, g = 64, b = 0},
1524         groups = {lava = 3, liquid = 2, igniter = 1},
1525 })
1526
1527 minetest.register_node("default:lava_flowing", {
1528         description = "Flowing Lava",
1529         drawtype = "flowingliquid",
1530         tiles = {"default_lava.png"},
1531         special_tiles = {
1532                 {
1533                         name = "default_lava_flowing_animated.png",
1534                         backface_culling = false,
1535                         animation = {
1536                                 type = "vertical_frames",
1537                                 aspect_w = 16,
1538                                 aspect_h = 16,
1539                                 length = 3.3,
1540                         },
1541                 },
1542                 {
1543                         name = "default_lava_flowing_animated.png",
1544                         backface_culling = true,
1545                         animation = {
1546                                 type = "vertical_frames",
1547                                 aspect_w = 16,
1548                                 aspect_h = 16,
1549                                 length = 3.3,
1550                         },
1551                 },
1552         },
1553         paramtype = "light",
1554         paramtype2 = "flowingliquid",
1555         light_source = default.LIGHT_MAX - 1,
1556         walkable = false,
1557         pointable = false,
1558         diggable = false,
1559         buildable_to = true,
1560         is_ground_content = false,
1561         drop = "",
1562         drowning = 1,
1563         liquidtype = "flowing",
1564         liquid_alternative_flowing = "default:lava_flowing",
1565         liquid_alternative_source = "default:lava_source",
1566         liquid_viscosity = 7,
1567         liquid_renewable = false,
1568         damage_per_second = 4 * 2,
1569         post_effect_color = {a = 191, r = 255, g = 64, b = 0},
1570         groups = {lava = 3, liquid = 2, igniter = 1,
1571                 not_in_creative_inventory = 1},
1572 })
1573
1574 --
1575 -- Tools / "Advanced" crafting / Non-"natural"
1576 --
1577
1578 minetest.register_node("default:torch", {
1579         description = "Torch",
1580         drawtype = "torchlike",
1581         tiles = {
1582                 {
1583                         name = "default_torch_on_floor_animated.png",
1584                         animation = {
1585                                 type = "vertical_frames",
1586                                 aspect_w = 16,
1587                                 aspect_h = 16,
1588                                 length = 3.0
1589                         },
1590                 },
1591                 {
1592                         name="default_torch_on_ceiling_animated.png",
1593                         animation = {
1594                                 type = "vertical_frames",
1595                                 aspect_w = 16,
1596                                 aspect_h = 16,
1597                                 length = 3.0
1598                         },
1599                 },
1600                 {
1601                         name="default_torch_animated.png",
1602                         animation = {
1603                                 type = "vertical_frames",
1604                                 aspect_w = 16,
1605                                 aspect_h = 16,
1606                                 length = 3.0
1607                         },
1608                 },
1609         },
1610         inventory_image = "default_torch_on_floor.png",
1611         wield_image = "default_torch_on_floor.png",
1612         paramtype = "light",
1613         paramtype2 = "wallmounted",
1614         sunlight_propagates = true,
1615         is_ground_content = false,
1616         walkable = false,
1617         light_source = default.LIGHT_MAX - 1,
1618         selection_box = {
1619                 type = "wallmounted",
1620                 wall_top = {-0.1, 0.5 - 0.6, -0.1, 0.1, 0.5, 0.1},
1621                 wall_bottom = {-0.1, -0.5, -0.1, 0.1, -0.5 + 0.6, 0.1},
1622                 wall_side = {-0.5, -0.3, -0.1, -0.5 + 0.3, 0.3, 0.1},
1623         },
1624         groups = {choppy = 2, dig_immediate = 3, flammable = 1, attached_node = 1},
1625         legacy_wallmounted = true,
1626         sounds = default.node_sound_defaults(),
1627 })
1628
1629
1630 local chest_formspec =
1631         "size[8,9]" ..
1632         default.gui_bg ..
1633         default.gui_bg_img ..
1634         default.gui_slots ..
1635         "list[current_name;main;0,0.3;8,4;]" ..
1636         "list[current_player;main;0,4.85;8,1;]" ..
1637         "list[current_player;main;0,6.08;8,3;8]" ..
1638         "listring[current_name;main]" ..
1639         "listring[current_player;main]" ..
1640         default.get_hotbar_bg(0,4.85)
1641
1642 local function get_locked_chest_formspec(pos)
1643         local spos = pos.x .. "," .. pos.y .. "," .. pos.z
1644         local formspec =
1645                 "size[8,9]" ..
1646                 default.gui_bg ..
1647                 default.gui_bg_img ..
1648                 default.gui_slots ..
1649                 "list[nodemeta:" .. spos .. ";main;0,0.3;8,4;]" ..
1650                 "list[current_player;main;0,4.85;8,1;]" ..
1651                 "list[current_player;main;0,6.08;8,3;8]" ..
1652                 "listring[nodemeta:" .. spos .. ";main]" ..
1653                 "listring[current_player;main]" ..
1654                 default.get_hotbar_bg(0,4.85)
1655  return formspec
1656 end
1657
1658 local function has_locked_chest_privilege(meta, player)
1659         local name = ""
1660         if player then
1661                 if minetest.check_player_privs(player, "protection_bypass") then
1662                         return true
1663                 end
1664                 name = player:get_player_name()
1665         end
1666         if name ~= meta:get_string("owner") then
1667                 return false
1668         end
1669         return true
1670 end
1671
1672 minetest.register_node("default:chest", {
1673         description = "Chest",
1674         tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
1675                 "default_chest_side.png", "default_chest_side.png", "default_chest_front.png"},
1676         paramtype2 = "facedir",
1677         groups = {choppy = 2, oddly_breakable_by_hand = 2},
1678         legacy_facedir_simple = true,
1679         is_ground_content = false,
1680         sounds = default.node_sound_wood_defaults(),
1681
1682         on_construct = function(pos)
1683                 local meta = minetest.get_meta(pos)
1684                 meta:set_string("formspec", chest_formspec)
1685                 local inv = meta:get_inventory()
1686                 inv:set_size("main", 8*4)
1687         end,
1688         can_dig = function(pos,player)
1689                 local meta = minetest.get_meta(pos);
1690                 local inv = meta:get_inventory()
1691                 return inv:is_empty("main")
1692         end,
1693         on_metadata_inventory_move = function(pos, from_list, from_index,
1694                         to_list, to_index, count, player)
1695                 minetest.log("action", player:get_player_name() ..
1696                         " moves stuff in chest at " .. minetest.pos_to_string(pos))
1697         end,
1698     on_metadata_inventory_put = function(pos, listname, index, stack, player)
1699                 minetest.log("action", player:get_player_name() ..
1700                         " moves " .. stack:get_name() ..
1701                         " to chest at " .. minetest.pos_to_string(pos))
1702         end,
1703     on_metadata_inventory_take = function(pos, listname, index, stack, player)
1704                 minetest.log("action", player:get_player_name() ..
1705                         " takes " .. stack:get_name() ..
1706                         " from chest at " .. minetest.pos_to_string(pos))
1707         end,
1708         on_blast = function(pos)
1709                 local drops = {}
1710                 default.get_inventory_drops(pos, "main", drops)
1711                 drops[#drops+1] = "default:chest"
1712                 minetest.remove_node(pos)
1713                 return drops
1714         end,
1715 })
1716
1717 minetest.register_node("default:chest_locked", {
1718         description = "Locked Chest",
1719         tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
1720                 "default_chest_side.png", "default_chest_side.png", "default_chest_lock.png"},
1721         paramtype2 = "facedir",
1722         groups = {choppy = 2, oddly_breakable_by_hand = 2},
1723         legacy_facedir_simple = true,
1724         is_ground_content = false,
1725         sounds = default.node_sound_wood_defaults(),
1726
1727         after_place_node = function(pos, placer)
1728                 local meta = minetest.get_meta(pos)
1729                 meta:set_string("owner", placer:get_player_name() or "")
1730                 meta:set_string("infotext", "Locked Chest (owned by " ..
1731                                 meta:get_string("owner") .. ")")
1732         end,
1733         on_construct = function(pos)
1734                 local meta = minetest.get_meta(pos)
1735                 meta:set_string("owner", "")
1736                 local inv = meta:get_inventory()
1737                 inv:set_size("main", 8 * 4)
1738         end,
1739         can_dig = function(pos,player)
1740                 local meta = minetest.get_meta(pos);
1741                 local inv = meta:get_inventory()
1742                 return inv:is_empty("main") and has_locked_chest_privilege(meta, player)
1743         end,
1744         allow_metadata_inventory_move = function(pos, from_list, from_index,
1745                         to_list, to_index, count, player)
1746                 local meta = minetest.get_meta(pos)
1747                 if not has_locked_chest_privilege(meta, player) then
1748                         return 0
1749                 end
1750                 return count
1751         end,
1752     allow_metadata_inventory_put = function(pos, listname, index, stack, player)
1753                 local meta = minetest.get_meta(pos)
1754                 if not has_locked_chest_privilege(meta, player) then
1755                         return 0
1756                 end
1757                 return stack:get_count()
1758         end,
1759     allow_metadata_inventory_take = function(pos, listname, index, stack, player)
1760                 local meta = minetest.get_meta(pos)
1761                 if not has_locked_chest_privilege(meta, player) then
1762                         return 0
1763                 end
1764                 return stack:get_count()
1765         end,
1766     on_metadata_inventory_put = function(pos, listname, index, stack, player)
1767                 minetest.log("action", player:get_player_name() ..
1768                         " moves " .. stack:get_name() ..
1769                         " to locked chest at " .. minetest.pos_to_string(pos))
1770         end,
1771     on_metadata_inventory_take = function(pos, listname, index, stack, player)
1772                 minetest.log("action", player:get_player_name() ..
1773                         " takes " .. stack:get_name()  ..
1774                         " from locked chest at " .. minetest.pos_to_string(pos))
1775         end,
1776         on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
1777                 local meta = minetest.get_meta(pos)
1778                 if has_locked_chest_privilege(meta, clicker) then
1779                         minetest.show_formspec(
1780                                 clicker:get_player_name(),
1781                                 "default:chest_locked",
1782                                 get_locked_chest_formspec(pos)
1783                         )
1784                 end
1785                 return itemstack
1786         end,
1787         on_blast = function() end,
1788 })
1789
1790
1791 local bookshelf_formspec =
1792         "size[8,7;]" ..
1793         default.gui_bg ..
1794         default.gui_bg_img ..
1795         default.gui_slots ..
1796         "list[context;books;0,0.3;8,2;]" ..
1797         "list[current_player;main;0,2.85;8,1;]" ..
1798         "list[current_player;main;0,4.08;8,3;8]" ..
1799         "listring[context;books]" ..
1800         "listring[current_player;main]" ..
1801         default.get_hotbar_bg(0,2.85)
1802
1803 minetest.register_node("default:bookshelf", {
1804         description = "Bookshelf",
1805         tiles = {"default_wood.png", "default_wood.png", "default_wood.png",
1806                 "default_wood.png", "default_bookshelf.png", "default_bookshelf.png"},
1807         paramtype2 = "facedir",
1808         is_ground_content = false,
1809         groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
1810         sounds = default.node_sound_wood_defaults(),
1811
1812         on_construct = function(pos)
1813                 local meta = minetest.get_meta(pos)
1814                 meta:set_string("formspec", bookshelf_formspec)
1815                 local inv = meta:get_inventory()
1816                 inv:set_size("books", 8 * 2)
1817         end,
1818         can_dig = function(pos,player)
1819                 local inv = minetest.get_meta(pos):get_inventory()
1820                 return inv:is_empty("books")
1821         end,
1822         allow_metadata_inventory_put = function(pos, listname, index, stack)
1823                 if minetest.get_item_group(stack:get_name(), "book") ~= 0 then
1824                         return stack:get_count()
1825                 end
1826                 return 0
1827         end,
1828         on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
1829                 minetest.log("action", player:get_player_name() ..
1830                         " moves stuff in bookshelf at " .. minetest.pos_to_string(pos))
1831         end,
1832         on_metadata_inventory_put = function(pos, listname, index, stack, player)
1833                 minetest.log("action", player:get_player_name() ..
1834                         " moves stuff to bookshelf at " .. minetest.pos_to_string(pos))
1835         end,
1836         on_metadata_inventory_take = function(pos, listname, index, stack, player)
1837                 minetest.log("action", player:get_player_name() ..
1838                         " takes stuff from bookshelf at " .. minetest.pos_to_string(pos))
1839         end,
1840         on_blast = function(pos)
1841                 local drops = {}
1842                 default.get_inventory_drops(pos, "books", drops)
1843                 drops[#drops+1] = "default:bookshelf"
1844                 minetest.remove_node(pos)
1845                 return drops
1846         end,
1847 })
1848
1849 local function register_sign(material, desc, def)
1850         minetest.register_node("default:sign_wall_" .. material, {
1851                 description = desc .. " Sign",
1852                 drawtype = "nodebox",
1853                 tiles = {"default_sign_wall_" .. material .. ".png"},
1854                 inventory_image = "default_sign_" .. material .. ".png",
1855                 wield_image = "default_sign_" .. material .. ".png",
1856                 paramtype = "light",
1857                 paramtype2 = "wallmounted",
1858                 sunlight_propagates = true,
1859                 is_ground_content = false,
1860                 walkable = false,
1861                 node_box = {
1862                         type = "wallmounted",
1863                         wall_top    = {-0.4375, 0.4375, -0.3125, 0.4375, 0.5, 0.3125},
1864                         wall_bottom = {-0.4375, -0.5, -0.3125, 0.4375, -0.4375, 0.3125},
1865                         wall_side   = {-0.5, -0.3125, -0.4375, -0.4375, 0.3125, 0.4375},
1866                 },
1867                 groups = def.groups,
1868                 legacy_wallmounted = true,
1869                 sounds = def.sounds,
1870
1871                 on_construct = function(pos)
1872                         --local n = minetest.get_node(pos)
1873                         local meta = minetest.get_meta(pos)
1874                         meta:set_string("formspec", "field[text;;${text}]")
1875                 end,
1876                 on_receive_fields = function(pos, formname, fields, sender)
1877                         --print("Sign at "..minetest.pos_to_string(pos).." got "..dump(fields))
1878                         local player_name = sender:get_player_name()
1879                         if minetest.is_protected(pos, player_name) then
1880                                 minetest.record_protection_violation(pos, player_name)
1881                                 return
1882                         end
1883                         local meta = minetest.get_meta(pos)
1884                         if not fields.text then return end
1885                         minetest.log("action", (player_name or "") .. " wrote \"" ..
1886                                 fields.text .. "\" to sign at " .. minetest.pos_to_string(pos))
1887                         meta:set_string("text", fields.text)
1888                         meta:set_string("infotext", '"' .. fields.text .. '"')
1889                 end,
1890         })
1891 end
1892
1893 register_sign("wood", "Wooden", {
1894         sounds = default.node_sound_wood_defaults(),
1895         groups = {choppy = 2, attached_node = 1, flammable = 2, oddly_breakable_by_hand = 3}
1896 })
1897
1898 register_sign("steel", "Steel", {
1899         sounds = default.node_sound_metal_defaults(),
1900         groups = {cracky = 2, attached_node = 1}
1901 })
1902
1903 minetest.register_node("default:ladder_wood", {
1904         description = "Wooden Ladder",
1905         drawtype = "signlike",
1906         tiles = {"default_ladder_wood.png"},
1907         inventory_image = "default_ladder_wood.png",
1908         wield_image = "default_ladder_wood.png",
1909         paramtype = "light",
1910         paramtype2 = "wallmounted",
1911         sunlight_propagates = true,
1912         walkable = false,
1913         climbable = true,
1914         is_ground_content = false,
1915         selection_box = {
1916                 type = "wallmounted",
1917                 --wall_top = = <default>
1918                 --wall_bottom = = <default>
1919                 --wall_side = = <default>
1920         },
1921         groups = {choppy = 2, oddly_breakable_by_hand = 3, flammable = 2},
1922         legacy_wallmounted = true,
1923         sounds = default.node_sound_wood_defaults(),
1924 })
1925
1926 minetest.register_node("default:ladder_steel", {
1927         description = "Steel Ladder",
1928         drawtype = "signlike",
1929         tiles = {"default_ladder_steel.png"},
1930         inventory_image = "default_ladder_steel.png",
1931         wield_image = "default_ladder_steel.png",
1932         paramtype = "light",
1933         paramtype2 = "wallmounted",
1934         sunlight_propagates = true,
1935         walkable = false,
1936         climbable = true,
1937         is_ground_content = false,
1938         selection_box = {
1939                 type = "wallmounted",
1940                 --wall_top = = <default>
1941                 --wall_bottom = = <default>
1942                 --wall_side = = <default>
1943         },
1944         groups = {cracky = 2},
1945         sounds = default.node_sound_metal_defaults(),
1946 })
1947
1948 default.register_fence("default:fence_wood", {
1949         description = "Wooden Fence",
1950         texture = "default_fence_wood.png",
1951         inventory_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1952         wield_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1953         material = "default:wood",
1954         groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
1955         sounds = default.node_sound_wood_defaults()
1956 })
1957
1958 default.register_fence("default:fence_acacia_wood", {
1959         description = "Acacia Fence",
1960         texture = "default_fence_acacia_wood.png",
1961         inventory_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1962         wield_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1963         material = "default:acacia_wood",
1964         groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
1965         sounds = default.node_sound_wood_defaults()
1966 })
1967
1968 default.register_fence("default:fence_junglewood", {
1969         description = "Junglewood Fence",
1970         texture = "default_fence_junglewood.png",
1971         inventory_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126",
1972         wield_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126",
1973         material = "default:junglewood",
1974         groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
1975         sounds = default.node_sound_wood_defaults()
1976 })
1977
1978 default.register_fence("default:fence_pine_wood", {
1979         description = "Pine Fence",
1980         texture = "default_fence_pine_wood.png",
1981         inventory_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1982         wield_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1983         material = "default:pine_wood",
1984         groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
1985         sounds = default.node_sound_wood_defaults()
1986 })
1987
1988 default.register_fence("default:fence_aspen_wood", {
1989         description = "Aspen Fence",
1990         texture = "default_fence_aspen_wood.png",
1991         inventory_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1992         wield_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1993         material = "default:aspen_wood",
1994         groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
1995         sounds = default.node_sound_wood_defaults()
1996 })
1997
1998 minetest.register_node("default:glass", {
1999         description = "Glass",
2000         drawtype = "glasslike_framed_optional",
2001         tiles = {"default_glass.png", "default_glass_detail.png"},
2002         paramtype = "light",
2003         sunlight_propagates = true,
2004         is_ground_content = false,
2005         groups = {cracky = 3, oddly_breakable_by_hand = 3},
2006         sounds = default.node_sound_glass_defaults(),
2007 })
2008
2009 minetest.register_node("default:obsidian_glass", {
2010         description = "Obsidian Glass",
2011         drawtype = "glasslike_framed_optional",
2012         tiles = {"default_obsidian_glass.png", "default_obsidian_glass_detail.png"},
2013         paramtype = "light",
2014         is_ground_content = false,
2015         sunlight_propagates = true,
2016         sounds = default.node_sound_glass_defaults(),
2017         groups = {cracky = 3},
2018 })
2019
2020
2021 minetest.register_node("default:rail", {
2022         description = "Rail",
2023         drawtype = "raillike",
2024         tiles = {"default_rail.png", "default_rail_curved.png",
2025                 "default_rail_t_junction.png", "default_rail_crossing.png"},
2026         inventory_image = "default_rail.png",
2027         wield_image = "default_rail.png",
2028         paramtype = "light",
2029         sunlight_propagates = true,
2030         walkable = false,
2031         is_ground_content = false,
2032         selection_box = {
2033                 type = "fixed",
2034                 -- but how to specify the dimensions for curved and sideways rails?
2035                 fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
2036         },
2037         groups = {dig_immediate = 2, attached_node = 1,
2038                 connect_to_raillike = minetest.raillike_group("rail")},
2039 })
2040
2041
2042 minetest.register_node("default:brick", {
2043         description = "Brick Block",
2044         paramtype2 = "facedir",
2045         place_param2 = 0,
2046         tiles = {"default_brick.png"},
2047         is_ground_content = false,
2048         groups = {cracky = 3},
2049         sounds = default.node_sound_stone_defaults(),
2050 })
2051
2052
2053 minetest.register_node("default:meselamp", {
2054         description = "Mese Lamp",
2055         drawtype = "glasslike",
2056         tiles = {"default_meselamp.png"},
2057         paramtype = "light",
2058         sunlight_propagates = true,
2059         is_ground_content = false,
2060         groups = {cracky = 3, oddly_breakable_by_hand = 3},
2061         sounds = default.node_sound_glass_defaults(),
2062         light_source = default.LIGHT_MAX,
2063 })
2064
2065 --
2066 -- Misc
2067 --
2068
2069 minetest.register_node("default:cloud", {
2070         description = "Cloud",
2071         tiles = {"default_cloud.png"},
2072         is_ground_content = false,
2073         sounds = default.node_sound_defaults(),
2074         groups = {not_in_creative_inventory = 1},
2075 })