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",
446 drawtype = "nodebox",
450 {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
453 groups = {crumbly = 3, falling_node = 1, puts_out_fire = 1},
454 sounds = default.node_sound_dirt_defaults({
455 footstep = {name = "default_snow_footstep", gain = 0.15},
456 dug = {name = "default_snow_footstep", gain = 0.2},
457 dig = {name = "default_snow_footstep", gain = 0.2}
460 on_construct = function(pos)
462 if minetest.get_node(pos).name == "default:dirt_with_grass" then
463 minetest.set_node(pos, {name = "default:dirt_with_snow"})
468 minetest.register_node("default:snowblock", {
469 description = "Snow Block",
470 tiles = {"default_snow.png"},
471 groups = {crumbly = 3, puts_out_fire = 1},
472 sounds = default.node_sound_dirt_defaults({
473 footstep = {name = "default_snow_footstep", gain = 0.15},
474 dug = {name = "default_snow_footstep", gain = 0.2},
475 dig = {name = "default_snow_footstep", gain = 0.2}
479 minetest.register_node("default:ice", {
481 tiles = {"default_ice.png"},
482 is_ground_content = false,
484 groups = {cracky = 3, puts_out_fire = 1},
485 sounds = default.node_sound_glass_defaults(),
492 minetest.register_node("default:tree", {
493 description = "Tree",
494 tiles = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"},
495 paramtype2 = "facedir",
496 is_ground_content = false,
497 groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
498 sounds = default.node_sound_wood_defaults(),
500 on_place = minetest.rotate_node
503 minetest.register_node("default:wood", {
504 description = "Wooden Planks",
505 paramtype2 = "facedir",
507 tiles = {"default_wood.png"},
508 is_ground_content = false,
509 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
510 sounds = default.node_sound_wood_defaults(),
513 minetest.register_node("default:sapling", {
514 description = "Sapling",
515 drawtype = "plantlike",
517 tiles = {"default_sapling.png"},
518 inventory_image = "default_sapling.png",
519 wield_image = "default_sapling.png",
521 sunlight_propagates = true,
523 on_timer = default.grow_sapling,
526 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
528 groups = {snappy = 2, dig_immediate = 3, flammable = 2,
529 attached_node = 1, sapling = 1},
530 sounds = default.node_sound_leaves_defaults(),
532 on_construct = function(pos)
533 minetest.get_node_timer(pos):start(math.random(2400,4800))
536 on_place = function(itemstack, placer, pointed_thing)
537 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
539 -- minp, maxp to be checked, relative to sapling pos
540 -- minp_relative.y = 1 because sapling pos has been checked
541 {x = -2, y = 1, z = -2},
542 {x = 2, y = 6, z = 2},
543 -- maximum interval of interior volume check
550 minetest.register_node("default:leaves", {
551 description = "Leaves",
552 drawtype = "allfaces_optional",
554 tiles = {"default_leaves.png"},
555 special_tiles = {"default_leaves_simple.png"},
557 is_ground_content = false,
558 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
563 -- player will get sapling with 1/20 chance
564 items = {'default:sapling'},
568 -- player will get leaves only if he get no saplings,
569 -- this is because max_items is 1
570 items = {'default:leaves'},
574 sounds = default.node_sound_leaves_defaults(),
576 after_place_node = default.after_place_leaves,
579 minetest.register_node("default:apple", {
580 description = "Apple",
581 drawtype = "plantlike",
583 tiles = {"default_apple.png"},
584 inventory_image = "default_apple.png",
586 sunlight_propagates = true,
588 is_ground_content = false,
591 fixed = {-3 / 16, -7 / 16, -3 / 16, 3 / 16, 4 / 16, 3 / 16}
593 groups = {fleshy = 3, dig_immediate = 3, flammable = 2,
594 leafdecay = 3, leafdecay_drop = 1},
595 on_use = minetest.item_eat(2),
596 sounds = default.node_sound_leaves_defaults(),
598 after_place_node = function(pos, placer, itemstack)
599 if placer:is_player() then
600 minetest.set_node(pos, {name = "default:apple", param2 = 1})
606 minetest.register_node("default:jungletree", {
607 description = "Jungle Tree",
608 tiles = {"default_jungletree_top.png", "default_jungletree_top.png",
609 "default_jungletree.png"},
610 paramtype2 = "facedir",
611 is_ground_content = false,
612 groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
613 sounds = default.node_sound_wood_defaults(),
615 on_place = minetest.rotate_node
618 minetest.register_node("default:junglewood", {
619 description = "Junglewood Planks",
620 paramtype2 = "facedir",
622 tiles = {"default_junglewood.png"},
623 is_ground_content = false,
624 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
625 sounds = default.node_sound_wood_defaults(),
628 minetest.register_node("default:jungleleaves", {
629 description = "Jungle Leaves",
630 drawtype = "allfaces_optional",
632 tiles = {"default_jungleleaves.png"},
633 special_tiles = {"default_jungleleaves_simple.png"},
635 is_ground_content = false,
636 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
640 {items = {'default:junglesapling'}, rarity = 20},
641 {items = {'default:jungleleaves'}}
644 sounds = default.node_sound_leaves_defaults(),
646 after_place_node = default.after_place_leaves,
649 minetest.register_node("default:junglesapling", {
650 description = "Jungle Sapling",
651 drawtype = "plantlike",
653 tiles = {"default_junglesapling.png"},
654 inventory_image = "default_junglesapling.png",
655 wield_image = "default_junglesapling.png",
657 sunlight_propagates = true,
659 on_timer = default.grow_sapling,
662 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
664 groups = {snappy = 2, dig_immediate = 3, flammable = 2,
665 attached_node = 1, sapling = 1},
666 sounds = default.node_sound_leaves_defaults(),
668 on_construct = function(pos)
669 minetest.get_node_timer(pos):start(math.random(2400,4800))
672 on_place = function(itemstack, placer, pointed_thing)
673 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
674 "default:junglesapling",
675 -- minp, maxp to be checked, relative to sapling pos
676 -- minp_relative.y = 1 because sapling pos has been checked
677 {x = -2, y = 1, z = -2},
678 {x = 2, y = 15, z = 2},
679 -- maximum interval of interior volume check
687 minetest.register_node("default:pine_tree", {
688 description = "Pine Tree",
689 tiles = {"default_pine_tree_top.png", "default_pine_tree_top.png",
690 "default_pine_tree.png"},
691 paramtype2 = "facedir",
692 is_ground_content = false,
693 groups = {tree = 1, choppy = 3, oddly_breakable_by_hand = 1, flammable = 3},
694 sounds = default.node_sound_wood_defaults(),
696 on_place = minetest.rotate_node
699 minetest.register_node("default:pine_wood", {
700 description = "Pine Wood Planks",
701 paramtype2 = "facedir",
703 tiles = {"default_pine_wood.png"},
704 is_ground_content = false,
705 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
706 sounds = default.node_sound_wood_defaults(),
709 minetest.register_node("default:pine_needles",{
710 description = "Pine Needles",
711 drawtype = "allfaces_optional",
712 tiles = {"default_pine_needles.png"},
715 is_ground_content = false,
716 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
720 {items = {"default:pine_sapling"}, rarity = 20},
721 {items = {"default:pine_needles"}}
724 sounds = default.node_sound_leaves_defaults(),
726 after_place_node = default.after_place_leaves,
729 minetest.register_node("default:pine_sapling", {
730 description = "Pine Sapling",
731 drawtype = "plantlike",
733 tiles = {"default_pine_sapling.png"},
734 inventory_image = "default_pine_sapling.png",
735 wield_image = "default_pine_sapling.png",
737 sunlight_propagates = true,
739 on_timer = default.grow_sapling,
742 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
744 groups = {snappy = 2, dig_immediate = 3, flammable = 3,
745 attached_node = 1, sapling = 1},
746 sounds = default.node_sound_leaves_defaults(),
748 on_construct = function(pos)
749 minetest.get_node_timer(pos):start(math.random(2400,4800))
752 on_place = function(itemstack, placer, pointed_thing)
753 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
754 "default:pine_sapling",
755 -- minp, maxp to be checked, relative to sapling pos
756 -- minp_relative.y = 1 because sapling pos has been checked
757 {x = -2, y = 1, z = -2},
758 {x = 2, y = 12, z = 2},
759 -- maximum interval of interior volume check
767 minetest.register_node("default:acacia_tree", {
768 description = "Acacia Tree",
769 tiles = {"default_acacia_tree_top.png", "default_acacia_tree_top.png",
770 "default_acacia_tree.png"},
771 paramtype2 = "facedir",
772 is_ground_content = false,
773 groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
774 sounds = default.node_sound_wood_defaults(),
776 on_place = minetest.rotate_node
779 minetest.register_node("default:acacia_wood", {
780 description = "Acacia Wood Planks",
781 paramtype2 = "facedir",
783 tiles = {"default_acacia_wood.png"},
784 is_ground_content = false,
785 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
786 sounds = default.node_sound_wood_defaults(),
789 minetest.register_node("default:acacia_leaves", {
790 description = "Acacia Leaves",
791 drawtype = "allfaces_optional",
792 tiles = {"default_acacia_leaves.png"},
793 special_tiles = {"default_acacia_leaves_simple.png"},
796 is_ground_content = false,
797 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
801 {items = {"default:acacia_sapling"}, rarity = 20},
802 {items = {"default:acacia_leaves"}}
805 sounds = default.node_sound_leaves_defaults(),
807 after_place_node = default.after_place_leaves,
810 minetest.register_node("default:acacia_sapling", {
811 description = "Acacia Tree Sapling",
812 drawtype = "plantlike",
814 tiles = {"default_acacia_sapling.png"},
815 inventory_image = "default_acacia_sapling.png",
816 wield_image = "default_acacia_sapling.png",
818 sunlight_propagates = true,
820 on_timer = default.grow_sapling,
823 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
825 groups = {snappy = 2, dig_immediate = 3, flammable = 2,
826 attached_node = 1, sapling = 1},
827 sounds = default.node_sound_leaves_defaults(),
829 on_construct = function(pos)
830 minetest.get_node_timer(pos):start(math.random(2400,4800))
833 on_place = function(itemstack, placer, pointed_thing)
834 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
835 "default:acacia_sapling",
836 -- minp, maxp to be checked, relative to sapling pos
837 -- minp_relative.y = 1 because sapling pos has been checked
838 {x = -4, y = 1, z = -4},
839 {x = 4, y = 6, z = 4},
840 -- maximum interval of interior volume check
847 minetest.register_node("default:aspen_tree", {
848 description = "Aspen Tree",
849 tiles = {"default_aspen_tree_top.png", "default_aspen_tree_top.png",
850 "default_aspen_tree.png"},
851 paramtype2 = "facedir",
852 is_ground_content = false,
853 groups = {tree = 1, choppy = 3, oddly_breakable_by_hand = 1, flammable = 3},
854 sounds = default.node_sound_wood_defaults(),
856 on_place = minetest.rotate_node
859 minetest.register_node("default:aspen_wood", {
860 description = "Aspen Wood Planks",
861 paramtype2 = "facedir",
863 tiles = {"default_aspen_wood.png"},
864 is_ground_content = false,
865 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
866 sounds = default.node_sound_wood_defaults(),
869 minetest.register_node("default:aspen_leaves", {
870 description = "Aspen Leaves",
871 drawtype = "allfaces_optional",
872 tiles = {"default_aspen_leaves.png"},
875 is_ground_content = false,
876 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
880 {items = {"default:aspen_sapling"}, rarity = 20},
881 {items = {"default:aspen_leaves"}}
884 sounds = default.node_sound_leaves_defaults(),
886 after_place_node = default.after_place_leaves,
889 minetest.register_node("default:aspen_sapling", {
890 description = "Aspen Tree Sapling",
891 drawtype = "plantlike",
893 tiles = {"default_aspen_sapling.png"},
894 inventory_image = "default_aspen_sapling.png",
895 wield_image = "default_aspen_sapling.png",
897 sunlight_propagates = true,
899 on_timer = default.grow_sapling,
902 fixed = {-3 / 16, -0.5, -3 / 16, 3 / 16, 0.5, 3 / 16}
904 groups = {snappy = 2, dig_immediate = 3, flammable = 3,
905 attached_node = 1, sapling = 1},
906 sounds = default.node_sound_leaves_defaults(),
908 on_construct = function(pos)
909 minetest.get_node_timer(pos):start(math.random(2400,4800))
912 on_place = function(itemstack, placer, pointed_thing)
913 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
914 "default:aspen_sapling",
915 -- minp, maxp to be checked, relative to sapling pos
916 -- minp_relative.y = 1 because sapling pos has been checked
917 {x = -2, y = 1, z = -2},
918 {x = 2, y = 12, z = 2},
919 -- maximum interval of interior volume check
930 minetest.register_node("default:stone_with_coal", {
931 description = "Coal Ore",
932 tiles = {"default_stone.png^default_mineral_coal.png"},
933 groups = {cracky = 3},
934 drop = 'default:coal_lump',
935 sounds = default.node_sound_stone_defaults(),
938 minetest.register_node("default:coalblock", {
939 description = "Coal Block",
940 tiles = {"default_coal_block.png"},
941 is_ground_content = false,
942 groups = {cracky = 3},
943 sounds = default.node_sound_stone_defaults(),
947 minetest.register_node("default:stone_with_iron", {
948 description = "Iron Ore",
949 tiles = {"default_stone.png^default_mineral_iron.png"},
950 groups = {cracky = 2},
951 drop = 'default:iron_lump',
952 sounds = default.node_sound_stone_defaults(),
955 minetest.register_node("default:steelblock", {
956 description = "Steel Block",
957 tiles = {"default_steel_block.png"},
958 is_ground_content = false,
959 groups = {cracky = 1, level = 2},
960 sounds = default.node_sound_metal_defaults(),
964 minetest.register_node("default:stone_with_copper", {
965 description = "Copper Ore",
966 tiles = {"default_stone.png^default_mineral_copper.png"},
967 groups = {cracky = 2},
968 drop = 'default:copper_lump',
969 sounds = default.node_sound_stone_defaults(),
972 minetest.register_node("default:copperblock", {
973 description = "Copper Block",
974 tiles = {"default_copper_block.png"},
975 is_ground_content = false,
976 groups = {cracky = 1, level = 2},
977 sounds = default.node_sound_metal_defaults(),
980 minetest.register_node("default:bronzeblock", {
981 description = "Bronze Block",
982 tiles = {"default_bronze_block.png"},
983 is_ground_content = false,
984 groups = {cracky = 1, level = 2},
985 sounds = default.node_sound_metal_defaults(),
989 minetest.register_node("default:stone_with_mese", {
990 description = "Mese Ore",
991 tiles = {"default_stone.png^default_mineral_mese.png"},
992 groups = {cracky = 1},
993 drop = "default:mese_crystal",
994 sounds = default.node_sound_stone_defaults(),
997 minetest.register_node("default:mese", {
998 description = "Mese Block",
999 tiles = {"default_mese_block.png"},
1000 paramtype = "light",
1001 groups = {cracky = 1, level = 2},
1002 sounds = default.node_sound_stone_defaults(),
1007 minetest.register_node("default:stone_with_gold", {
1008 description = "Gold Ore",
1009 tiles = {"default_stone.png^default_mineral_gold.png"},
1010 groups = {cracky = 2},
1011 drop = "default:gold_lump",
1012 sounds = default.node_sound_stone_defaults(),
1015 minetest.register_node("default:goldblock", {
1016 description = "Gold Block",
1017 tiles = {"default_gold_block.png"},
1018 is_ground_content = false,
1019 groups = {cracky = 1},
1020 sounds = default.node_sound_metal_defaults(),
1024 minetest.register_node("default:stone_with_diamond", {
1025 description = "Diamond Ore",
1026 tiles = {"default_stone.png^default_mineral_diamond.png"},
1027 groups = {cracky = 1},
1028 drop = "default:diamond",
1029 sounds = default.node_sound_stone_defaults(),
1032 minetest.register_node("default:diamondblock", {
1033 description = "Diamond Block",
1034 tiles = {"default_diamond_block.png"},
1035 is_ground_content = false,
1036 groups = {cracky = 1, level = 3},
1037 sounds = default.node_sound_stone_defaults(),
1041 -- Plantlife (non-cubic)
1044 minetest.register_node("default:cactus", {
1045 description = "Cactus",
1046 tiles = {"default_cactus_top.png", "default_cactus_top.png",
1047 "default_cactus_side.png"},
1048 paramtype2 = "facedir",
1049 groups = {snappy = 1, choppy = 3},
1050 sounds = default.node_sound_wood_defaults(),
1051 on_place = minetest.rotate_node,
1054 minetest.register_node("default:papyrus", {
1055 description = "Papyrus",
1056 drawtype = "plantlike",
1057 tiles = {"default_papyrus.png"},
1058 inventory_image = "default_papyrus.png",
1059 wield_image = "default_papyrus.png",
1060 paramtype = "light",
1061 sunlight_propagates = true,
1065 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16},
1067 groups = {snappy = 3, flammable = 2},
1068 sounds = default.node_sound_leaves_defaults(),
1070 after_dig_node = function(pos, node, metadata, digger)
1071 default.dig_up(pos, node, digger)
1075 minetest.register_node("default:dry_shrub", {
1076 description = "Dry Shrub",
1077 drawtype = "plantlike",
1080 tiles = {"default_dry_shrub.png"},
1081 inventory_image = "default_dry_shrub.png",
1082 wield_image = "default_dry_shrub.png",
1083 paramtype = "light",
1084 sunlight_propagates = true,
1086 buildable_to = true,
1087 groups = {snappy = 3, flammable = 3, attached_node = 1},
1088 sounds = default.node_sound_leaves_defaults(),
1091 fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 4 / 16, 5 / 16},
1095 minetest.register_node("default:junglegrass", {
1096 description = "Jungle Grass",
1097 drawtype = "plantlike",
1100 tiles = {"default_junglegrass.png"},
1101 inventory_image = "default_junglegrass.png",
1102 wield_image = "default_junglegrass.png",
1103 paramtype = "light",
1104 sunlight_propagates = true,
1106 buildable_to = true,
1107 groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1, flammable = 1},
1108 sounds = default.node_sound_leaves_defaults(),
1111 fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 1.19, 7 / 16},
1116 minetest.register_node("default:grass_1", {
1117 description = "Grass",
1118 drawtype = "plantlike",
1120 tiles = {"default_grass_1.png"},
1121 -- Use texture of a taller grass stage in inventory
1122 inventory_image = "default_grass_3.png",
1123 wield_image = "default_grass_3.png",
1124 paramtype = "light",
1125 sunlight_propagates = true,
1127 buildable_to = true,
1128 groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1, flammable = 1},
1129 sounds = default.node_sound_leaves_defaults(),
1132 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -5 / 16, 6 / 16},
1135 on_place = function(itemstack, placer, pointed_thing)
1136 -- place a random grass node
1137 local stack = ItemStack("default:grass_" .. math.random(1,5))
1138 local ret = minetest.item_place(stack, placer, pointed_thing)
1139 return ItemStack("default:grass_1 " ..
1140 itemstack:get_count() - (1 - ret:get_count()))
1145 minetest.register_node("default:grass_" .. i, {
1146 description = "Grass",
1147 drawtype = "plantlike",
1149 tiles = {"default_grass_" .. i .. ".png"},
1150 inventory_image = "default_grass_" .. i .. ".png",
1151 wield_image = "default_grass_" .. i .. ".png",
1152 paramtype = "light",
1153 sunlight_propagates = true,
1155 buildable_to = true,
1156 drop = "default:grass_1",
1157 groups = {snappy = 3, flora = 1, attached_node = 1,
1158 not_in_creative_inventory = 1, grass = 1, flammable = 1},
1159 sounds = default.node_sound_leaves_defaults(),
1162 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -3 / 16, 6 / 16},
1168 minetest.register_node("default:dry_grass_1", {
1169 description = "Dry Grass",
1170 drawtype = "plantlike",
1172 tiles = {"default_dry_grass_1.png"},
1173 inventory_image = "default_dry_grass_3.png",
1174 wield_image = "default_dry_grass_3.png",
1175 paramtype = "light",
1176 sunlight_propagates = true,
1178 buildable_to = true,
1179 groups = {snappy = 3, flammable = 3, flora = 1,
1180 attached_node = 1, dry_grass = 1},
1181 sounds = default.node_sound_leaves_defaults(),
1184 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -3 / 16, 6 / 16},
1187 on_place = function(itemstack, placer, pointed_thing)
1188 -- place a random dry grass node
1189 local stack = ItemStack("default:dry_grass_" .. math.random(1, 5))
1190 local ret = minetest.item_place(stack, placer, pointed_thing)
1191 return ItemStack("default:dry_grass_1 " ..
1192 itemstack:get_count() - (1 - ret:get_count()))
1197 minetest.register_node("default:dry_grass_" .. i, {
1198 description = "Dry Grass",
1199 drawtype = "plantlike",
1201 tiles = {"default_dry_grass_" .. i .. ".png"},
1202 inventory_image = "default_dry_grass_" .. i .. ".png",
1203 wield_image = "default_dry_grass_" .. i .. ".png",
1204 paramtype = "light",
1205 sunlight_propagates = true,
1207 buildable_to = true,
1208 groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1,
1209 not_in_creative_inventory=1, dry_grass = 1},
1210 drop = "default:dry_grass_1",
1211 sounds = default.node_sound_leaves_defaults(),
1214 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -1 / 16, 6 / 16},
1220 minetest.register_node("default:bush_stem", {
1221 description = "Bush Stem",
1222 drawtype = "plantlike",
1223 visual_scale = 1.18,
1224 tiles = {"default_bush_stem.png"},
1225 inventory_image = "default_bush_stem.png",
1226 wield_image = "default_bush_stem.png",
1227 paramtype = "light",
1228 sunlight_propagates = true,
1229 groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
1230 sounds = default.node_sound_wood_defaults(),
1233 fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.54, 7 / 16},
1237 minetest.register_node("default:bush_leaves", {
1238 description = "Bush Leaves",
1239 drawtype = "allfaces_optional",
1241 tiles = {"default_leaves_simple.png"},
1242 paramtype = "light",
1243 groups = {snappy = 3, flammable = 2, leaves = 1},
1244 sounds = default.node_sound_leaves_defaults(),
1247 minetest.register_node("default:acacia_bush_stem", {
1248 description = "Acacia Bush Stem",
1249 drawtype = "plantlike",
1250 visual_scale = 1.18,
1251 tiles = {"default_acacia_bush_stem.png"},
1252 inventory_image = "default_acacia_bush_stem.png",
1253 wield_image = "default_acacia_bush_stem.png",
1254 paramtype = "light",
1255 sunlight_propagates = true,
1256 groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
1257 sounds = default.node_sound_wood_defaults(),
1260 fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.54, 7 / 16},
1264 minetest.register_node("default:acacia_bush_leaves", {
1265 description = "Acacia Bush Leaves",
1266 drawtype = "allfaces_optional",
1268 tiles = {"default_acacia_leaves_simple.png"},
1269 paramtype = "light",
1270 groups = {snappy = 3, flammable = 2, leaves = 1},
1271 sounds = default.node_sound_leaves_defaults(),
1279 minetest.register_node("default:coral_brown", {
1280 description = "Brown Coral",
1281 tiles = {"default_coral_brown.png"},
1282 groups = {cracky = 3},
1283 drop = "default:coral_skeleton",
1284 sounds = default.node_sound_stone_defaults(),
1287 minetest.register_node("default:coral_orange", {
1288 description = "Orange Coral",
1289 tiles = {"default_coral_orange.png"},
1290 groups = {cracky = 3},
1291 drop = "default:coral_skeleton",
1292 sounds = default.node_sound_stone_defaults(),
1295 minetest.register_node("default:coral_skeleton", {
1296 description = "Coral Skeleton",
1297 tiles = {"default_coral_skeleton.png"},
1298 groups = {cracky = 3},
1299 sounds = default.node_sound_stone_defaults(),
1307 minetest.register_node("default:water_source", {
1308 description = "Water Source",
1309 drawtype = "liquid",
1312 name = "default_water_source_animated.png",
1314 type = "vertical_frames",
1322 -- New-style water source material (mostly unused)
1324 name = "default_water_source_animated.png",
1326 type = "vertical_frames",
1331 backface_culling = false,
1335 paramtype = "light",
1339 buildable_to = true,
1340 is_ground_content = false,
1343 liquidtype = "source",
1344 liquid_alternative_flowing = "default:water_flowing",
1345 liquid_alternative_source = "default:water_source",
1346 liquid_viscosity = 1,
1347 post_effect_color = {a = 103, r = 30, g = 60, b = 90},
1348 groups = {water = 3, liquid = 3, puts_out_fire = 1},
1351 minetest.register_node("default:water_flowing", {
1352 description = "Flowing Water",
1353 drawtype = "flowingliquid",
1354 tiles = {"default_water.png"},
1357 name = "default_water_flowing_animated.png",
1358 backface_culling = false,
1360 type = "vertical_frames",
1367 name = "default_water_flowing_animated.png",
1368 backface_culling = true,
1370 type = "vertical_frames",
1378 paramtype = "light",
1379 paramtype2 = "flowingliquid",
1383 buildable_to = true,
1384 is_ground_content = false,
1387 liquidtype = "flowing",
1388 liquid_alternative_flowing = "default:water_flowing",
1389 liquid_alternative_source = "default:water_source",
1390 liquid_viscosity = 1,
1391 post_effect_color = {a = 103, r = 30, g = 60, b = 90},
1392 groups = {water = 3, liquid = 3, puts_out_fire = 1,
1393 not_in_creative_inventory = 1},
1397 minetest.register_node("default:river_water_source", {
1398 description = "River Water Source",
1399 drawtype = "liquid",
1402 name = "default_river_water_source_animated.png",
1404 type = "vertical_frames",
1413 name = "default_river_water_source_animated.png",
1415 type = "vertical_frames",
1420 backface_culling = false,
1424 paramtype = "light",
1428 buildable_to = true,
1429 is_ground_content = false,
1432 liquidtype = "source",
1433 liquid_alternative_flowing = "default:river_water_flowing",
1434 liquid_alternative_source = "default:river_water_source",
1435 liquid_viscosity = 1,
1436 liquid_renewable = false,
1438 post_effect_color = {a = 103, r = 30, g = 76, b = 90},
1439 groups = {water = 3, liquid = 3, puts_out_fire = 1},
1442 minetest.register_node("default:river_water_flowing", {
1443 description = "Flowing River Water",
1444 drawtype = "flowingliquid",
1445 tiles = {"default_river_water.png"},
1448 name = "default_river_water_flowing_animated.png",
1449 backface_culling = false,
1451 type = "vertical_frames",
1458 name = "default_river_water_flowing_animated.png",
1459 backface_culling = true,
1461 type = "vertical_frames",
1469 paramtype = "light",
1470 paramtype2 = "flowingliquid",
1474 buildable_to = true,
1475 is_ground_content = false,
1478 liquidtype = "flowing",
1479 liquid_alternative_flowing = "default:river_water_flowing",
1480 liquid_alternative_source = "default:river_water_source",
1481 liquid_viscosity = 1,
1482 liquid_renewable = false,
1484 post_effect_color = {a = 103, r = 30, g = 76, b = 90},
1485 groups = {water = 3, liquid = 3, puts_out_fire = 1,
1486 not_in_creative_inventory = 1},
1490 minetest.register_node("default:lava_source", {
1491 description = "Lava Source",
1492 drawtype = "liquid",
1495 name = "default_lava_source_animated.png",
1497 type = "vertical_frames",
1505 -- New-style lava source material (mostly unused)
1507 name = "default_lava_source_animated.png",
1509 type = "vertical_frames",
1514 backface_culling = false,
1517 paramtype = "light",
1518 light_source = default.LIGHT_MAX - 1,
1522 buildable_to = true,
1523 is_ground_content = false,
1526 liquidtype = "source",
1527 liquid_alternative_flowing = "default:lava_flowing",
1528 liquid_alternative_source = "default:lava_source",
1529 liquid_viscosity = 7,
1530 liquid_renewable = false,
1531 damage_per_second = 4 * 2,
1532 post_effect_color = {a = 191, r = 255, g = 64, b = 0},
1533 groups = {lava = 3, liquid = 2, igniter = 1},
1536 minetest.register_node("default:lava_flowing", {
1537 description = "Flowing Lava",
1538 drawtype = "flowingliquid",
1539 tiles = {"default_lava.png"},
1542 name = "default_lava_flowing_animated.png",
1543 backface_culling = false,
1545 type = "vertical_frames",
1552 name = "default_lava_flowing_animated.png",
1553 backface_culling = true,
1555 type = "vertical_frames",
1562 paramtype = "light",
1563 paramtype2 = "flowingliquid",
1564 light_source = default.LIGHT_MAX - 1,
1568 buildable_to = true,
1569 is_ground_content = false,
1572 liquidtype = "flowing",
1573 liquid_alternative_flowing = "default:lava_flowing",
1574 liquid_alternative_source = "default:lava_source",
1575 liquid_viscosity = 7,
1576 liquid_renewable = false,
1577 damage_per_second = 4 * 2,
1578 post_effect_color = {a = 191, r = 255, g = 64, b = 0},
1579 groups = {lava = 3, liquid = 2, igniter = 1,
1580 not_in_creative_inventory = 1},
1584 -- Tools / "Advanced" crafting / Non-"natural"
1587 minetest.register_node("default:torch", {
1588 description = "Torch",
1589 drawtype = "torchlike",
1592 name = "default_torch_on_floor_animated.png",
1594 type = "vertical_frames",
1601 name="default_torch_on_ceiling_animated.png",
1603 type = "vertical_frames",
1610 name="default_torch_animated.png",
1612 type = "vertical_frames",
1619 inventory_image = "default_torch_on_floor.png",
1620 wield_image = "default_torch_on_floor.png",
1621 paramtype = "light",
1622 paramtype2 = "wallmounted",
1623 sunlight_propagates = true,
1624 is_ground_content = false,
1626 light_source = default.LIGHT_MAX - 1,
1628 type = "wallmounted",
1629 wall_top = {-0.1, 0.5 - 0.6, -0.1, 0.1, 0.5, 0.1},
1630 wall_bottom = {-0.1, -0.5, -0.1, 0.1, -0.5 + 0.6, 0.1},
1631 wall_side = {-0.5, -0.3, -0.1, -0.5 + 0.3, 0.3, 0.1},
1633 groups = {choppy = 2, dig_immediate = 3, flammable = 1, attached_node = 1},
1634 legacy_wallmounted = true,
1635 sounds = default.node_sound_defaults(),
1639 local chest_formspec =
1642 default.gui_bg_img ..
1643 default.gui_slots ..
1644 "list[current_name;main;0,0.3;8,4;]" ..
1645 "list[current_player;main;0,4.85;8,1;]" ..
1646 "list[current_player;main;0,6.08;8,3;8]" ..
1647 "listring[current_name;main]" ..
1648 "listring[current_player;main]" ..
1649 default.get_hotbar_bg(0,4.85)
1651 local function get_locked_chest_formspec(pos)
1652 local spos = pos.x .. "," .. pos.y .. "," .. pos.z
1656 default.gui_bg_img ..
1657 default.gui_slots ..
1658 "list[nodemeta:" .. spos .. ";main;0,0.3;8,4;]" ..
1659 "list[current_player;main;0,4.85;8,1;]" ..
1660 "list[current_player;main;0,6.08;8,3;8]" ..
1661 "listring[nodemeta:" .. spos .. ";main]" ..
1662 "listring[current_player;main]" ..
1663 default.get_hotbar_bg(0,4.85)
1667 local function has_locked_chest_privilege(meta, player)
1670 if minetest.check_player_privs(player, "protection_bypass") then
1673 name = player:get_player_name()
1675 if name ~= meta:get_string("owner") then
1681 minetest.register_node("default:chest", {
1682 description = "Chest",
1683 tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
1684 "default_chest_side.png", "default_chest_side.png", "default_chest_front.png"},
1685 paramtype2 = "facedir",
1686 groups = {choppy = 2, oddly_breakable_by_hand = 2},
1687 legacy_facedir_simple = true,
1688 is_ground_content = false,
1689 sounds = default.node_sound_wood_defaults(),
1691 on_construct = function(pos)
1692 local meta = minetest.get_meta(pos)
1693 meta:set_string("formspec", chest_formspec)
1694 local inv = meta:get_inventory()
1695 inv:set_size("main", 8*4)
1697 can_dig = function(pos,player)
1698 local meta = minetest.get_meta(pos);
1699 local inv = meta:get_inventory()
1700 return inv:is_empty("main")
1702 on_metadata_inventory_move = function(pos, from_list, from_index,
1703 to_list, to_index, count, player)
1704 minetest.log("action", player:get_player_name() ..
1705 " moves stuff in chest at " .. minetest.pos_to_string(pos))
1707 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1708 minetest.log("action", player:get_player_name() ..
1709 " moves " .. stack:get_name() ..
1710 " to chest at " .. minetest.pos_to_string(pos))
1712 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1713 minetest.log("action", player:get_player_name() ..
1714 " takes " .. stack:get_name() ..
1715 " from chest at " .. minetest.pos_to_string(pos))
1717 on_blast = function(pos)
1719 default.get_inventory_drops(pos, "main", drops)
1720 drops[#drops+1] = "default:chest"
1721 minetest.remove_node(pos)
1726 minetest.register_node("default:chest_locked", {
1727 description = "Locked Chest",
1728 tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
1729 "default_chest_side.png", "default_chest_side.png", "default_chest_lock.png"},
1730 paramtype2 = "facedir",
1731 groups = {choppy = 2, oddly_breakable_by_hand = 2},
1732 legacy_facedir_simple = true,
1733 is_ground_content = false,
1734 sounds = default.node_sound_wood_defaults(),
1736 after_place_node = function(pos, placer)
1737 local meta = minetest.get_meta(pos)
1738 meta:set_string("owner", placer:get_player_name() or "")
1739 meta:set_string("infotext", "Locked Chest (owned by " ..
1740 meta:get_string("owner") .. ")")
1742 on_construct = function(pos)
1743 local meta = minetest.get_meta(pos)
1744 meta:set_string("owner", "")
1745 local inv = meta:get_inventory()
1746 inv:set_size("main", 8 * 4)
1748 can_dig = function(pos,player)
1749 local meta = minetest.get_meta(pos);
1750 local inv = meta:get_inventory()
1751 return inv:is_empty("main") and has_locked_chest_privilege(meta, player)
1753 allow_metadata_inventory_move = function(pos, from_list, from_index,
1754 to_list, to_index, count, player)
1755 local meta = minetest.get_meta(pos)
1756 if not has_locked_chest_privilege(meta, player) then
1761 allow_metadata_inventory_put = function(pos, listname, index, stack, player)
1762 local meta = minetest.get_meta(pos)
1763 if not has_locked_chest_privilege(meta, player) then
1766 return stack:get_count()
1768 allow_metadata_inventory_take = function(pos, listname, index, stack, player)
1769 local meta = minetest.get_meta(pos)
1770 if not has_locked_chest_privilege(meta, player) then
1773 return stack:get_count()
1775 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1776 minetest.log("action", player:get_player_name() ..
1777 " moves " .. stack:get_name() ..
1778 " to locked chest at " .. minetest.pos_to_string(pos))
1780 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1781 minetest.log("action", player:get_player_name() ..
1782 " takes " .. stack:get_name() ..
1783 " from locked chest at " .. minetest.pos_to_string(pos))
1785 on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
1786 local meta = minetest.get_meta(pos)
1787 if has_locked_chest_privilege(meta, clicker) then
1788 minetest.show_formspec(
1789 clicker:get_player_name(),
1790 "default:chest_locked",
1791 get_locked_chest_formspec(pos)
1796 on_blast = function() end,
1800 local bookshelf_formspec =
1803 default.gui_bg_img ..
1804 default.gui_slots ..
1805 "list[context;books;0,0.3;8,2;]" ..
1806 "list[current_player;main;0,2.85;8,1;]" ..
1807 "list[current_player;main;0,4.08;8,3;8]" ..
1808 "listring[context;books]" ..
1809 "listring[current_player;main]" ..
1810 default.get_hotbar_bg(0,2.85)
1812 -- Inventory slots overlay
1813 local bx, by = 0, 0.3
1819 bookshelf_formspec = bookshelf_formspec ..
1820 "image["..bx..","..by..";1,1;default_book_slot.png]"
1824 minetest.register_node("default:bookshelf", {
1825 description = "Bookshelf",
1826 tiles = {"default_wood.png", "default_wood.png", "default_wood.png",
1827 "default_wood.png", "default_bookshelf.png", "default_bookshelf.png"},
1828 paramtype2 = "facedir",
1829 is_ground_content = false,
1830 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
1831 sounds = default.node_sound_wood_defaults(),
1833 on_construct = function(pos)
1834 local meta = minetest.get_meta(pos)
1835 meta:set_string("formspec", bookshelf_formspec)
1836 local inv = meta:get_inventory()
1837 inv:set_size("books", 8 * 2)
1839 can_dig = function(pos,player)
1840 local inv = minetest.get_meta(pos):get_inventory()
1841 return inv:is_empty("books")
1843 allow_metadata_inventory_put = function(pos, listname, index, stack)
1844 if minetest.get_item_group(stack:get_name(), "book") ~= 0 then
1845 return stack:get_count()
1849 on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
1850 minetest.log("action", player:get_player_name() ..
1851 " moves stuff in bookshelf at " .. minetest.pos_to_string(pos))
1853 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1854 minetest.log("action", player:get_player_name() ..
1855 " moves stuff to bookshelf at " .. minetest.pos_to_string(pos))
1857 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1858 minetest.log("action", player:get_player_name() ..
1859 " takes stuff from bookshelf at " .. minetest.pos_to_string(pos))
1861 on_blast = function(pos)
1863 default.get_inventory_drops(pos, "books", drops)
1864 drops[#drops+1] = "default:bookshelf"
1865 minetest.remove_node(pos)
1870 local function register_sign(material, desc, def)
1871 minetest.register_node("default:sign_wall_" .. material, {
1872 description = desc .. " Sign",
1873 drawtype = "nodebox",
1874 tiles = {"default_sign_wall_" .. material .. ".png"},
1875 inventory_image = "default_sign_" .. material .. ".png",
1876 wield_image = "default_sign_" .. material .. ".png",
1877 paramtype = "light",
1878 paramtype2 = "wallmounted",
1879 sunlight_propagates = true,
1880 is_ground_content = false,
1883 type = "wallmounted",
1884 wall_top = {-0.4375, 0.4375, -0.3125, 0.4375, 0.5, 0.3125},
1885 wall_bottom = {-0.4375, -0.5, -0.3125, 0.4375, -0.4375, 0.3125},
1886 wall_side = {-0.5, -0.3125, -0.4375, -0.4375, 0.3125, 0.4375},
1888 groups = def.groups,
1889 legacy_wallmounted = true,
1890 sounds = def.sounds,
1892 on_construct = function(pos)
1893 --local n = minetest.get_node(pos)
1894 local meta = minetest.get_meta(pos)
1895 meta:set_string("formspec", "field[text;;${text}]")
1897 on_receive_fields = function(pos, formname, fields, sender)
1898 --print("Sign at "..minetest.pos_to_string(pos).." got "..dump(fields))
1899 local player_name = sender:get_player_name()
1900 if minetest.is_protected(pos, player_name) then
1901 minetest.record_protection_violation(pos, player_name)
1904 local meta = minetest.get_meta(pos)
1905 if not fields.text then return end
1906 minetest.log("action", (player_name or "") .. " wrote \"" ..
1907 fields.text .. "\" to sign at " .. minetest.pos_to_string(pos))
1908 meta:set_string("text", fields.text)
1909 meta:set_string("infotext", '"' .. fields.text .. '"')
1914 register_sign("wood", "Wooden", {
1915 sounds = default.node_sound_wood_defaults(),
1916 groups = {choppy = 2, attached_node = 1, flammable = 2, oddly_breakable_by_hand = 3}
1919 register_sign("steel", "Steel", {
1920 sounds = default.node_sound_metal_defaults(),
1921 groups = {cracky = 2, attached_node = 1}
1924 minetest.register_node("default:ladder_wood", {
1925 description = "Wooden Ladder",
1926 drawtype = "signlike",
1927 tiles = {"default_ladder_wood.png"},
1928 inventory_image = "default_ladder_wood.png",
1929 wield_image = "default_ladder_wood.png",
1930 paramtype = "light",
1931 paramtype2 = "wallmounted",
1932 sunlight_propagates = true,
1935 is_ground_content = false,
1937 type = "wallmounted",
1938 --wall_top = = <default>
1939 --wall_bottom = = <default>
1940 --wall_side = = <default>
1942 groups = {choppy = 2, oddly_breakable_by_hand = 3, flammable = 2},
1943 legacy_wallmounted = true,
1944 sounds = default.node_sound_wood_defaults(),
1947 minetest.register_node("default:ladder_steel", {
1948 description = "Steel Ladder",
1949 drawtype = "signlike",
1950 tiles = {"default_ladder_steel.png"},
1951 inventory_image = "default_ladder_steel.png",
1952 wield_image = "default_ladder_steel.png",
1953 paramtype = "light",
1954 paramtype2 = "wallmounted",
1955 sunlight_propagates = true,
1958 is_ground_content = false,
1960 type = "wallmounted",
1961 --wall_top = = <default>
1962 --wall_bottom = = <default>
1963 --wall_side = = <default>
1965 groups = {cracky = 2},
1966 sounds = default.node_sound_metal_defaults(),
1969 default.register_fence("default:fence_wood", {
1970 description = "Wooden Fence",
1971 texture = "default_fence_wood.png",
1972 inventory_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1973 wield_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1974 material = "default:wood",
1975 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
1976 sounds = default.node_sound_wood_defaults()
1979 default.register_fence("default:fence_acacia_wood", {
1980 description = "Acacia Fence",
1981 texture = "default_fence_acacia_wood.png",
1982 inventory_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1983 wield_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1984 material = "default:acacia_wood",
1985 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
1986 sounds = default.node_sound_wood_defaults()
1989 default.register_fence("default:fence_junglewood", {
1990 description = "Junglewood Fence",
1991 texture = "default_fence_junglewood.png",
1992 inventory_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126",
1993 wield_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126",
1994 material = "default:junglewood",
1995 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
1996 sounds = default.node_sound_wood_defaults()
1999 default.register_fence("default:fence_pine_wood", {
2000 description = "Pine Fence",
2001 texture = "default_fence_pine_wood.png",
2002 inventory_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2003 wield_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2004 material = "default:pine_wood",
2005 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
2006 sounds = default.node_sound_wood_defaults()
2009 default.register_fence("default:fence_aspen_wood", {
2010 description = "Aspen Fence",
2011 texture = "default_fence_aspen_wood.png",
2012 inventory_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2013 wield_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2014 material = "default:aspen_wood",
2015 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
2016 sounds = default.node_sound_wood_defaults()
2019 minetest.register_node("default:glass", {
2020 description = "Glass",
2021 drawtype = "glasslike_framed_optional",
2022 tiles = {"default_glass.png", "default_glass_detail.png"},
2023 paramtype = "light",
2024 sunlight_propagates = true,
2025 is_ground_content = false,
2026 groups = {cracky = 3, oddly_breakable_by_hand = 3},
2027 sounds = default.node_sound_glass_defaults(),
2030 minetest.register_node("default:obsidian_glass", {
2031 description = "Obsidian Glass",
2032 drawtype = "glasslike_framed_optional",
2033 tiles = {"default_obsidian_glass.png", "default_obsidian_glass_detail.png"},
2034 paramtype = "light",
2035 is_ground_content = false,
2036 sunlight_propagates = true,
2037 sounds = default.node_sound_glass_defaults(),
2038 groups = {cracky = 3},
2042 minetest.register_node("default:rail", {
2043 description = "Rail",
2044 drawtype = "raillike",
2045 tiles = {"default_rail.png", "default_rail_curved.png",
2046 "default_rail_t_junction.png", "default_rail_crossing.png"},
2047 inventory_image = "default_rail.png",
2048 wield_image = "default_rail.png",
2049 paramtype = "light",
2050 sunlight_propagates = true,
2052 is_ground_content = false,
2055 -- but how to specify the dimensions for curved and sideways rails?
2056 fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
2058 groups = {dig_immediate = 2, attached_node = 1,
2059 connect_to_raillike = minetest.raillike_group("rail")},
2063 minetest.register_node("default:brick", {
2064 description = "Brick Block",
2065 paramtype2 = "facedir",
2067 tiles = {"default_brick.png"},
2068 is_ground_content = false,
2069 groups = {cracky = 3},
2070 sounds = default.node_sound_stone_defaults(),
2074 minetest.register_node("default:meselamp", {
2075 description = "Mese Lamp",
2076 drawtype = "glasslike",
2077 tiles = {"default_meselamp.png"},
2078 paramtype = "light",
2079 sunlight_propagates = true,
2080 is_ground_content = false,
2081 groups = {cracky = 3, oddly_breakable_by_hand = 3},
2082 sounds = default.node_sound_glass_defaults(),
2083 light_source = default.LIGHT_MAX,
2090 minetest.register_node("default:cloud", {
2091 description = "Cloud",
2092 tiles = {"default_cloud.png"},
2093 is_ground_content = false,
2094 sounds = default.node_sound_defaults(),
2095 groups = {not_in_creative_inventory = 1},