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