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