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