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