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