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