1 -- mods/default/nodes.lua
4 --[[ Node name convention:
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.
17 (1. Material 2. Cobble variant 3. Brick variant 4. Modified forms)
27 default:desert_stonebrick
28 default:desert_stone_block
31 default:sandstonebrick
32 default:sandstone_block
36 default:obsidian_block
40 (1. Material 2. Modified forms)
43 default:dirt_with_grass
44 default:dirt_with_grass_footsteps
45 default:dirt_with_dry_grass
46 default:dirt_with_snow
63 (1. Trunk 2. Fabricated trunk 3. Leaves 4. Sapling 5. Fruits)
84 default:acacia_sapling
93 (1. In stone 2. Blocks)
95 default:stone_with_coal
98 default:stone_with_iron
101 default:stone_with_copper
105 default:stone_with_gold
108 default:stone_with_mese
111 default:stone_with_diamond
136 default:acacia_bush_stem
137 default:acacia_bush_leaves
144 default:coral_skeleton
148 (1. Source 2. Flowing)
151 default:water_flowing
153 default:river_water_source
154 default:river_water_flowing
159 Tools / "Advanced" crafting / Non-"natural"
160 -------------------------------------------
169 default:sign_wall_wood
170 default:sign_wall_steel
176 default:fence_acacia_wood
177 default:fence_junglewood
178 default:fence_pine_wood
179 default:fence_aspen_wood
182 default:obsidian_glass
201 minetest.register_node("default:stone", {
202 description = "Stone",
203 tiles = {"default_stone.png"},
204 groups = {cracky = 3, stone = 1},
205 drop = 'default:cobble',
206 legacy_mineral = true,
207 sounds = default.node_sound_stone_defaults(),
210 minetest.register_node("default:cobble", {
211 description = "Cobblestone",
212 tiles = {"default_cobble.png"},
213 is_ground_content = false,
214 groups = {cracky = 3, stone = 2},
215 sounds = default.node_sound_stone_defaults(),
218 minetest.register_node("default:stonebrick", {
219 description = "Stone Brick",
220 paramtype2 = "facedir",
222 tiles = {"default_stone_brick.png"},
223 is_ground_content = false,
224 groups = {cracky = 2, stone = 1},
225 sounds = default.node_sound_stone_defaults(),
228 minetest.register_node("default:stone_block", {
229 description = "Stone Block",
230 tiles = {"default_stone_block.png"},
231 is_ground_content = false,
232 groups = {cracky = 2, stone = 1},
233 sounds = default.node_sound_stone_defaults(),
236 minetest.register_node("default:mossycobble", {
237 description = "Mossy Cobblestone",
238 tiles = {"default_mossycobble.png"},
239 is_ground_content = false,
240 groups = {cracky = 3, stone = 1},
241 sounds = default.node_sound_stone_defaults(),
245 minetest.register_node("default:desert_stone", {
246 description = "Desert Stone",
247 tiles = {"default_desert_stone.png"},
248 groups = {cracky = 3, stone = 1},
249 drop = 'default:desert_cobble',
250 legacy_mineral = true,
251 sounds = default.node_sound_stone_defaults(),
254 minetest.register_node("default:desert_cobble", {
255 description = "Desert Cobblestone",
256 tiles = {"default_desert_cobble.png"},
257 is_ground_content = false,
258 groups = {cracky = 3, stone = 2},
259 sounds = default.node_sound_stone_defaults(),
262 minetest.register_node("default:desert_stonebrick", {
263 description = "Desert Stone Brick",
264 paramtype2 = "facedir",
266 tiles = {"default_desert_stone_brick.png"},
267 is_ground_content = false,
268 groups = {cracky = 2, stone = 1},
269 sounds = default.node_sound_stone_defaults(),
272 minetest.register_node("default:desert_stone_block", {
273 description = "Desert Stone Block",
274 tiles = {"default_desert_stone_block.png"},
275 is_ground_content = false,
276 groups = {cracky = 2, stone = 1},
277 sounds = default.node_sound_stone_defaults(),
281 minetest.register_node("default:sandstone", {
282 description = "Sandstone",
283 tiles = {"default_sandstone.png"},
284 groups = {crumbly = 1, cracky = 3},
285 sounds = default.node_sound_stone_defaults(),
288 minetest.register_node("default:sandstonebrick", {
289 description = "Sandstone Brick",
290 paramtype2 = "facedir",
292 tiles = {"default_sandstone_brick.png"},
293 is_ground_content = false,
294 groups = {cracky = 2},
295 sounds = default.node_sound_stone_defaults(),
298 minetest.register_node("default:sandstone_block", {
299 description = "Sandstone Block",
300 tiles = {"default_sandstone_block.png"},
301 is_ground_content = false,
302 groups = {cracky = 2},
303 sounds = default.node_sound_stone_defaults(),
307 minetest.register_node("default:obsidian", {
308 description = "Obsidian",
309 tiles = {"default_obsidian.png"},
310 sounds = default.node_sound_stone_defaults(),
311 groups = {cracky = 1, level = 2},
314 minetest.register_node("default:obsidianbrick", {
315 description = "Obsidian Brick",
316 paramtype2 = "facedir",
318 tiles = {"default_obsidian_brick.png"},
319 is_ground_content = false,
320 sounds = default.node_sound_stone_defaults(),
321 groups = {cracky = 1, level = 2},
324 minetest.register_node("default:obsidian_block", {
325 description = "Obsidian Block",
326 tiles = {"default_obsidian_block.png"},
327 is_ground_content = false,
328 sounds = default.node_sound_stone_defaults(),
329 groups = {cracky = 1, level = 2},
336 minetest.register_node("default:dirt", {
337 description = "Dirt",
338 tiles = {"default_dirt.png"},
339 groups = {crumbly = 3, soil = 1},
340 sounds = default.node_sound_dirt_defaults(),
343 minetest.register_node("default:dirt_with_grass", {
344 description = "Dirt with Grass",
345 tiles = {"default_grass.png", "default_dirt.png",
346 {name = "default_dirt.png^default_grass_side.png",
347 tileable_vertical = false}},
348 groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
349 drop = 'default:dirt',
350 sounds = default.node_sound_dirt_defaults({
351 footstep = {name = "default_grass_footstep", gain = 0.25},
355 minetest.register_node("default:dirt_with_grass_footsteps", {
356 description = "Dirt with Grass and Footsteps",
357 tiles = {"default_grass.png^default_footprint.png", "default_dirt.png",
358 {name = "default_dirt.png^default_grass_side.png",
359 tileable_vertical = false}},
360 groups = {crumbly = 3, soil = 1, not_in_creative_inventory = 1},
361 drop = 'default:dirt',
362 sounds = default.node_sound_dirt_defaults({
363 footstep = {name = "default_grass_footstep", gain = 0.25},
367 minetest.register_node("default:dirt_with_dry_grass", {
368 description = "Dirt with Dry Grass",
369 tiles = {"default_dry_grass.png",
371 {name = "default_dirt.png^default_dry_grass_side.png",
372 tileable_vertical = false}},
373 groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
374 drop = 'default:dirt',
375 sounds = default.node_sound_dirt_defaults({
376 footstep = {name = "default_grass_footstep", gain = 0.4},
380 minetest.register_node("default:dirt_with_snow", {
381 description = "Dirt with Snow",
382 tiles = {"default_snow.png", "default_dirt.png",
383 {name = "default_dirt.png^default_snow_side.png",
384 tileable_vertical = false}},
385 groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
386 drop = 'default:dirt',
387 sounds = default.node_sound_dirt_defaults({
388 footstep = {name = "default_snow_footstep", gain = 0.15},
392 minetest.register_node("default:sand", {
393 description = "Sand",
394 tiles = {"default_sand.png"},
395 groups = {crumbly = 3, falling_node = 1, sand = 1},
396 sounds = default.node_sound_sand_defaults(),
399 minetest.register_node("default:desert_sand", {
400 description = "Desert Sand",
401 tiles = {"default_desert_sand.png"},
402 groups = {crumbly = 3, falling_node = 1, sand = 1},
403 sounds = default.node_sound_sand_defaults(),
406 minetest.register_node("default:silver_sand", {
407 description = "Silver Sand",
408 tiles = {"default_silver_sand.png"},
409 groups = {crumbly = 3, falling_node = 1, sand = 1},
410 sounds = default.node_sound_sand_defaults(),
414 minetest.register_node("default:gravel", {
415 description = "Gravel",
416 tiles = {"default_gravel.png"},
417 groups = {crumbly = 2, falling_node = 1},
418 sounds = default.node_sound_gravel_defaults(),
422 {items = {'default:flint'}, rarity = 16},
423 {items = {'default:gravel'}}
428 minetest.register_node("default:clay", {
429 description = "Clay",
430 tiles = {"default_clay.png"},
431 groups = {crumbly = 3},
432 drop = 'default:clay_lump 4',
433 sounds = default.node_sound_dirt_defaults(),
437 minetest.register_node("default:snow", {
438 description = "Snow",
439 tiles = {"default_snow.png"},
440 inventory_image = "default_snowball.png",
441 wield_image = "default_snowball.png",
445 drawtype = "nodebox",
449 {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
452 groups = {crumbly = 3, falling_node = 1, puts_out_fire = 1},
453 sounds = default.node_sound_dirt_defaults({
454 footstep = {name = "default_snow_footstep", gain = 0.15},
455 dug = {name = "default_snow_footstep", gain = 0.2},
456 dig = {name = "default_snow_footstep", gain = 0.2}
459 on_construct = function(pos)
461 if minetest.get_node(pos).name == "default:dirt_with_grass" then
462 minetest.set_node(pos, {name = "default:dirt_with_snow"})
467 minetest.register_node("default:snowblock", {
468 description = "Snow Block",
469 tiles = {"default_snow.png"},
470 groups = {crumbly = 3, puts_out_fire = 1},
471 sounds = default.node_sound_dirt_defaults({
472 footstep = {name = "default_snow_footstep", gain = 0.15},
473 dug = {name = "default_snow_footstep", gain = 0.2},
474 dig = {name = "default_snow_footstep", gain = 0.2}
477 on_construct = function(pos)
479 if minetest.get_node(pos).name == "default:dirt_with_grass" then
480 minetest.set_node(pos, {name = "default:dirt_with_snow"})
485 minetest.register_node("default:ice", {
487 tiles = {"default_ice.png"},
488 is_ground_content = false,
490 groups = {cracky = 3, puts_out_fire = 1},
491 sounds = default.node_sound_glass_defaults(),
498 minetest.register_node("default:tree", {
499 description = "Tree",
500 tiles = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"},
501 paramtype2 = "facedir",
502 is_ground_content = false,
503 groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
504 sounds = default.node_sound_wood_defaults(),
506 on_place = minetest.rotate_node
509 minetest.register_node("default:wood", {
510 description = "Wooden Planks",
511 paramtype2 = "facedir",
513 tiles = {"default_wood.png"},
514 is_ground_content = false,
515 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
516 sounds = default.node_sound_wood_defaults(),
519 minetest.register_node("default:sapling", {
520 description = "Sapling",
521 drawtype = "plantlike",
523 tiles = {"default_sapling.png"},
524 inventory_image = "default_sapling.png",
525 wield_image = "default_sapling.png",
527 sunlight_propagates = true,
529 on_timer = default.grow_sapling,
532 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
534 groups = {snappy = 2, dig_immediate = 3, flammable = 2,
535 attached_node = 1, sapling = 1},
536 sounds = default.node_sound_leaves_defaults(),
538 on_construct = function(pos)
539 minetest.get_node_timer(pos):start(math.random(2400,4800))
542 on_place = function(itemstack, placer, pointed_thing)
543 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
545 -- minp, maxp to be checked, relative to sapling pos
546 -- minp_relative.y = 1 because sapling pos has been checked
547 {x = -2, y = 1, z = -2},
548 {x = 2, y = 6, z = 2},
549 -- maximum interval of interior volume check
556 minetest.register_node("default:leaves", {
557 description = "Leaves",
558 drawtype = "allfaces_optional",
560 tiles = {"default_leaves.png"},
561 special_tiles = {"default_leaves_simple.png"},
563 is_ground_content = false,
564 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
569 -- player will get sapling with 1/20 chance
570 items = {'default:sapling'},
574 -- player will get leaves only if he get no saplings,
575 -- this is because max_items is 1
576 items = {'default:leaves'},
580 sounds = default.node_sound_leaves_defaults(),
582 after_place_node = default.after_place_leaves,
585 minetest.register_node("default:apple", {
586 description = "Apple",
587 drawtype = "plantlike",
589 tiles = {"default_apple.png"},
590 inventory_image = "default_apple.png",
592 sunlight_propagates = true,
594 is_ground_content = false,
597 fixed = {-3 / 16, -7 / 16, -3 / 16, 3 / 16, 4 / 16, 3 / 16}
599 groups = {fleshy = 3, dig_immediate = 3, flammable = 2,
600 leafdecay = 3, leafdecay_drop = 1},
601 on_use = minetest.item_eat(2),
602 sounds = default.node_sound_leaves_defaults(),
604 after_place_node = function(pos, placer, itemstack)
605 if placer:is_player() then
606 minetest.set_node(pos, {name = "default:apple", param2 = 1})
612 minetest.register_node("default:jungletree", {
613 description = "Jungle Tree",
614 tiles = {"default_jungletree_top.png", "default_jungletree_top.png",
615 "default_jungletree.png"},
616 paramtype2 = "facedir",
617 is_ground_content = false,
618 groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
619 sounds = default.node_sound_wood_defaults(),
621 on_place = minetest.rotate_node
624 minetest.register_node("default:junglewood", {
625 description = "Junglewood Planks",
626 paramtype2 = "facedir",
628 tiles = {"default_junglewood.png"},
629 is_ground_content = false,
630 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
631 sounds = default.node_sound_wood_defaults(),
634 minetest.register_node("default:jungleleaves", {
635 description = "Jungle Leaves",
636 drawtype = "allfaces_optional",
638 tiles = {"default_jungleleaves.png"},
639 special_tiles = {"default_jungleleaves_simple.png"},
641 is_ground_content = false,
642 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
646 {items = {'default:junglesapling'}, rarity = 20},
647 {items = {'default:jungleleaves'}}
650 sounds = default.node_sound_leaves_defaults(),
652 after_place_node = default.after_place_leaves,
655 minetest.register_node("default:junglesapling", {
656 description = "Jungle Sapling",
657 drawtype = "plantlike",
659 tiles = {"default_junglesapling.png"},
660 inventory_image = "default_junglesapling.png",
661 wield_image = "default_junglesapling.png",
663 sunlight_propagates = true,
665 on_timer = default.grow_sapling,
668 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
670 groups = {snappy = 2, dig_immediate = 3, flammable = 2,
671 attached_node = 1, sapling = 1},
672 sounds = default.node_sound_leaves_defaults(),
674 on_construct = function(pos)
675 minetest.get_node_timer(pos):start(math.random(2400,4800))
678 on_place = function(itemstack, placer, pointed_thing)
679 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
680 "default:junglesapling",
681 -- minp, maxp to be checked, relative to sapling pos
682 -- minp_relative.y = 1 because sapling pos has been checked
683 {x = -2, y = 1, z = -2},
684 {x = 2, y = 15, z = 2},
685 -- maximum interval of interior volume check
693 minetest.register_node("default:pine_tree", {
694 description = "Pine Tree",
695 tiles = {"default_pine_tree_top.png", "default_pine_tree_top.png",
696 "default_pine_tree.png"},
697 paramtype2 = "facedir",
698 is_ground_content = false,
699 groups = {tree = 1, choppy = 3, oddly_breakable_by_hand = 1, flammable = 3},
700 sounds = default.node_sound_wood_defaults(),
702 on_place = minetest.rotate_node
705 minetest.register_node("default:pine_wood", {
706 description = "Pine Wood Planks",
707 paramtype2 = "facedir",
709 tiles = {"default_pine_wood.png"},
710 is_ground_content = false,
711 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
712 sounds = default.node_sound_wood_defaults(),
715 minetest.register_node("default:pine_needles",{
716 description = "Pine Needles",
717 drawtype = "allfaces_optional",
718 tiles = {"default_pine_needles.png"},
721 is_ground_content = false,
722 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
726 {items = {"default:pine_sapling"}, rarity = 20},
727 {items = {"default:pine_needles"}}
730 sounds = default.node_sound_leaves_defaults(),
732 after_place_node = default.after_place_leaves,
735 minetest.register_node("default:pine_sapling", {
736 description = "Pine Sapling",
737 drawtype = "plantlike",
739 tiles = {"default_pine_sapling.png"},
740 inventory_image = "default_pine_sapling.png",
741 wield_image = "default_pine_sapling.png",
743 sunlight_propagates = true,
745 on_timer = default.grow_sapling,
748 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
750 groups = {snappy = 2, dig_immediate = 3, flammable = 3,
751 attached_node = 1, sapling = 1},
752 sounds = default.node_sound_leaves_defaults(),
754 on_construct = function(pos)
755 minetest.get_node_timer(pos):start(math.random(2400,4800))
758 on_place = function(itemstack, placer, pointed_thing)
759 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
760 "default:pine_sapling",
761 -- minp, maxp to be checked, relative to sapling pos
762 -- minp_relative.y = 1 because sapling pos has been checked
763 {x = -2, y = 1, z = -2},
764 {x = 2, y = 12, z = 2},
765 -- maximum interval of interior volume check
773 minetest.register_node("default:acacia_tree", {
774 description = "Acacia Tree",
775 tiles = {"default_acacia_tree_top.png", "default_acacia_tree_top.png",
776 "default_acacia_tree.png"},
777 paramtype2 = "facedir",
778 is_ground_content = false,
779 groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
780 sounds = default.node_sound_wood_defaults(),
782 on_place = minetest.rotate_node
785 minetest.register_node("default:acacia_wood", {
786 description = "Acacia Wood Planks",
787 paramtype2 = "facedir",
789 tiles = {"default_acacia_wood.png"},
790 is_ground_content = false,
791 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
792 sounds = default.node_sound_wood_defaults(),
795 minetest.register_node("default:acacia_leaves", {
796 description = "Acacia Leaves",
797 drawtype = "allfaces_optional",
798 tiles = {"default_acacia_leaves.png"},
799 special_tiles = {"default_acacia_leaves_simple.png"},
802 is_ground_content = false,
803 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
807 {items = {"default:acacia_sapling"}, rarity = 20},
808 {items = {"default:acacia_leaves"}}
811 sounds = default.node_sound_leaves_defaults(),
813 after_place_node = default.after_place_leaves,
816 minetest.register_node("default:acacia_sapling", {
817 description = "Acacia Tree Sapling",
818 drawtype = "plantlike",
820 tiles = {"default_acacia_sapling.png"},
821 inventory_image = "default_acacia_sapling.png",
822 wield_image = "default_acacia_sapling.png",
824 sunlight_propagates = true,
826 on_timer = default.grow_sapling,
829 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
831 groups = {snappy = 2, dig_immediate = 3, flammable = 2,
832 attached_node = 1, sapling = 1},
833 sounds = default.node_sound_leaves_defaults(),
835 on_construct = function(pos)
836 minetest.get_node_timer(pos):start(math.random(2400,4800))
839 on_place = function(itemstack, placer, pointed_thing)
840 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
841 "default:acacia_sapling",
842 -- minp, maxp to be checked, relative to sapling pos
843 -- minp_relative.y = 1 because sapling pos has been checked
844 {x = -4, y = 1, z = -4},
845 {x = 4, y = 6, z = 4},
846 -- maximum interval of interior volume check
853 minetest.register_node("default:aspen_tree", {
854 description = "Aspen Tree",
855 tiles = {"default_aspen_tree_top.png", "default_aspen_tree_top.png",
856 "default_aspen_tree.png"},
857 paramtype2 = "facedir",
858 is_ground_content = false,
859 groups = {tree = 1, choppy = 3, oddly_breakable_by_hand = 1, flammable = 3},
860 sounds = default.node_sound_wood_defaults(),
862 on_place = minetest.rotate_node
865 minetest.register_node("default:aspen_wood", {
866 description = "Aspen Wood Planks",
867 paramtype2 = "facedir",
869 tiles = {"default_aspen_wood.png"},
870 is_ground_content = false,
871 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
872 sounds = default.node_sound_wood_defaults(),
875 minetest.register_node("default:aspen_leaves", {
876 description = "Aspen Leaves",
877 drawtype = "allfaces_optional",
878 tiles = {"default_aspen_leaves.png"},
881 is_ground_content = false,
882 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
886 {items = {"default:aspen_sapling"}, rarity = 20},
887 {items = {"default:aspen_leaves"}}
890 sounds = default.node_sound_leaves_defaults(),
892 after_place_node = default.after_place_leaves,
895 minetest.register_node("default:aspen_sapling", {
896 description = "Aspen Tree Sapling",
897 drawtype = "plantlike",
899 tiles = {"default_aspen_sapling.png"},
900 inventory_image = "default_aspen_sapling.png",
901 wield_image = "default_aspen_sapling.png",
903 sunlight_propagates = true,
905 on_timer = default.grow_sapling,
908 fixed = {-3 / 16, -0.5, -3 / 16, 3 / 16, 0.5, 3 / 16}
910 groups = {snappy = 2, dig_immediate = 3, flammable = 3,
911 attached_node = 1, sapling = 1},
912 sounds = default.node_sound_leaves_defaults(),
914 on_construct = function(pos)
915 minetest.get_node_timer(pos):start(math.random(2400,4800))
918 on_place = function(itemstack, placer, pointed_thing)
919 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
920 "default:aspen_sapling",
921 -- minp, maxp to be checked, relative to sapling pos
922 -- minp_relative.y = 1 because sapling pos has been checked
923 {x = -2, y = 1, z = -2},
924 {x = 2, y = 12, z = 2},
925 -- maximum interval of interior volume check
936 minetest.register_node("default:stone_with_coal", {
937 description = "Coal Ore",
938 tiles = {"default_stone.png^default_mineral_coal.png"},
939 groups = {cracky = 3},
940 drop = 'default:coal_lump',
941 sounds = default.node_sound_stone_defaults(),
944 minetest.register_node("default:coalblock", {
945 description = "Coal Block",
946 tiles = {"default_coal_block.png"},
947 is_ground_content = false,
948 groups = {cracky = 3},
949 sounds = default.node_sound_stone_defaults(),
953 minetest.register_node("default:stone_with_iron", {
954 description = "Iron Ore",
955 tiles = {"default_stone.png^default_mineral_iron.png"},
956 groups = {cracky = 2},
957 drop = 'default:iron_lump',
958 sounds = default.node_sound_stone_defaults(),
961 minetest.register_node("default:steelblock", {
962 description = "Steel Block",
963 tiles = {"default_steel_block.png"},
964 is_ground_content = false,
965 groups = {cracky = 1, level = 2},
966 sounds = default.node_sound_metal_defaults(),
970 minetest.register_node("default:stone_with_copper", {
971 description = "Copper Ore",
972 tiles = {"default_stone.png^default_mineral_copper.png"},
973 groups = {cracky = 2},
974 drop = 'default:copper_lump',
975 sounds = default.node_sound_stone_defaults(),
978 minetest.register_node("default:copperblock", {
979 description = "Copper Block",
980 tiles = {"default_copper_block.png"},
981 is_ground_content = false,
982 groups = {cracky = 1, level = 2},
983 sounds = default.node_sound_metal_defaults(),
986 minetest.register_node("default:bronzeblock", {
987 description = "Bronze Block",
988 tiles = {"default_bronze_block.png"},
989 is_ground_content = false,
990 groups = {cracky = 1, level = 2},
991 sounds = default.node_sound_metal_defaults(),
995 minetest.register_node("default:stone_with_mese", {
996 description = "Mese Ore",
997 tiles = {"default_stone.png^default_mineral_mese.png"},
998 groups = {cracky = 1},
999 drop = "default:mese_crystal",
1000 sounds = default.node_sound_stone_defaults(),
1003 minetest.register_node("default:mese", {
1004 description = "Mese Block",
1005 tiles = {"default_mese_block.png"},
1006 paramtype = "light",
1007 groups = {cracky = 1, level = 2},
1008 sounds = default.node_sound_stone_defaults(),
1013 minetest.register_node("default:stone_with_gold", {
1014 description = "Gold Ore",
1015 tiles = {"default_stone.png^default_mineral_gold.png"},
1016 groups = {cracky = 2},
1017 drop = "default:gold_lump",
1018 sounds = default.node_sound_stone_defaults(),
1021 minetest.register_node("default:goldblock", {
1022 description = "Gold Block",
1023 tiles = {"default_gold_block.png"},
1024 is_ground_content = false,
1025 groups = {cracky = 1},
1026 sounds = default.node_sound_metal_defaults(),
1030 minetest.register_node("default:stone_with_diamond", {
1031 description = "Diamond Ore",
1032 tiles = {"default_stone.png^default_mineral_diamond.png"},
1033 groups = {cracky = 1},
1034 drop = "default:diamond",
1035 sounds = default.node_sound_stone_defaults(),
1038 minetest.register_node("default:diamondblock", {
1039 description = "Diamond Block",
1040 tiles = {"default_diamond_block.png"},
1041 is_ground_content = false,
1042 groups = {cracky = 1, level = 3},
1043 sounds = default.node_sound_stone_defaults(),
1047 -- Plantlife (non-cubic)
1050 minetest.register_node("default:cactus", {
1051 description = "Cactus",
1052 tiles = {"default_cactus_top.png", "default_cactus_top.png",
1053 "default_cactus_side.png"},
1054 paramtype2 = "facedir",
1055 groups = {snappy = 1, choppy = 3},
1056 sounds = default.node_sound_wood_defaults(),
1057 on_place = minetest.rotate_node,
1060 minetest.register_node("default:papyrus", {
1061 description = "Papyrus",
1062 drawtype = "plantlike",
1063 tiles = {"default_papyrus.png"},
1064 inventory_image = "default_papyrus.png",
1065 wield_image = "default_papyrus.png",
1066 paramtype = "light",
1067 sunlight_propagates = true,
1071 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16},
1073 groups = {snappy = 3, flammable = 2},
1074 sounds = default.node_sound_leaves_defaults(),
1076 after_dig_node = function(pos, node, metadata, digger)
1077 default.dig_up(pos, node, digger)
1081 minetest.register_node("default:dry_shrub", {
1082 description = "Dry Shrub",
1083 drawtype = "plantlike",
1086 tiles = {"default_dry_shrub.png"},
1087 inventory_image = "default_dry_shrub.png",
1088 wield_image = "default_dry_shrub.png",
1089 paramtype = "light",
1090 sunlight_propagates = true,
1092 buildable_to = true,
1093 groups = {snappy = 3, flammable = 3, attached_node = 1},
1094 sounds = default.node_sound_leaves_defaults(),
1097 fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 4 / 16, 5 / 16},
1101 minetest.register_node("default:junglegrass", {
1102 description = "Jungle Grass",
1103 drawtype = "plantlike",
1106 tiles = {"default_junglegrass.png"},
1107 inventory_image = "default_junglegrass.png",
1108 wield_image = "default_junglegrass.png",
1109 paramtype = "light",
1110 sunlight_propagates = true,
1112 buildable_to = true,
1113 groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1, flammable = 1},
1114 sounds = default.node_sound_leaves_defaults(),
1117 fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 1.19, 7 / 16},
1122 minetest.register_node("default:grass_1", {
1123 description = "Grass",
1124 drawtype = "plantlike",
1126 tiles = {"default_grass_1.png"},
1127 -- Use texture of a taller grass stage in inventory
1128 inventory_image = "default_grass_3.png",
1129 wield_image = "default_grass_3.png",
1130 paramtype = "light",
1131 sunlight_propagates = true,
1133 buildable_to = true,
1134 groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1, flammable = 1},
1135 sounds = default.node_sound_leaves_defaults(),
1138 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -5 / 16, 6 / 16},
1141 on_place = function(itemstack, placer, pointed_thing)
1142 -- place a random grass node
1143 local stack = ItemStack("default:grass_" .. math.random(1,5))
1144 local ret = minetest.item_place(stack, placer, pointed_thing)
1145 return ItemStack("default:grass_1 " ..
1146 itemstack:get_count() - (1 - ret:get_count()))
1151 minetest.register_node("default:grass_" .. i, {
1152 description = "Grass",
1153 drawtype = "plantlike",
1155 tiles = {"default_grass_" .. i .. ".png"},
1156 inventory_image = "default_grass_" .. i .. ".png",
1157 wield_image = "default_grass_" .. i .. ".png",
1158 paramtype = "light",
1159 sunlight_propagates = true,
1161 buildable_to = true,
1162 drop = "default:grass_1",
1163 groups = {snappy = 3, flora = 1, attached_node = 1,
1164 not_in_creative_inventory = 1, grass = 1, flammable = 1},
1165 sounds = default.node_sound_leaves_defaults(),
1168 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -3 / 16, 6 / 16},
1174 minetest.register_node("default:dry_grass_1", {
1175 description = "Dry Grass",
1176 drawtype = "plantlike",
1178 tiles = {"default_dry_grass_1.png"},
1179 inventory_image = "default_dry_grass_3.png",
1180 wield_image = "default_dry_grass_3.png",
1181 paramtype = "light",
1182 sunlight_propagates = true,
1184 buildable_to = true,
1185 groups = {snappy = 3, flammable = 3, flora = 1,
1186 attached_node = 1, dry_grass = 1},
1187 sounds = default.node_sound_leaves_defaults(),
1190 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -3 / 16, 6 / 16},
1193 on_place = function(itemstack, placer, pointed_thing)
1194 -- place a random dry grass node
1195 local stack = ItemStack("default:dry_grass_" .. math.random(1, 5))
1196 local ret = minetest.item_place(stack, placer, pointed_thing)
1197 return ItemStack("default:dry_grass_1 " ..
1198 itemstack:get_count() - (1 - ret:get_count()))
1203 minetest.register_node("default:dry_grass_" .. i, {
1204 description = "Dry Grass",
1205 drawtype = "plantlike",
1207 tiles = {"default_dry_grass_" .. i .. ".png"},
1208 inventory_image = "default_dry_grass_" .. i .. ".png",
1209 wield_image = "default_dry_grass_" .. i .. ".png",
1210 paramtype = "light",
1211 sunlight_propagates = true,
1213 buildable_to = true,
1214 groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1,
1215 not_in_creative_inventory=1, dry_grass = 1},
1216 drop = "default:dry_grass_1",
1217 sounds = default.node_sound_leaves_defaults(),
1220 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -1 / 16, 6 / 16},
1226 minetest.register_node("default:bush_stem", {
1227 description = "Bush Stem",
1228 drawtype = "plantlike",
1229 visual_scale = 1.18,
1230 tiles = {"default_bush_stem.png"},
1231 inventory_image = "default_bush_stem.png",
1232 wield_image = "default_bush_stem.png",
1233 paramtype = "light",
1234 sunlight_propagates = true,
1235 groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
1236 sounds = default.node_sound_wood_defaults(),
1239 fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.54, 7 / 16},
1243 minetest.register_node("default:bush_leaves", {
1244 description = "Bush Leaves",
1245 drawtype = "allfaces_optional",
1247 tiles = {"default_leaves_simple.png"},
1248 paramtype = "light",
1249 groups = {snappy = 3, flammable = 2, leaves = 1},
1250 sounds = default.node_sound_leaves_defaults(),
1253 minetest.register_node("default:acacia_bush_stem", {
1254 description = "Acacia Bush Stem",
1255 drawtype = "plantlike",
1256 visual_scale = 1.18,
1257 tiles = {"default_acacia_bush_stem.png"},
1258 inventory_image = "default_acacia_bush_stem.png",
1259 wield_image = "default_acacia_bush_stem.png",
1260 paramtype = "light",
1261 sunlight_propagates = true,
1262 groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
1263 sounds = default.node_sound_wood_defaults(),
1266 fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.54, 7 / 16},
1270 minetest.register_node("default:acacia_bush_leaves", {
1271 description = "Acacia Bush Leaves",
1272 drawtype = "allfaces_optional",
1274 tiles = {"default_acacia_leaves_simple.png"},
1275 paramtype = "light",
1276 groups = {snappy = 3, flammable = 2, leaves = 1},
1277 sounds = default.node_sound_leaves_defaults(),
1285 minetest.register_node("default:coral_brown", {
1286 description = "Brown Coral",
1287 tiles = {"default_coral_brown.png"},
1288 groups = {cracky = 3},
1289 drop = "default:coral_skeleton",
1290 sounds = default.node_sound_stone_defaults(),
1293 minetest.register_node("default:coral_orange", {
1294 description = "Orange Coral",
1295 tiles = {"default_coral_orange.png"},
1296 groups = {cracky = 3},
1297 drop = "default:coral_skeleton",
1298 sounds = default.node_sound_stone_defaults(),
1301 minetest.register_node("default:coral_skeleton", {
1302 description = "Coral Skeleton",
1303 tiles = {"default_coral_skeleton.png"},
1304 groups = {cracky = 3},
1305 sounds = default.node_sound_stone_defaults(),
1313 minetest.register_node("default:water_source", {
1314 description = "Water Source",
1315 drawtype = "liquid",
1318 name = "default_water_source_animated.png",
1320 type = "vertical_frames",
1328 -- New-style water source material (mostly unused)
1330 name = "default_water_source_animated.png",
1332 type = "vertical_frames",
1337 backface_culling = false,
1341 paramtype = "light",
1345 buildable_to = true,
1346 is_ground_content = false,
1349 liquidtype = "source",
1350 liquid_alternative_flowing = "default:water_flowing",
1351 liquid_alternative_source = "default:water_source",
1352 liquid_viscosity = 1,
1353 post_effect_color = {a = 103, r = 30, g = 60, b = 90},
1354 groups = {water = 3, liquid = 3, puts_out_fire = 1},
1357 minetest.register_node("default:water_flowing", {
1358 description = "Flowing Water",
1359 drawtype = "flowingliquid",
1360 tiles = {"default_water.png"},
1363 name = "default_water_flowing_animated.png",
1364 backface_culling = false,
1366 type = "vertical_frames",
1373 name = "default_water_flowing_animated.png",
1374 backface_culling = true,
1376 type = "vertical_frames",
1384 paramtype = "light",
1385 paramtype2 = "flowingliquid",
1389 buildable_to = true,
1390 is_ground_content = false,
1393 liquidtype = "flowing",
1394 liquid_alternative_flowing = "default:water_flowing",
1395 liquid_alternative_source = "default:water_source",
1396 liquid_viscosity = 1,
1397 post_effect_color = {a = 103, r = 30, g = 60, b = 90},
1398 groups = {water = 3, liquid = 3, puts_out_fire = 1,
1399 not_in_creative_inventory = 1},
1403 minetest.register_node("default:river_water_source", {
1404 description = "River Water Source",
1405 drawtype = "liquid",
1408 name = "default_river_water_source_animated.png",
1410 type = "vertical_frames",
1419 name = "default_river_water_source_animated.png",
1421 type = "vertical_frames",
1426 backface_culling = false,
1430 paramtype = "light",
1434 buildable_to = true,
1435 is_ground_content = false,
1438 liquidtype = "source",
1439 liquid_alternative_flowing = "default:river_water_flowing",
1440 liquid_alternative_source = "default:river_water_source",
1441 liquid_viscosity = 1,
1442 liquid_renewable = false,
1444 post_effect_color = {a = 103, r = 30, g = 76, b = 90},
1445 groups = {water = 3, liquid = 3, puts_out_fire = 1},
1448 minetest.register_node("default:river_water_flowing", {
1449 description = "Flowing River Water",
1450 drawtype = "flowingliquid",
1451 tiles = {"default_river_water.png"},
1454 name = "default_river_water_flowing_animated.png",
1455 backface_culling = false,
1457 type = "vertical_frames",
1464 name = "default_river_water_flowing_animated.png",
1465 backface_culling = true,
1467 type = "vertical_frames",
1475 paramtype = "light",
1476 paramtype2 = "flowingliquid",
1480 buildable_to = true,
1481 is_ground_content = false,
1484 liquidtype = "flowing",
1485 liquid_alternative_flowing = "default:river_water_flowing",
1486 liquid_alternative_source = "default:river_water_source",
1487 liquid_viscosity = 1,
1488 liquid_renewable = false,
1490 post_effect_color = {a = 103, r = 30, g = 76, b = 90},
1491 groups = {water = 3, liquid = 3, puts_out_fire = 1,
1492 not_in_creative_inventory = 1},
1496 minetest.register_node("default:lava_source", {
1497 description = "Lava Source",
1498 drawtype = "liquid",
1501 name = "default_lava_source_animated.png",
1503 type = "vertical_frames",
1511 -- New-style lava source material (mostly unused)
1513 name = "default_lava_source_animated.png",
1515 type = "vertical_frames",
1520 backface_culling = false,
1523 paramtype = "light",
1524 light_source = default.LIGHT_MAX - 1,
1528 buildable_to = true,
1529 is_ground_content = false,
1532 liquidtype = "source",
1533 liquid_alternative_flowing = "default:lava_flowing",
1534 liquid_alternative_source = "default:lava_source",
1535 liquid_viscosity = 7,
1536 liquid_renewable = false,
1537 damage_per_second = 4 * 2,
1538 post_effect_color = {a = 191, r = 255, g = 64, b = 0},
1539 groups = {lava = 3, liquid = 2, igniter = 1},
1542 minetest.register_node("default:lava_flowing", {
1543 description = "Flowing Lava",
1544 drawtype = "flowingliquid",
1545 tiles = {"default_lava.png"},
1548 name = "default_lava_flowing_animated.png",
1549 backface_culling = false,
1551 type = "vertical_frames",
1558 name = "default_lava_flowing_animated.png",
1559 backface_culling = true,
1561 type = "vertical_frames",
1568 paramtype = "light",
1569 paramtype2 = "flowingliquid",
1570 light_source = default.LIGHT_MAX - 1,
1574 buildable_to = true,
1575 is_ground_content = false,
1578 liquidtype = "flowing",
1579 liquid_alternative_flowing = "default:lava_flowing",
1580 liquid_alternative_source = "default:lava_source",
1581 liquid_viscosity = 7,
1582 liquid_renewable = false,
1583 damage_per_second = 4 * 2,
1584 post_effect_color = {a = 191, r = 255, g = 64, b = 0},
1585 groups = {lava = 3, liquid = 2, igniter = 1,
1586 not_in_creative_inventory = 1},
1590 -- Tools / "Advanced" crafting / Non-"natural"
1593 minetest.register_node("default:torch", {
1594 description = "Torch",
1595 drawtype = "torchlike",
1598 name = "default_torch_on_floor_animated.png",
1600 type = "vertical_frames",
1607 name="default_torch_on_ceiling_animated.png",
1609 type = "vertical_frames",
1616 name="default_torch_animated.png",
1618 type = "vertical_frames",
1625 inventory_image = "default_torch_on_floor.png",
1626 wield_image = "default_torch_on_floor.png",
1627 paramtype = "light",
1628 paramtype2 = "wallmounted",
1629 sunlight_propagates = true,
1630 is_ground_content = false,
1632 light_source = default.LIGHT_MAX - 1,
1634 type = "wallmounted",
1635 wall_top = {-0.1, 0.5 - 0.6, -0.1, 0.1, 0.5, 0.1},
1636 wall_bottom = {-0.1, -0.5, -0.1, 0.1, -0.5 + 0.6, 0.1},
1637 wall_side = {-0.5, -0.3, -0.1, -0.5 + 0.3, 0.3, 0.1},
1639 groups = {choppy = 2, dig_immediate = 3, flammable = 1, attached_node = 1},
1640 legacy_wallmounted = true,
1641 sounds = default.node_sound_defaults(),
1645 local chest_formspec =
1648 default.gui_bg_img ..
1649 default.gui_slots ..
1650 "list[current_name;main;0,0.3;8,4;]" ..
1651 "list[current_player;main;0,4.85;8,1;]" ..
1652 "list[current_player;main;0,6.08;8,3;8]" ..
1653 "listring[current_name;main]" ..
1654 "listring[current_player;main]" ..
1655 default.get_hotbar_bg(0,4.85)
1657 local function get_locked_chest_formspec(pos)
1658 local spos = pos.x .. "," .. pos.y .. "," .. pos.z
1662 default.gui_bg_img ..
1663 default.gui_slots ..
1664 "list[nodemeta:" .. spos .. ";main;0,0.3;8,4;]" ..
1665 "list[current_player;main;0,4.85;8,1;]" ..
1666 "list[current_player;main;0,6.08;8,3;8]" ..
1667 "listring[nodemeta:" .. spos .. ";main]" ..
1668 "listring[current_player;main]" ..
1669 default.get_hotbar_bg(0,4.85)
1673 local function has_locked_chest_privilege(meta, player)
1676 if minetest.check_player_privs(player, "protection_bypass") then
1679 name = player:get_player_name()
1681 if name ~= meta:get_string("owner") then
1687 minetest.register_node("default:chest", {
1688 description = "Chest",
1689 tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
1690 "default_chest_side.png", "default_chest_side.png", "default_chest_front.png"},
1691 paramtype2 = "facedir",
1692 groups = {choppy = 2, oddly_breakable_by_hand = 2},
1693 legacy_facedir_simple = true,
1694 is_ground_content = false,
1695 sounds = default.node_sound_wood_defaults(),
1697 on_construct = function(pos)
1698 local meta = minetest.get_meta(pos)
1699 meta:set_string("formspec", chest_formspec)
1700 local inv = meta:get_inventory()
1701 inv:set_size("main", 8*4)
1703 can_dig = function(pos,player)
1704 local meta = minetest.get_meta(pos);
1705 local inv = meta:get_inventory()
1706 return inv:is_empty("main")
1708 on_metadata_inventory_move = function(pos, from_list, from_index,
1709 to_list, to_index, count, player)
1710 minetest.log("action", player:get_player_name() ..
1711 " moves stuff in chest at " .. minetest.pos_to_string(pos))
1713 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1714 minetest.log("action", player:get_player_name() ..
1715 " moves " .. stack:get_name() ..
1716 " to chest at " .. minetest.pos_to_string(pos))
1718 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1719 minetest.log("action", player:get_player_name() ..
1720 " takes " .. stack:get_name() ..
1721 " from chest at " .. minetest.pos_to_string(pos))
1723 on_blast = function(pos)
1725 default.get_inventory_drops(pos, "main", drops)
1726 drops[#drops+1] = "default:chest"
1727 minetest.remove_node(pos)
1732 minetest.register_node("default:chest_locked", {
1733 description = "Locked Chest",
1734 tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
1735 "default_chest_side.png", "default_chest_side.png", "default_chest_lock.png"},
1736 paramtype2 = "facedir",
1737 groups = {choppy = 2, oddly_breakable_by_hand = 2},
1738 legacy_facedir_simple = true,
1739 is_ground_content = false,
1740 sounds = default.node_sound_wood_defaults(),
1742 after_place_node = function(pos, placer)
1743 local meta = minetest.get_meta(pos)
1744 meta:set_string("owner", placer:get_player_name() or "")
1745 meta:set_string("infotext", "Locked Chest (owned by " ..
1746 meta:get_string("owner") .. ")")
1748 on_construct = function(pos)
1749 local meta = minetest.get_meta(pos)
1750 meta:set_string("owner", "")
1751 local inv = meta:get_inventory()
1752 inv:set_size("main", 8 * 4)
1754 can_dig = function(pos,player)
1755 local meta = minetest.get_meta(pos);
1756 local inv = meta:get_inventory()
1757 return inv:is_empty("main") and has_locked_chest_privilege(meta, player)
1759 allow_metadata_inventory_move = function(pos, from_list, from_index,
1760 to_list, to_index, count, player)
1761 local meta = minetest.get_meta(pos)
1762 if not has_locked_chest_privilege(meta, player) then
1767 allow_metadata_inventory_put = function(pos, listname, index, stack, player)
1768 local meta = minetest.get_meta(pos)
1769 if not has_locked_chest_privilege(meta, player) then
1772 return stack:get_count()
1774 allow_metadata_inventory_take = function(pos, listname, index, stack, player)
1775 local meta = minetest.get_meta(pos)
1776 if not has_locked_chest_privilege(meta, player) then
1779 return stack:get_count()
1781 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1782 minetest.log("action", player:get_player_name() ..
1783 " moves " .. stack:get_name() ..
1784 " to locked chest at " .. minetest.pos_to_string(pos))
1786 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1787 minetest.log("action", player:get_player_name() ..
1788 " takes " .. stack:get_name() ..
1789 " from locked chest at " .. minetest.pos_to_string(pos))
1791 on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
1792 local meta = minetest.get_meta(pos)
1793 if has_locked_chest_privilege(meta, clicker) then
1794 minetest.show_formspec(
1795 clicker:get_player_name(),
1796 "default:chest_locked",
1797 get_locked_chest_formspec(pos)
1802 on_blast = function() end,
1806 local bookshelf_formspec =
1809 default.gui_bg_img ..
1810 default.gui_slots ..
1811 "list[context;books;0,0.3;8,2;]" ..
1812 "list[current_player;main;0,2.85;8,1;]" ..
1813 "list[current_player;main;0,4.08;8,3;8]" ..
1814 "listring[context;books]" ..
1815 "listring[current_player;main]" ..
1816 default.get_hotbar_bg(0,2.85)
1818 -- Inventory slots overlay
1819 local bx, by = 0, 0.3
1825 bookshelf_formspec = bookshelf_formspec ..
1826 "image[" .. bx .. "," .. by .. ";1,1;default_bookshelf_slot.png]"
1830 minetest.register_node("default:bookshelf", {
1831 description = "Bookshelf",
1832 tiles = {"default_wood.png", "default_wood.png", "default_wood.png",
1833 "default_wood.png", "default_bookshelf.png", "default_bookshelf.png"},
1834 paramtype2 = "facedir",
1835 is_ground_content = false,
1836 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
1837 sounds = default.node_sound_wood_defaults(),
1839 on_construct = function(pos)
1840 local meta = minetest.get_meta(pos)
1841 meta:set_string("formspec", bookshelf_formspec)
1842 local inv = meta:get_inventory()
1843 inv:set_size("books", 8 * 2)
1845 can_dig = function(pos,player)
1846 local inv = minetest.get_meta(pos):get_inventory()
1847 return inv:is_empty("books")
1849 allow_metadata_inventory_put = function(pos, listname, index, stack)
1850 if minetest.get_item_group(stack:get_name(), "book") ~= 0 then
1851 return stack:get_count()
1855 on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
1856 minetest.log("action", player:get_player_name() ..
1857 " moves stuff in bookshelf at " .. minetest.pos_to_string(pos))
1859 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1860 minetest.log("action", player:get_player_name() ..
1861 " moves stuff to bookshelf at " .. minetest.pos_to_string(pos))
1863 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1864 minetest.log("action", player:get_player_name() ..
1865 " takes stuff from bookshelf at " .. minetest.pos_to_string(pos))
1867 on_blast = function(pos)
1869 default.get_inventory_drops(pos, "books", drops)
1870 drops[#drops+1] = "default:bookshelf"
1871 minetest.remove_node(pos)
1876 local function register_sign(material, desc, def)
1877 minetest.register_node("default:sign_wall_" .. material, {
1878 description = desc .. " Sign",
1879 drawtype = "nodebox",
1880 tiles = {"default_sign_wall_" .. material .. ".png"},
1881 inventory_image = "default_sign_" .. material .. ".png",
1882 wield_image = "default_sign_" .. material .. ".png",
1883 paramtype = "light",
1884 paramtype2 = "wallmounted",
1885 sunlight_propagates = true,
1886 is_ground_content = false,
1889 type = "wallmounted",
1890 wall_top = {-0.4375, 0.4375, -0.3125, 0.4375, 0.5, 0.3125},
1891 wall_bottom = {-0.4375, -0.5, -0.3125, 0.4375, -0.4375, 0.3125},
1892 wall_side = {-0.5, -0.3125, -0.4375, -0.4375, 0.3125, 0.4375},
1894 groups = def.groups,
1895 legacy_wallmounted = true,
1896 sounds = def.sounds,
1898 on_construct = function(pos)
1899 --local n = minetest.get_node(pos)
1900 local meta = minetest.get_meta(pos)
1901 meta:set_string("formspec", "field[text;;${text}]")
1903 on_receive_fields = function(pos, formname, fields, sender)
1904 --print("Sign at "..minetest.pos_to_string(pos).." got "..dump(fields))
1905 local player_name = sender:get_player_name()
1906 if minetest.is_protected(pos, player_name) then
1907 minetest.record_protection_violation(pos, player_name)
1910 local meta = minetest.get_meta(pos)
1911 if not fields.text then return end
1912 minetest.log("action", (player_name or "") .. " wrote \"" ..
1913 fields.text .. "\" to sign at " .. minetest.pos_to_string(pos))
1914 meta:set_string("text", fields.text)
1915 meta:set_string("infotext", '"' .. fields.text .. '"')
1920 register_sign("wood", "Wooden", {
1921 sounds = default.node_sound_wood_defaults(),
1922 groups = {choppy = 2, attached_node = 1, flammable = 2, oddly_breakable_by_hand = 3}
1925 register_sign("steel", "Steel", {
1926 sounds = default.node_sound_metal_defaults(),
1927 groups = {cracky = 2, attached_node = 1}
1930 minetest.register_node("default:ladder_wood", {
1931 description = "Wooden Ladder",
1932 drawtype = "signlike",
1933 tiles = {"default_ladder_wood.png"},
1934 inventory_image = "default_ladder_wood.png",
1935 wield_image = "default_ladder_wood.png",
1936 paramtype = "light",
1937 paramtype2 = "wallmounted",
1938 sunlight_propagates = true,
1941 is_ground_content = false,
1943 type = "wallmounted",
1944 --wall_top = = <default>
1945 --wall_bottom = = <default>
1946 --wall_side = = <default>
1948 groups = {choppy = 2, oddly_breakable_by_hand = 3, flammable = 2},
1949 legacy_wallmounted = true,
1950 sounds = default.node_sound_wood_defaults(),
1953 minetest.register_node("default:ladder_steel", {
1954 description = "Steel Ladder",
1955 drawtype = "signlike",
1956 tiles = {"default_ladder_steel.png"},
1957 inventory_image = "default_ladder_steel.png",
1958 wield_image = "default_ladder_steel.png",
1959 paramtype = "light",
1960 paramtype2 = "wallmounted",
1961 sunlight_propagates = true,
1964 is_ground_content = false,
1966 type = "wallmounted",
1967 --wall_top = = <default>
1968 --wall_bottom = = <default>
1969 --wall_side = = <default>
1971 groups = {cracky = 2},
1972 sounds = default.node_sound_metal_defaults(),
1975 default.register_fence("default:fence_wood", {
1976 description = "Wooden Fence",
1977 texture = "default_fence_wood.png",
1978 inventory_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1979 wield_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1980 material = "default:wood",
1981 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
1982 sounds = default.node_sound_wood_defaults()
1985 default.register_fence("default:fence_acacia_wood", {
1986 description = "Acacia Fence",
1987 texture = "default_fence_acacia_wood.png",
1988 inventory_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1989 wield_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1990 material = "default:acacia_wood",
1991 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
1992 sounds = default.node_sound_wood_defaults()
1995 default.register_fence("default:fence_junglewood", {
1996 description = "Junglewood Fence",
1997 texture = "default_fence_junglewood.png",
1998 inventory_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126",
1999 wield_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126",
2000 material = "default:junglewood",
2001 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
2002 sounds = default.node_sound_wood_defaults()
2005 default.register_fence("default:fence_pine_wood", {
2006 description = "Pine Fence",
2007 texture = "default_fence_pine_wood.png",
2008 inventory_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2009 wield_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2010 material = "default:pine_wood",
2011 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
2012 sounds = default.node_sound_wood_defaults()
2015 default.register_fence("default:fence_aspen_wood", {
2016 description = "Aspen Fence",
2017 texture = "default_fence_aspen_wood.png",
2018 inventory_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2019 wield_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2020 material = "default:aspen_wood",
2021 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
2022 sounds = default.node_sound_wood_defaults()
2025 minetest.register_node("default:glass", {
2026 description = "Glass",
2027 drawtype = "glasslike_framed_optional",
2028 tiles = {"default_glass.png", "default_glass_detail.png"},
2029 paramtype = "light",
2030 sunlight_propagates = true,
2031 is_ground_content = false,
2032 groups = {cracky = 3, oddly_breakable_by_hand = 3},
2033 sounds = default.node_sound_glass_defaults(),
2036 minetest.register_node("default:obsidian_glass", {
2037 description = "Obsidian Glass",
2038 drawtype = "glasslike_framed_optional",
2039 tiles = {"default_obsidian_glass.png", "default_obsidian_glass_detail.png"},
2040 paramtype = "light",
2041 is_ground_content = false,
2042 sunlight_propagates = true,
2043 sounds = default.node_sound_glass_defaults(),
2044 groups = {cracky = 3},
2048 minetest.register_node("default:rail", {
2049 description = "Rail",
2050 drawtype = "raillike",
2051 tiles = {"default_rail.png", "default_rail_curved.png",
2052 "default_rail_t_junction.png", "default_rail_crossing.png"},
2053 inventory_image = "default_rail.png",
2054 wield_image = "default_rail.png",
2055 paramtype = "light",
2056 sunlight_propagates = true,
2058 is_ground_content = false,
2061 -- but how to specify the dimensions for curved and sideways rails?
2062 fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
2064 groups = {dig_immediate = 2, attached_node = 1,
2065 connect_to_raillike = minetest.raillike_group("rail")},
2069 minetest.register_node("default:brick", {
2070 description = "Brick Block",
2071 paramtype2 = "facedir",
2073 tiles = {"default_brick.png"},
2074 is_ground_content = false,
2075 groups = {cracky = 3},
2076 sounds = default.node_sound_stone_defaults(),
2080 minetest.register_node("default:meselamp", {
2081 description = "Mese Lamp",
2082 drawtype = "glasslike",
2083 tiles = {"default_meselamp.png"},
2084 paramtype = "light",
2085 sunlight_propagates = true,
2086 is_ground_content = false,
2087 groups = {cracky = 3, oddly_breakable_by_hand = 3},
2088 sounds = default.node_sound_glass_defaults(),
2089 light_source = default.LIGHT_MAX,
2096 minetest.register_node("default:cloud", {
2097 description = "Cloud",
2098 tiles = {"default_cloud.png"},
2099 is_ground_content = false,
2100 sounds = default.node_sound_defaults(),
2101 groups = {not_in_creative_inventory = 1},