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