Change many metal nodes to use default metal sounds
[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 Corals
135 ------
136
137 default:coral_brown
138 default:coral_orange
139 default:coral_skeleton
140
141 Liquids
142 -------
143 (1. Source 2. Flowing)
144
145 default:water_source
146 default:water_flowing
147
148 default:river_water_source
149 default:river_water_flowing
150
151 default:lava_source
152 default:lava_flowing
153
154 Tools / "Advanced" crafting / Non-"natural"
155 -------------------------------------------
156
157 default:torch
158
159 default:chest
160 default:chest_locked
161
162 default:bookshelf
163
164 default:sign_wall_wood
165 default:sign_wall_steel
166
167 default:ladder_wood
168 default:ladder_steel
169
170 default:fence_wood
171 default:fence_acacia_wood
172 default:fence_junglewood
173 default:fence_pine_wood
174 default:fence_aspen_wood
175
176 default:glass
177 default:obsidian_glass
178
179 default:rail
180
181 default:brick
182
183 default:meselamp
184
185 Misc
186 ----
187
188 default:cloud
189
190 --]]
191
192 --
193 -- Stone
194 --
195
196 minetest.register_node("default:stone", {
197         description = "Stone",
198         tiles = {"default_stone.png"},
199         groups = {cracky = 3, stone = 1},
200         drop = 'default:cobble',
201         legacy_mineral = true,
202         sounds = default.node_sound_stone_defaults(),
203 })
204
205 minetest.register_node("default:cobble", {
206         description = "Cobblestone",
207         tiles = {"default_cobble.png"},
208         is_ground_content = false,
209         groups = {cracky = 3, stone = 2},
210         sounds = default.node_sound_stone_defaults(),
211 })
212
213 minetest.register_node("default:stonebrick", {
214         description = "Stone Brick",
215         paramtype2 = "facedir",
216         place_param2 = 0,
217         tiles = {"default_stone_brick.png"},
218         is_ground_content = false,
219         groups = {cracky = 2, stone = 1},
220         sounds = default.node_sound_stone_defaults(),
221 })
222
223 minetest.register_node("default:stone_block", {
224         description = "Stone Block",
225         tiles = {"default_stone_block.png"},
226         is_ground_content = false,
227         groups = {cracky = 2, stone = 1},
228         sounds = default.node_sound_stone_defaults(),
229 })
230
231 minetest.register_node("default:mossycobble", {
232         description = "Mossy Cobblestone",
233         tiles = {"default_mossycobble.png"},
234         is_ground_content = false,
235         groups = {cracky = 3, stone = 1},
236         sounds = default.node_sound_stone_defaults(),
237 })
238
239
240 minetest.register_node("default:desert_stone", {
241         description = "Desert Stone",
242         tiles = {"default_desert_stone.png"},
243         groups = {cracky = 3, stone = 1},
244         drop = 'default:desert_cobble',
245         legacy_mineral = true,
246         sounds = default.node_sound_stone_defaults(),
247 })
248
249 minetest.register_node("default:desert_cobble", {
250         description = "Desert Cobblestone",
251         tiles = {"default_desert_cobble.png"},
252         is_ground_content = false,
253         groups = {cracky = 3, stone = 2},
254         sounds = default.node_sound_stone_defaults(),
255 })
256
257 minetest.register_node("default:desert_stonebrick", {
258         description = "Desert Stone Brick",
259         paramtype2 = "facedir",
260         place_param2 = 0,
261         tiles = {"default_desert_stone_brick.png"},
262         is_ground_content = false,
263         groups = {cracky = 2, stone = 1},
264         sounds = default.node_sound_stone_defaults(),
265 })
266
267 minetest.register_node("default:desert_stone_block", {
268         description = "Desert Stone Block",
269         tiles = {"default_desert_stone_block.png"},
270         is_ground_content = false,
271         groups = {cracky = 2, stone = 1},
272         sounds = default.node_sound_stone_defaults(),
273 })
274
275
276 minetest.register_node("default:sandstone", {
277         description = "Sandstone",
278         tiles = {"default_sandstone.png"},
279         groups = {crumbly = 1, cracky = 3},
280         sounds = default.node_sound_stone_defaults(),
281 })
282
283 minetest.register_node("default:sandstonebrick", {
284         description = "Sandstone Brick",
285         paramtype2 = "facedir",
286         place_param2 = 0,
287         tiles = {"default_sandstone_brick.png"},
288         is_ground_content = false,
289         groups = {cracky = 2},
290         sounds = default.node_sound_stone_defaults(),
291 })
292
293 minetest.register_node("default:sandstone_block", {
294         description = "Sandstone Block",
295         tiles = {"default_sandstone_block.png"},
296         is_ground_content = false,
297         groups = {cracky = 2},
298         sounds = default.node_sound_stone_defaults(),
299 })
300
301
302 minetest.register_node("default:obsidian", {
303         description = "Obsidian",
304         tiles = {"default_obsidian.png"},
305         sounds = default.node_sound_stone_defaults(),
306         groups = {cracky = 1, level = 2},
307 })
308
309 minetest.register_node("default:obsidianbrick", {
310         description = "Obsidian Brick",
311         paramtype2 = "facedir",
312         place_param2 = 0,
313         tiles = {"default_obsidian_brick.png"},
314         is_ground_content = false,
315         sounds = default.node_sound_stone_defaults(),
316         groups = {cracky = 1, level = 2},
317 })
318
319 minetest.register_node("default:obsidian_block", {
320         description = "Obsidian Block",
321         tiles = {"default_obsidian_block.png"},
322         is_ground_content = false,
323         sounds = default.node_sound_stone_defaults(),
324         groups = {cracky = 1, level = 2},
325 })
326
327 --
328 -- Soft / Non-Stone
329 --
330
331 minetest.register_node("default:dirt", {
332         description = "Dirt",
333         tiles = {"default_dirt.png"},
334         groups = {crumbly = 3, soil = 1},
335         sounds = default.node_sound_dirt_defaults(),
336 })
337
338 minetest.register_node("default:dirt_with_grass", {
339         description = "Dirt with Grass",
340         tiles = {"default_grass.png", "default_dirt.png",
341                 {name = "default_dirt.png^default_grass_side.png",
342                         tileable_vertical = false}},
343         groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
344         drop = 'default:dirt',
345         sounds = default.node_sound_dirt_defaults({
346                 footstep = {name = "default_grass_footstep", gain = 0.25},
347         }),
348 })
349
350 minetest.register_node("default:dirt_with_grass_footsteps", {
351         description = "Dirt with Grass and Footsteps",
352         tiles = {"default_grass.png^default_footprint.png", "default_dirt.png",
353                 {name = "default_dirt.png^default_grass_side.png",
354                         tileable_vertical = false}},
355         groups = {crumbly = 3, soil = 1, not_in_creative_inventory = 1},
356         drop = 'default:dirt',
357         sounds = default.node_sound_dirt_defaults({
358                 footstep = {name = "default_grass_footstep", gain = 0.25},
359         }),
360 })
361
362 minetest.register_node("default:dirt_with_dry_grass", {
363         description = "Dirt with Dry Grass",
364         tiles = {"default_dry_grass.png",
365                 "default_dirt.png",
366                 {name = "default_dirt.png^default_dry_grass_side.png",
367                         tileable_vertical = false}},
368         groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
369         drop = 'default:dirt',
370         sounds = default.node_sound_dirt_defaults({
371                 footstep = {name = "default_grass_footstep", gain = 0.4},
372         }),
373 })
374
375 minetest.register_node("default:dirt_with_snow", {
376         description = "Dirt with Snow",
377         tiles = {"default_snow.png", "default_dirt.png",
378                 {name = "default_dirt.png^default_snow_side.png",
379                         tileable_vertical = false}},
380         groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
381         drop = 'default:dirt',
382         sounds = default.node_sound_dirt_defaults({
383                 footstep = {name = "default_snow_footstep", gain = 0.15},
384         }),
385 })
386
387 minetest.register_node("default:sand", {
388         description = "Sand",
389         tiles = {"default_sand.png"},
390         groups = {crumbly = 3, falling_node = 1, sand = 1},
391         sounds = default.node_sound_sand_defaults(),
392 })
393
394 minetest.register_node("default:desert_sand", {
395         description = "Desert Sand",
396         tiles = {"default_desert_sand.png"},
397         groups = {crumbly = 3, falling_node = 1, sand = 1},
398         sounds = default.node_sound_sand_defaults(),
399 })
400
401 minetest.register_node("default:silver_sand", {
402         description = "Silver Sand",
403         tiles = {"default_silver_sand.png"},
404         groups = {crumbly = 3, falling_node = 1, sand = 1},
405         sounds = default.node_sound_sand_defaults(),
406 })
407
408
409 minetest.register_node("default:gravel", {
410         description = "Gravel",
411         tiles = {"default_gravel.png"},
412         groups = {crumbly = 2, falling_node = 1},
413         sounds = default.node_sound_gravel_defaults(),
414         drop = {
415                 max_items = 1,
416                 items = {
417                         {items = {'default:flint'}, rarity = 16},
418                         {items = {'default:gravel'}}
419                 }
420         }
421 })
422
423 minetest.register_node("default:clay", {
424         description = "Clay",
425         tiles = {"default_clay.png"},
426         groups = {crumbly = 3},
427         drop = 'default:clay_lump 4',
428         sounds = default.node_sound_dirt_defaults(),
429 })
430
431
432 minetest.register_node("default:snow", {
433         description = "Snow",
434         tiles = {"default_snow.png"},
435         inventory_image = "default_snowball.png",
436         wield_image = "default_snowball.png",
437         paramtype = "light",
438         buildable_to = true,
439         floodable = true,
440         walkable = false,
441         drawtype = "nodebox",
442         node_box = {
443                 type = "fixed",
444                 fixed = {
445                         {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
446                 },
447         },
448         groups = {crumbly = 3, falling_node = 1, puts_out_fire = 1},
449         sounds = default.node_sound_dirt_defaults({
450                 footstep = {name = "default_snow_footstep", gain = 0.15},
451                 dug = {name = "default_snow_footstep", gain = 0.2},
452                 dig = {name = "default_snow_footstep", gain = 0.2}
453         }),
454
455         on_construct = function(pos)
456                 pos.y = pos.y - 1
457                 if minetest.get_node(pos).name == "default:dirt_with_grass" then
458                         minetest.set_node(pos, {name = "default:dirt_with_snow"})
459                 end
460         end,
461 })
462
463 minetest.register_node("default:snowblock", {
464         description = "Snow Block",
465         tiles = {"default_snow.png"},
466         groups = {crumbly = 3, puts_out_fire = 1},
467         sounds = default.node_sound_dirt_defaults({
468                 footstep = {name = "default_snow_footstep", gain = 0.15},
469                 dug = {name = "default_snow_footstep", gain = 0.2},
470                 dig = {name = "default_snow_footstep", gain = 0.2}
471         }),
472 })
473
474 minetest.register_node("default:ice", {
475         description = "Ice",
476         tiles = {"default_ice.png"},
477         is_ground_content = false,
478         paramtype = "light",
479         groups = {cracky = 3, puts_out_fire = 1},
480         sounds = default.node_sound_glass_defaults(),
481 })
482
483 --
484 -- Trees
485 --
486
487 minetest.register_node("default:tree", {
488         description = "Tree",
489         tiles = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"},
490         paramtype2 = "facedir",
491         is_ground_content = false,
492         groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
493         sounds = default.node_sound_wood_defaults(),
494
495         on_place = minetest.rotate_node
496 })
497
498 minetest.register_node("default:wood", {
499         description = "Wooden Planks",
500         paramtype2 = "facedir",
501         place_param2 = 0,
502         tiles = {"default_wood.png"},
503         is_ground_content = false,
504         groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
505         sounds = default.node_sound_wood_defaults(),
506 })
507
508 minetest.register_node("default:sapling", {
509         description = "Sapling",
510         drawtype = "plantlike",
511         visual_scale = 1.0,
512         tiles = {"default_sapling.png"},
513         inventory_image = "default_sapling.png",
514         wield_image = "default_sapling.png",
515         paramtype = "light",
516         sunlight_propagates = true,
517         walkable = false,
518         on_timer = default.grow_sapling,
519         selection_box = {
520                 type = "fixed",
521                 fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
522         },
523         groups = {snappy = 2, dig_immediate = 3, flammable = 2,
524                 attached_node = 1, sapling = 1},
525         sounds = default.node_sound_leaves_defaults(),
526
527         on_construct = function(pos)
528                 minetest.get_node_timer(pos):start(math.random(2400,4800))
529         end,
530
531         on_place = function(itemstack, placer, pointed_thing)
532                 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
533                         "default:sapling",
534                         -- minp, maxp to be checked, relative to sapling pos
535                         -- minp_relative.y = 1 because sapling pos has been checked
536                         {x = -2, y = 1, z = -2},
537                         {x = 2, y = 6, z = 2},
538                         -- maximum interval of interior volume check
539                         4)
540
541                 return itemstack
542         end,
543 })
544
545 minetest.register_node("default:leaves", {
546         description = "Leaves",
547         drawtype = "allfaces_optional",
548         waving = 1,
549         visual_scale = 1.3,
550         tiles = {"default_leaves.png"},
551         special_tiles = {"default_leaves_simple.png"},
552         paramtype = "light",
553         is_ground_content = false,
554         groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
555         drop = {
556                 max_items = 1,
557                 items = {
558                         {
559                                 -- player will get sapling with 1/20 chance
560                                 items = {'default:sapling'},
561                                 rarity = 20,
562                         },
563                         {
564                                 -- player will get leaves only if he get no saplings,
565                                 -- this is because max_items is 1
566                                 items = {'default:leaves'},
567                         }
568                 }
569         },
570         sounds = default.node_sound_leaves_defaults(),
571
572         after_place_node = default.after_place_leaves,
573 })
574
575 minetest.register_node("default:apple", {
576         description = "Apple",
577         drawtype = "plantlike",
578         visual_scale = 1.0,
579         tiles = {"default_apple.png"},
580         inventory_image = "default_apple.png",
581         paramtype = "light",
582         sunlight_propagates = true,
583         walkable = false,
584         is_ground_content = false,
585         selection_box = {
586                 type = "fixed",
587                 fixed = {-0.2, -0.5, -0.2, 0.2, 0, 0.2}
588         },
589         groups = {fleshy = 3, dig_immediate = 3, flammable = 2,
590                 leafdecay = 3, leafdecay_drop = 1},
591         on_use = minetest.item_eat(2),
592         sounds = default.node_sound_leaves_defaults(),
593
594         after_place_node = function(pos, placer, itemstack)
595                 if placer:is_player() then
596                         minetest.set_node(pos, {name = "default:apple", param2 = 1})
597                 end
598         end,
599 })
600
601
602 minetest.register_node("default:jungletree", {
603         description = "Jungle Tree",
604         tiles = {"default_jungletree_top.png", "default_jungletree_top.png",
605                 "default_jungletree.png"},
606         paramtype2 = "facedir",
607         is_ground_content = false,
608         groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
609         sounds = default.node_sound_wood_defaults(),
610
611         on_place = minetest.rotate_node
612 })
613
614 minetest.register_node("default:junglewood", {
615         description = "Junglewood Planks",
616         paramtype2 = "facedir",
617         place_param2 = 0,
618         tiles = {"default_junglewood.png"},
619         is_ground_content = false,
620         groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
621         sounds = default.node_sound_wood_defaults(),
622 })
623
624 minetest.register_node("default:jungleleaves", {
625         description = "Jungle Leaves",
626         drawtype = "allfaces_optional",
627         waving = 1,
628         visual_scale = 1.3,
629         tiles = {"default_jungleleaves.png"},
630         special_tiles = {"default_jungleleaves_simple.png"},
631         paramtype = "light",
632         is_ground_content = false,
633         groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
634         drop = {
635                 max_items = 1,
636                 items = {
637                         {items = {'default:junglesapling'}, rarity = 20},
638                         {items = {'default:jungleleaves'}}
639                 }
640         },
641         sounds = default.node_sound_leaves_defaults(),
642
643         after_place_node = default.after_place_leaves,
644 })
645
646 minetest.register_node("default:junglesapling", {
647         description = "Jungle Sapling",
648         drawtype = "plantlike",
649         visual_scale = 1.0,
650         tiles = {"default_junglesapling.png"},
651         inventory_image = "default_junglesapling.png",
652         wield_image = "default_junglesapling.png",
653         paramtype = "light",
654         sunlight_propagates = true,
655         walkable = false,
656         on_timer = default.grow_sapling,
657         selection_box = {
658                 type = "fixed",
659                 fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
660         },
661         groups = {snappy = 2, dig_immediate = 3, flammable = 2,
662                 attached_node = 1, sapling = 1},
663         sounds = default.node_sound_leaves_defaults(),
664
665         on_construct = function(pos)
666                 minetest.get_node_timer(pos):start(math.random(2400,4800))
667         end,
668
669         on_place = function(itemstack, placer, pointed_thing)
670                 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
671                         "default:junglesapling",
672                         -- minp, maxp to be checked, relative to sapling pos
673                         -- minp_relative.y = 1 because sapling pos has been checked
674                         {x = -2, y = 1, z = -2},
675                         {x = 2, y = 15, z = 2},
676                         -- maximum interval of interior volume check
677                         4)
678
679                 return itemstack
680         end,
681 })
682
683
684 minetest.register_node("default:pine_tree", {
685         description = "Pine Tree",
686         tiles = {"default_pine_tree_top.png", "default_pine_tree_top.png",
687                 "default_pine_tree.png"},
688         paramtype2 = "facedir",
689         is_ground_content = false,
690         groups = {tree = 1, choppy = 3, oddly_breakable_by_hand = 1, flammable = 3},
691         sounds = default.node_sound_wood_defaults(),
692
693         on_place = minetest.rotate_node
694 })
695
696 minetest.register_node("default:pine_wood", {
697         description = "Pine Wood Planks",
698         paramtype2 = "facedir",
699         place_param2 = 0,
700         tiles = {"default_pine_wood.png"},
701         is_ground_content = false,
702         groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
703         sounds = default.node_sound_wood_defaults(),
704 })
705
706 minetest.register_node("default:pine_needles",{
707         description = "Pine Needles",
708         drawtype = "allfaces_optional",
709         visual_scale = 1.3,
710         tiles = {"default_pine_needles.png"},
711         waving = 1,
712         paramtype = "light",
713         is_ground_content = false,
714         groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
715         drop = {
716                 max_items = 1,
717                 items = {
718                         {items = {"default:pine_sapling"}, rarity = 20},
719                         {items = {"default:pine_needles"}}
720                 }
721         },
722         sounds = default.node_sound_leaves_defaults(),
723
724         after_place_node = default.after_place_leaves,
725 })
726
727 minetest.register_node("default:pine_sapling", {
728         description = "Pine Sapling",
729         drawtype = "plantlike",
730         visual_scale = 1.0,
731         tiles = {"default_pine_sapling.png"},
732         inventory_image = "default_pine_sapling.png",
733         wield_image = "default_pine_sapling.png",
734         paramtype = "light",
735         sunlight_propagates = true,
736         walkable = false,
737         on_timer = default.grow_sapling,
738         selection_box = {
739                 type = "fixed",
740                 fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
741         },
742         groups = {snappy = 2, dig_immediate = 3, flammable = 3,
743                 attached_node = 1, sapling = 1},
744         sounds = default.node_sound_leaves_defaults(),
745
746         on_construct = function(pos)
747                 minetest.get_node_timer(pos):start(math.random(2400,4800))
748         end,
749
750         on_place = function(itemstack, placer, pointed_thing)
751                 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
752                         "default:pine_sapling",
753                         -- minp, maxp to be checked, relative to sapling pos
754                         -- minp_relative.y = 1 because sapling pos has been checked
755                         {x = -2, y = 1, z = -2},
756                         {x = 2, y = 12, z = 2},
757                         -- maximum interval of interior volume check
758                         4)
759
760                 return itemstack
761         end,
762 })
763
764
765 minetest.register_node("default:acacia_tree", {
766         description = "Acacia Tree",
767         tiles = {"default_acacia_tree_top.png", "default_acacia_tree_top.png",
768                 "default_acacia_tree.png"},
769         paramtype2 = "facedir",
770         is_ground_content = false,
771         groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
772         sounds = default.node_sound_wood_defaults(),
773
774         on_place = minetest.rotate_node
775 })
776
777 minetest.register_node("default:acacia_wood", {
778         description = "Acacia Wood Planks",
779         paramtype2 = "facedir",
780         place_param2 = 0,
781         tiles = {"default_acacia_wood.png"},
782         is_ground_content = false,
783         groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
784         sounds = default.node_sound_wood_defaults(),
785 })
786
787 minetest.register_node("default:acacia_leaves", {
788         description = "Acacia Leaves",
789         drawtype = "allfaces_optional",
790         visual_scale = 1.3,
791         tiles = {"default_acacia_leaves.png"},
792         waving = 1,
793         paramtype = "light",
794         is_ground_content = false,
795         groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
796         drop = {
797                 max_items = 1,
798                 items = {
799                         {items = {"default:acacia_sapling"}, rarity = 20},
800                         {items = {"default:acacia_leaves"}}
801                 }
802         },
803         sounds = default.node_sound_leaves_defaults(),
804
805         after_place_node = default.after_place_leaves,
806 })
807
808 minetest.register_node("default:acacia_sapling", {
809         description = "Acacia Tree Sapling",
810         drawtype = "plantlike",
811         visual_scale = 1.0,
812         tiles = {"default_acacia_sapling.png"},
813         inventory_image = "default_acacia_sapling.png",
814         wield_image = "default_acacia_sapling.png",
815         paramtype = "light",
816         sunlight_propagates = true,
817         walkable = false,
818         on_timer = default.grow_sapling,
819         selection_box = {
820                 type = "fixed",
821                 fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
822         },
823         groups = {snappy = 2, dig_immediate = 3, flammable = 2,
824                 attached_node = 1, sapling = 1},
825         sounds = default.node_sound_leaves_defaults(),
826
827         on_construct = function(pos)
828                 minetest.get_node_timer(pos):start(math.random(2400,4800))
829         end,
830
831         on_place = function(itemstack, placer, pointed_thing)
832                 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
833                         "default:acacia_sapling",
834                         -- minp, maxp to be checked, relative to sapling pos
835                         -- minp_relative.y = 1 because sapling pos has been checked
836                         {x = -4, y = 1, z = -4},
837                         {x = 4, y = 6, z = 4},
838                         -- maximum interval of interior volume check
839                         4)
840
841                 return itemstack
842         end,
843 })
844
845 minetest.register_node("default:aspen_tree", {
846         description = "Aspen Tree",
847         tiles = {"default_aspen_tree_top.png", "default_aspen_tree_top.png",
848                 "default_aspen_tree.png"},
849         paramtype2 = "facedir",
850         is_ground_content = false,
851         groups = {tree = 1, choppy = 3, oddly_breakable_by_hand = 1, flammable = 3},
852         sounds = default.node_sound_wood_defaults(),
853
854         on_place = minetest.rotate_node
855 })
856
857 minetest.register_node("default:aspen_wood", {
858         description = "Aspen Wood Planks",
859         paramtype2 = "facedir",
860         place_param2 = 0,
861         tiles = {"default_aspen_wood.png"},
862         is_ground_content = false,
863         groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
864         sounds = default.node_sound_wood_defaults(),
865 })
866
867 minetest.register_node("default:aspen_leaves", {
868         description = "Aspen Leaves",
869         drawtype = "allfaces_optional",
870         visual_scale = 1.3,
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},
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},
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},
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 --
1220 -- Corals
1221 --
1222
1223 minetest.register_node("default:coral_brown", {
1224         description = "Brown Coral",
1225         tiles = {"default_coral_brown.png"},
1226         groups = {cracky = 3},
1227         drop = "default:coral_skeleton",
1228         sounds = default.node_sound_stone_defaults(),
1229 })
1230
1231 minetest.register_node("default:coral_orange", {
1232         description = "Orange Coral",
1233         tiles = {"default_coral_orange.png"},
1234         groups = {cracky = 3},
1235         drop = "default:coral_skeleton",
1236         sounds = default.node_sound_stone_defaults(),
1237 })
1238
1239 minetest.register_node("default:coral_skeleton", {
1240         description = "Coral Skeleton",
1241         tiles = {"default_coral_skeleton.png"},
1242         groups = {cracky = 3},
1243         sounds = default.node_sound_stone_defaults(),
1244 })
1245
1246
1247 --
1248 -- Liquids
1249 --
1250
1251 minetest.register_node("default:water_source", {
1252         description = "Water Source",
1253         drawtype = "liquid",
1254         tiles = {
1255                 {
1256                         name = "default_water_source_animated.png",
1257                         animation = {
1258                                 type = "vertical_frames",
1259                                 aspect_w = 16,
1260                                 aspect_h = 16,
1261                                 length = 2.0,
1262                         },
1263                 },
1264         },
1265         special_tiles = {
1266                 -- New-style water source material (mostly unused)
1267                 {
1268                         name = "default_water_source_animated.png",
1269                         animation = {
1270                                 type = "vertical_frames",
1271                                 aspect_w = 16,
1272                                 aspect_h = 16,
1273                                 length = 2.0,
1274                         },
1275                         backface_culling = false,
1276                 },
1277         },
1278         alpha = 160,
1279         paramtype = "light",
1280         walkable = false,
1281         pointable = false,
1282         diggable = false,
1283         buildable_to = true,
1284         is_ground_content = false,
1285         drop = "",
1286         drowning = 1,
1287         liquidtype = "source",
1288         liquid_alternative_flowing = "default:water_flowing",
1289         liquid_alternative_source = "default:water_source",
1290         liquid_viscosity = 1,
1291         post_effect_color = {a = 103, r = 30, g = 60, b = 90},
1292         groups = {water = 3, liquid = 3, puts_out_fire = 1},
1293 })
1294
1295 minetest.register_node("default:water_flowing", {
1296         description = "Flowing Water",
1297         drawtype = "flowingliquid",
1298         tiles = {"default_water.png"},
1299         special_tiles = {
1300                 {
1301                         name = "default_water_flowing_animated.png",
1302                         backface_culling = false,
1303                         animation = {
1304                                 type = "vertical_frames",
1305                                 aspect_w = 16,
1306                                 aspect_h = 16,
1307                                 length = 0.8,
1308                         },
1309                 },
1310                 {
1311                         name = "default_water_flowing_animated.png",
1312                         backface_culling = true,
1313                         animation = {
1314                                 type = "vertical_frames",
1315                                 aspect_w = 16,
1316                                 aspect_h = 16,
1317                                 length = 0.8,
1318                         },
1319                 },
1320         },
1321         alpha = 160,
1322         paramtype = "light",
1323         paramtype2 = "flowingliquid",
1324         walkable = false,
1325         pointable = false,
1326         diggable = false,
1327         buildable_to = true,
1328         is_ground_content = false,
1329         drop = "",
1330         drowning = 1,
1331         liquidtype = "flowing",
1332         liquid_alternative_flowing = "default:water_flowing",
1333         liquid_alternative_source = "default:water_source",
1334         liquid_viscosity = 1,
1335         post_effect_color = {a = 103, r = 30, g = 60, b = 90},
1336         groups = {water = 3, liquid = 3, puts_out_fire = 1,
1337                 not_in_creative_inventory = 1},
1338 })
1339
1340
1341 minetest.register_node("default:river_water_source", {
1342         description = "River Water Source",
1343         drawtype = "liquid",
1344         tiles = {
1345                 {
1346                         name = "default_river_water_source_animated.png",
1347                         animation = {
1348                                 type = "vertical_frames",
1349                                 aspect_w = 16,
1350                                 aspect_h = 16,
1351                                 length = 2.0,
1352                         },
1353                 },
1354         },
1355         special_tiles = {
1356                 {
1357                         name = "default_river_water_source_animated.png",
1358                         animation = {
1359                                 type = "vertical_frames",
1360                                 aspect_w = 16,
1361                                 aspect_h = 16,
1362                                 length = 2.0,
1363                         },
1364                         backface_culling = false,
1365                 },
1366         },
1367         alpha = 160,
1368         paramtype = "light",
1369         walkable = false,
1370         pointable = false,
1371         diggable = false,
1372         buildable_to = true,
1373         is_ground_content = false,
1374         drop = "",
1375         drowning = 1,
1376         liquidtype = "source",
1377         liquid_alternative_flowing = "default:river_water_flowing",
1378         liquid_alternative_source = "default:river_water_source",
1379         liquid_viscosity = 1,
1380         liquid_renewable = false,
1381         liquid_range = 2,
1382         post_effect_color = {a = 103, r = 30, g = 76, b = 90},
1383         groups = {water = 3, liquid = 3, puts_out_fire = 1},
1384 })
1385
1386 minetest.register_node("default:river_water_flowing", {
1387         description = "Flowing River Water",
1388         drawtype = "flowingliquid",
1389         tiles = {"default_river_water.png"},
1390         special_tiles = {
1391                 {
1392                         name = "default_river_water_flowing_animated.png",
1393                         backface_culling = false,
1394                         animation = {
1395                                 type = "vertical_frames",
1396                                 aspect_w = 16,
1397                                 aspect_h = 16,
1398                                 length = 0.8,
1399                         },
1400                 },
1401                 {
1402                         name = "default_river_water_flowing_animated.png",
1403                         backface_culling = true,
1404                         animation = {
1405                                 type = "vertical_frames",
1406                                 aspect_w = 16,
1407                                 aspect_h = 16,
1408                                 length = 0.8,
1409                         },
1410                 },
1411         },
1412         alpha = 160,
1413         paramtype = "light",
1414         paramtype2 = "flowingliquid",
1415         walkable = false,
1416         pointable = false,
1417         diggable = false,
1418         buildable_to = true,
1419         is_ground_content = false,
1420         drop = "",
1421         drowning = 1,
1422         liquidtype = "flowing",
1423         liquid_alternative_flowing = "default:river_water_flowing",
1424         liquid_alternative_source = "default:river_water_source",
1425         liquid_viscosity = 1,
1426         liquid_renewable = false,
1427         liquid_range = 2,
1428         post_effect_color = {a = 103, r = 30, g = 76, b = 90},
1429         groups = {water = 3, liquid = 3, puts_out_fire = 1,
1430                 not_in_creative_inventory = 1},
1431 })
1432
1433
1434 minetest.register_node("default:lava_source", {
1435         description = "Lava Source",
1436         drawtype = "liquid",
1437         tiles = {
1438                 {
1439                         name = "default_lava_source_animated.png",
1440                         animation = {
1441                                 type = "vertical_frames",
1442                                 aspect_w = 16,
1443                                 aspect_h = 16,
1444                                 length = 3.0,
1445                         },
1446                 },
1447         },
1448         special_tiles = {
1449                 -- New-style lava source material (mostly unused)
1450                 {
1451                         name = "default_lava_source_animated.png",
1452                         animation = {
1453                                 type = "vertical_frames",
1454                                 aspect_w = 16,
1455                                 aspect_h = 16,
1456                                 length = 3.0,
1457                         },
1458                         backface_culling = false,
1459                 },
1460         },
1461         paramtype = "light",
1462         light_source = default.LIGHT_MAX - 1,
1463         walkable = false,
1464         pointable = false,
1465         diggable = false,
1466         buildable_to = true,
1467         is_ground_content = false,
1468         drop = "",
1469         drowning = 1,
1470         liquidtype = "source",
1471         liquid_alternative_flowing = "default:lava_flowing",
1472         liquid_alternative_source = "default:lava_source",
1473         liquid_viscosity = 7,
1474         liquid_renewable = false,
1475         damage_per_second = 4 * 2,
1476         post_effect_color = {a = 191, r = 255, g = 64, b = 0},
1477         groups = {lava = 3, liquid = 2, igniter = 1},
1478 })
1479
1480 minetest.register_node("default:lava_flowing", {
1481         description = "Flowing Lava",
1482         drawtype = "flowingliquid",
1483         tiles = {"default_lava.png"},
1484         special_tiles = {
1485                 {
1486                         name = "default_lava_flowing_animated.png",
1487                         backface_culling = false,
1488                         animation = {
1489                                 type = "vertical_frames",
1490                                 aspect_w = 16,
1491                                 aspect_h = 16,
1492                                 length = 3.3,
1493                         },
1494                 },
1495                 {
1496                         name = "default_lava_flowing_animated.png",
1497                         backface_culling = true,
1498                         animation = {
1499                                 type = "vertical_frames",
1500                                 aspect_w = 16,
1501                                 aspect_h = 16,
1502                                 length = 3.3,
1503                         },
1504                 },
1505         },
1506         paramtype = "light",
1507         paramtype2 = "flowingliquid",
1508         light_source = default.LIGHT_MAX - 1,
1509         walkable = false,
1510         pointable = false,
1511         diggable = false,
1512         buildable_to = true,
1513         is_ground_content = false,
1514         drop = "",
1515         drowning = 1,
1516         liquidtype = "flowing",
1517         liquid_alternative_flowing = "default:lava_flowing",
1518         liquid_alternative_source = "default:lava_source",
1519         liquid_viscosity = 7,
1520         liquid_renewable = false,
1521         damage_per_second = 4 * 2,
1522         post_effect_color = {a = 191, r = 255, g = 64, b = 0},
1523         groups = {lava = 3, liquid = 2, igniter = 1,
1524                 not_in_creative_inventory = 1},
1525 })
1526
1527 --
1528 -- Tools / "Advanced" crafting / Non-"natural"
1529 --
1530
1531 minetest.register_node("default:torch", {
1532         description = "Torch",
1533         drawtype = "torchlike",
1534         tiles = {
1535                 {
1536                         name = "default_torch_on_floor_animated.png",
1537                         animation = {
1538                                 type = "vertical_frames",
1539                                 aspect_w = 16,
1540                                 aspect_h = 16,
1541                                 length = 3.0
1542                         },
1543                 },
1544                 {
1545                         name="default_torch_on_ceiling_animated.png",
1546                         animation = {
1547                                 type = "vertical_frames",
1548                                 aspect_w = 16,
1549                                 aspect_h = 16,
1550                                 length = 3.0
1551                         },
1552                 },
1553                 {
1554                         name="default_torch_animated.png",
1555                         animation = {
1556                                 type = "vertical_frames",
1557                                 aspect_w = 16,
1558                                 aspect_h = 16,
1559                                 length = 3.0
1560                         },
1561                 },
1562         },
1563         inventory_image = "default_torch_on_floor.png",
1564         wield_image = "default_torch_on_floor.png",
1565         paramtype = "light",
1566         paramtype2 = "wallmounted",
1567         sunlight_propagates = true,
1568         is_ground_content = false,
1569         walkable = false,
1570         light_source = default.LIGHT_MAX - 1,
1571         selection_box = {
1572                 type = "wallmounted",
1573                 wall_top = {-0.1, 0.5 - 0.6, -0.1, 0.1, 0.5, 0.1},
1574                 wall_bottom = {-0.1, -0.5, -0.1, 0.1, -0.5 + 0.6, 0.1},
1575                 wall_side = {-0.5, -0.3, -0.1, -0.5 + 0.3, 0.3, 0.1},
1576         },
1577         groups = {choppy = 2, dig_immediate = 3, flammable = 1, attached_node = 1},
1578         legacy_wallmounted = true,
1579         sounds = default.node_sound_defaults(),
1580 })
1581
1582
1583 local chest_formspec =
1584         "size[8,9]" ..
1585         default.gui_bg ..
1586         default.gui_bg_img ..
1587         default.gui_slots ..
1588         "list[current_name;main;0,0.3;8,4;]" ..
1589         "list[current_player;main;0,4.85;8,1;]" ..
1590         "list[current_player;main;0,6.08;8,3;8]" ..
1591         "listring[current_name;main]" ..
1592         "listring[current_player;main]" ..
1593         default.get_hotbar_bg(0,4.85)
1594
1595 local function get_locked_chest_formspec(pos)
1596         local spos = pos.x .. "," .. pos.y .. "," .. pos.z
1597         local formspec =
1598                 "size[8,9]" ..
1599                 default.gui_bg ..
1600                 default.gui_bg_img ..
1601                 default.gui_slots ..
1602                 "list[nodemeta:" .. spos .. ";main;0,0.3;8,4;]" ..
1603                 "list[current_player;main;0,4.85;8,1;]" ..
1604                 "list[current_player;main;0,6.08;8,3;8]" ..
1605                 "listring[nodemeta:" .. spos .. ";main]" ..
1606                 "listring[current_player;main]" ..
1607                 default.get_hotbar_bg(0,4.85)
1608  return formspec
1609 end
1610
1611 local function has_locked_chest_privilege(meta, player)
1612         local name = ""
1613         if player then
1614                 if minetest.check_player_privs(player, "protection_bypass") then
1615                         return true
1616                 end
1617                 name = player:get_player_name()
1618         end
1619         if name ~= meta:get_string("owner") then
1620                 return false
1621         end
1622         return true
1623 end
1624
1625 minetest.register_node("default:chest", {
1626         description = "Chest",
1627         tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
1628                 "default_chest_side.png", "default_chest_side.png", "default_chest_front.png"},
1629         paramtype2 = "facedir",
1630         groups = {choppy = 2, oddly_breakable_by_hand = 2},
1631         legacy_facedir_simple = true,
1632         is_ground_content = false,
1633         sounds = default.node_sound_wood_defaults(),
1634
1635         on_construct = function(pos)
1636                 local meta = minetest.get_meta(pos)
1637                 meta:set_string("formspec", chest_formspec)
1638                 local inv = meta:get_inventory()
1639                 inv:set_size("main", 8*4)
1640         end,
1641         can_dig = function(pos,player)
1642                 local meta = minetest.get_meta(pos);
1643                 local inv = meta:get_inventory()
1644                 return inv:is_empty("main")
1645         end,
1646         on_metadata_inventory_move = function(pos, from_list, from_index,
1647                         to_list, to_index, count, player)
1648                 minetest.log("action", player:get_player_name() ..
1649                         " moves stuff in chest at " .. minetest.pos_to_string(pos))
1650         end,
1651     on_metadata_inventory_put = function(pos, listname, index, stack, player)
1652                 minetest.log("action", player:get_player_name() ..
1653                         " moves " .. stack:get_name() ..
1654                         " to chest at " .. minetest.pos_to_string(pos))
1655         end,
1656     on_metadata_inventory_take = function(pos, listname, index, stack, player)
1657                 minetest.log("action", player:get_player_name() ..
1658                         " takes " .. stack:get_name() ..
1659                         " from chest at " .. minetest.pos_to_string(pos))
1660         end,
1661         on_blast = function(pos)
1662                 local drops = {}
1663                 default.get_inventory_drops(pos, "main", drops)
1664                 drops[#drops+1] = "default:chest"
1665                 minetest.remove_node(pos)
1666                 return drops
1667         end,
1668 })
1669
1670 minetest.register_node("default:chest_locked", {
1671         description = "Locked Chest",
1672         tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
1673                 "default_chest_side.png", "default_chest_side.png", "default_chest_lock.png"},
1674         paramtype2 = "facedir",
1675         groups = {choppy = 2, oddly_breakable_by_hand = 2},
1676         legacy_facedir_simple = true,
1677         is_ground_content = false,
1678         sounds = default.node_sound_wood_defaults(),
1679
1680         after_place_node = function(pos, placer)
1681                 local meta = minetest.get_meta(pos)
1682                 meta:set_string("owner", placer:get_player_name() or "")
1683                 meta:set_string("infotext", "Locked Chest (owned by " ..
1684                                 meta:get_string("owner") .. ")")
1685         end,
1686         on_construct = function(pos)
1687                 local meta = minetest.get_meta(pos)
1688                 meta:set_string("owner", "")
1689                 local inv = meta:get_inventory()
1690                 inv:set_size("main", 8 * 4)
1691         end,
1692         can_dig = function(pos,player)
1693                 local meta = minetest.get_meta(pos);
1694                 local inv = meta:get_inventory()
1695                 return inv:is_empty("main") and has_locked_chest_privilege(meta, player)
1696         end,
1697         allow_metadata_inventory_move = function(pos, from_list, from_index,
1698                         to_list, to_index, count, player)
1699                 local meta = minetest.get_meta(pos)
1700                 if not has_locked_chest_privilege(meta, player) then
1701                         return 0
1702                 end
1703                 return count
1704         end,
1705     allow_metadata_inventory_put = function(pos, listname, index, stack, player)
1706                 local meta = minetest.get_meta(pos)
1707                 if not has_locked_chest_privilege(meta, player) then
1708                         return 0
1709                 end
1710                 return stack:get_count()
1711         end,
1712     allow_metadata_inventory_take = function(pos, listname, index, stack, player)
1713                 local meta = minetest.get_meta(pos)
1714                 if not has_locked_chest_privilege(meta, player) then
1715                         return 0
1716                 end
1717                 return stack:get_count()
1718         end,
1719     on_metadata_inventory_put = function(pos, listname, index, stack, player)
1720                 minetest.log("action", player:get_player_name() ..
1721                         " moves " .. stack:get_name() ..
1722                         " to locked chest at " .. minetest.pos_to_string(pos))
1723         end,
1724     on_metadata_inventory_take = function(pos, listname, index, stack, player)
1725                 minetest.log("action", player:get_player_name() ..
1726                         " takes " .. stack:get_name()  ..
1727                         " from locked chest at " .. minetest.pos_to_string(pos))
1728         end,
1729         on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
1730                 local meta = minetest.get_meta(pos)
1731                 if has_locked_chest_privilege(meta, clicker) then
1732                         minetest.show_formspec(
1733                                 clicker:get_player_name(),
1734                                 "default:chest_locked",
1735                                 get_locked_chest_formspec(pos)
1736                         )
1737                 end
1738                 return itemstack
1739         end,
1740         on_blast = function() end,
1741 })
1742
1743
1744 local bookshelf_formspec =
1745         "size[8,7;]" ..
1746         default.gui_bg ..
1747         default.gui_bg_img ..
1748         default.gui_slots ..
1749         "list[context;books;0,0.3;8,2;]" ..
1750         "list[current_player;main;0,2.85;8,1;]" ..
1751         "list[current_player;main;0,4.08;8,3;8]" ..
1752         "listring[context;books]" ..
1753         "listring[current_player;main]" ..
1754         default.get_hotbar_bg(0,2.85)
1755
1756 minetest.register_node("default:bookshelf", {
1757         description = "Bookshelf",
1758         tiles = {"default_wood.png", "default_wood.png", "default_wood.png",
1759                 "default_wood.png", "default_bookshelf.png", "default_bookshelf.png"},
1760         paramtype2 = "facedir",
1761         is_ground_content = false,
1762         groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
1763         sounds = default.node_sound_wood_defaults(),
1764
1765         on_construct = function(pos)
1766                 local meta = minetest.get_meta(pos)
1767                 meta:set_string("formspec", bookshelf_formspec)
1768                 local inv = meta:get_inventory()
1769                 inv:set_size("books", 8 * 2)
1770         end,
1771         can_dig = function(pos,player)
1772                 local inv = minetest.get_meta(pos):get_inventory()
1773                 return inv:is_empty("books")
1774         end,
1775         allow_metadata_inventory_put = function(pos, listname, index, stack)
1776                 if minetest.get_item_group(stack:get_name(), "book") ~= 0 then
1777                         return stack:get_count()
1778                 end
1779                 return 0
1780         end,
1781         on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
1782                 minetest.log("action", player:get_player_name() ..
1783                         " moves stuff in bookshelf at " .. minetest.pos_to_string(pos))
1784         end,
1785         on_metadata_inventory_put = function(pos, listname, index, stack, player)
1786                 minetest.log("action", player:get_player_name() ..
1787                         " moves stuff to bookshelf at " .. minetest.pos_to_string(pos))
1788         end,
1789         on_metadata_inventory_take = function(pos, listname, index, stack, player)
1790                 minetest.log("action", player:get_player_name() ..
1791                         " takes stuff from bookshelf at " .. minetest.pos_to_string(pos))
1792         end,
1793         on_blast = function(pos)
1794                 local drops = {}
1795                 default.get_inventory_drops(pos, "books", drops)
1796                 drops[#drops+1] = "default:bookshelf"
1797                 minetest.remove_node(pos)
1798                 return drops
1799         end,
1800 })
1801
1802 local function register_sign(material, desc, def)
1803         minetest.register_node("default:sign_wall_" .. material, {
1804                 description = desc .. " Sign",
1805                 drawtype = "nodebox",
1806                 tiles = {"default_sign_wall_" .. material .. ".png"},
1807                 inventory_image = "default_sign_" .. material .. ".png",
1808                 wield_image = "default_sign_" .. material .. ".png",
1809                 paramtype = "light",
1810                 paramtype2 = "wallmounted",
1811                 sunlight_propagates = true,
1812                 is_ground_content = false,
1813                 walkable = false,
1814                 node_box = {
1815                         type = "wallmounted",
1816                         wall_top    = {-0.4375, 0.4375, -0.3125, 0.4375, 0.5, 0.3125},
1817                         wall_bottom = {-0.4375, -0.5, -0.3125, 0.4375, -0.4375, 0.3125},
1818                         wall_side   = {-0.5, -0.3125, -0.4375, -0.4375, 0.3125, 0.4375},
1819                 },
1820                 groups = def.groups,
1821                 legacy_wallmounted = true,
1822                 sounds = def.sounds,
1823
1824                 on_construct = function(pos)
1825                         --local n = minetest.get_node(pos)
1826                         local meta = minetest.get_meta(pos)
1827                         meta:set_string("formspec", "field[text;;${text}]")
1828                 end,
1829                 on_receive_fields = function(pos, formname, fields, sender)
1830                         --print("Sign at "..minetest.pos_to_string(pos).." got "..dump(fields))
1831                         local player_name = sender:get_player_name()
1832                         if minetest.is_protected(pos, player_name) then
1833                                 minetest.record_protection_violation(pos, player_name)
1834                                 return
1835                         end
1836                         local meta = minetest.get_meta(pos)
1837                         if not fields.text then return end
1838                         minetest.log("action", (player_name or "") .. " wrote \"" ..
1839                                 fields.text .. "\" to sign at " .. minetest.pos_to_string(pos))
1840                         meta:set_string("text", fields.text)
1841                         meta:set_string("infotext", '"' .. fields.text .. '"')
1842                 end,
1843         })
1844 end
1845
1846 register_sign("wood", "Wooden", {
1847         sounds = default.node_sound_wood_defaults(),
1848         groups = {choppy = 2, attached_node = 1, flammable = 2, oddly_breakable_by_hand = 3}
1849 })
1850
1851 register_sign("steel", "Steel", {
1852         sounds = default.node_sound_metal_defaults(),
1853         groups = {cracky = 2, attached_node = 1}
1854 })
1855
1856 minetest.register_node("default:ladder_wood", {
1857         description = "Wooden Ladder",
1858         drawtype = "signlike",
1859         tiles = {"default_ladder_wood.png"},
1860         inventory_image = "default_ladder_wood.png",
1861         wield_image = "default_ladder_wood.png",
1862         paramtype = "light",
1863         paramtype2 = "wallmounted",
1864         sunlight_propagates = true,
1865         walkable = false,
1866         climbable = true,
1867         is_ground_content = false,
1868         selection_box = {
1869                 type = "wallmounted",
1870                 --wall_top = = <default>
1871                 --wall_bottom = = <default>
1872                 --wall_side = = <default>
1873         },
1874         groups = {choppy = 2, oddly_breakable_by_hand = 3, flammable = 2},
1875         legacy_wallmounted = true,
1876         sounds = default.node_sound_wood_defaults(),
1877 })
1878
1879 minetest.register_node("default:ladder_steel", {
1880         description = "Steel Ladder",
1881         drawtype = "signlike",
1882         tiles = {"default_ladder_steel.png"},
1883         inventory_image = "default_ladder_steel.png",
1884         wield_image = "default_ladder_steel.png",
1885         paramtype = "light",
1886         paramtype2 = "wallmounted",
1887         sunlight_propagates = true,
1888         walkable = false,
1889         climbable = true,
1890         is_ground_content = false,
1891         selection_box = {
1892                 type = "wallmounted",
1893                 --wall_top = = <default>
1894                 --wall_bottom = = <default>
1895                 --wall_side = = <default>
1896         },
1897         groups = {cracky = 2},
1898         sounds = default.node_sound_metal_defaults(),
1899 })
1900
1901 default.register_fence("default:fence_wood", {
1902         description = "Wooden Fence",
1903         texture = "default_fence_wood.png",
1904         inventory_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1905         wield_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1906         material = "default:wood",
1907         groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
1908         sounds = default.node_sound_wood_defaults()
1909 })
1910
1911 default.register_fence("default:fence_acacia_wood", {
1912         description = "Acacia Fence",
1913         texture = "default_fence_acacia_wood.png",
1914         inventory_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1915         wield_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1916         material = "default:acacia_wood",
1917         groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
1918         sounds = default.node_sound_wood_defaults()
1919 })
1920
1921 default.register_fence("default:fence_junglewood", {
1922         description = "Junglewood Fence",
1923         texture = "default_fence_junglewood.png",
1924         inventory_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126",
1925         wield_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126",
1926         material = "default:junglewood",
1927         groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
1928         sounds = default.node_sound_wood_defaults()
1929 })
1930
1931 default.register_fence("default:fence_pine_wood", {
1932         description = "Pine Fence",
1933         texture = "default_fence_pine_wood.png",
1934         inventory_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1935         wield_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1936         material = "default:pine_wood",
1937         groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
1938         sounds = default.node_sound_wood_defaults()
1939 })
1940
1941 default.register_fence("default:fence_aspen_wood", {
1942         description = "Aspen Fence",
1943         texture = "default_fence_aspen_wood.png",
1944         inventory_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1945         wield_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1946         material = "default:aspen_wood",
1947         groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
1948         sounds = default.node_sound_wood_defaults()
1949 })
1950
1951 minetest.register_node("default:glass", {
1952         description = "Glass",
1953         drawtype = "glasslike_framed_optional",
1954         tiles = {"default_glass.png", "default_glass_detail.png"},
1955         paramtype = "light",
1956         sunlight_propagates = true,
1957         is_ground_content = false,
1958         groups = {cracky = 3, oddly_breakable_by_hand = 3},
1959         sounds = default.node_sound_glass_defaults(),
1960 })
1961
1962 minetest.register_node("default:obsidian_glass", {
1963         description = "Obsidian Glass",
1964         drawtype = "glasslike_framed_optional",
1965         tiles = {"default_obsidian_glass.png", "default_obsidian_glass_detail.png"},
1966         paramtype = "light",
1967         is_ground_content = false,
1968         sunlight_propagates = true,
1969         sounds = default.node_sound_glass_defaults(),
1970         groups = {cracky = 3},
1971 })
1972
1973
1974 minetest.register_node("default:rail", {
1975         description = "Rail",
1976         drawtype = "raillike",
1977         tiles = {"default_rail.png", "default_rail_curved.png",
1978                 "default_rail_t_junction.png", "default_rail_crossing.png"},
1979         inventory_image = "default_rail.png",
1980         wield_image = "default_rail.png",
1981         paramtype = "light",
1982         sunlight_propagates = true,
1983         walkable = false,
1984         is_ground_content = false,
1985         selection_box = {
1986                 type = "fixed",
1987                 -- but how to specify the dimensions for curved and sideways rails?
1988                 fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
1989         },
1990         groups = {dig_immediate = 2, attached_node = 1,
1991                 connect_to_raillike = minetest.raillike_group("rail")},
1992 })
1993
1994
1995 minetest.register_node("default:brick", {
1996         description = "Brick Block",
1997         paramtype2 = "facedir",
1998         place_param2 = 0,
1999         tiles = {"default_brick.png"},
2000         is_ground_content = false,
2001         groups = {cracky = 3},
2002         sounds = default.node_sound_stone_defaults(),
2003 })
2004
2005
2006 minetest.register_node("default:meselamp", {
2007         description = "Mese Lamp",
2008         drawtype = "glasslike",
2009         tiles = {"default_meselamp.png"},
2010         paramtype = "light",
2011         sunlight_propagates = true,
2012         is_ground_content = false,
2013         groups = {cracky = 3, oddly_breakable_by_hand = 3},
2014         sounds = default.node_sound_glass_defaults(),
2015         light_source = default.LIGHT_MAX,
2016 })
2017
2018 --
2019 -- Misc
2020 --
2021
2022 minetest.register_node("default:cloud", {
2023         description = "Cloud",
2024         tiles = {"default_cloud.png"},
2025         is_ground_content = false,
2026         sounds = default.node_sound_defaults(),
2027         groups = {not_in_creative_inventory = 1},
2028 })