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