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 -------------------------------------------
167 default:sign_wall_wood
168 default:sign_wall_steel
174 default:fence_acacia_wood
175 default:fence_junglewood
176 default:fence_pine_wood
177 default:fence_aspen_wood
180 default:obsidian_glass
185 default:mese_post_light
198 minetest.register_node("default:stone", {
199 description = "Stone",
200 tiles = {"default_stone.png"},
201 groups = {cracky = 3, stone = 1},
202 drop = 'default:cobble',
203 legacy_mineral = true,
204 sounds = default.node_sound_stone_defaults(),
207 minetest.register_node("default:cobble", {
208 description = "Cobblestone",
209 tiles = {"default_cobble.png"},
210 is_ground_content = false,
211 groups = {cracky = 3, stone = 2},
212 sounds = default.node_sound_stone_defaults(),
215 minetest.register_node("default:stonebrick", {
216 description = "Stone Brick",
217 paramtype2 = "facedir",
219 tiles = {"default_stone_brick.png"},
220 is_ground_content = false,
221 groups = {cracky = 2, stone = 1},
222 sounds = default.node_sound_stone_defaults(),
225 minetest.register_node("default:stone_block", {
226 description = "Stone Block",
227 tiles = {"default_stone_block.png"},
228 is_ground_content = false,
229 groups = {cracky = 2, stone = 1},
230 sounds = default.node_sound_stone_defaults(),
233 minetest.register_node("default:mossycobble", {
234 description = "Mossy Cobblestone",
235 tiles = {"default_mossycobble.png"},
236 is_ground_content = false,
237 groups = {cracky = 3, stone = 1},
238 sounds = default.node_sound_stone_defaults(),
242 minetest.register_node("default:desert_stone", {
243 description = "Desert Stone",
244 tiles = {"default_desert_stone.png"},
245 groups = {cracky = 3, stone = 1},
246 drop = 'default:desert_cobble',
247 legacy_mineral = true,
248 sounds = default.node_sound_stone_defaults(),
251 minetest.register_node("default:desert_cobble", {
252 description = "Desert Cobblestone",
253 tiles = {"default_desert_cobble.png"},
254 is_ground_content = false,
255 groups = {cracky = 3, stone = 2},
256 sounds = default.node_sound_stone_defaults(),
259 minetest.register_node("default:desert_stonebrick", {
260 description = "Desert Stone Brick",
261 paramtype2 = "facedir",
263 tiles = {"default_desert_stone_brick.png"},
264 is_ground_content = false,
265 groups = {cracky = 2, stone = 1},
266 sounds = default.node_sound_stone_defaults(),
269 minetest.register_node("default:desert_stone_block", {
270 description = "Desert Stone Block",
271 tiles = {"default_desert_stone_block.png"},
272 is_ground_content = false,
273 groups = {cracky = 2, stone = 1},
274 sounds = default.node_sound_stone_defaults(),
278 minetest.register_node("default:sandstone", {
279 description = "Sandstone",
280 tiles = {"default_sandstone.png"},
281 groups = {crumbly = 1, cracky = 3},
282 sounds = default.node_sound_stone_defaults(),
285 minetest.register_node("default:sandstonebrick", {
286 description = "Sandstone Brick",
287 paramtype2 = "facedir",
289 tiles = {"default_sandstone_brick.png"},
290 is_ground_content = false,
291 groups = {cracky = 2},
292 sounds = default.node_sound_stone_defaults(),
295 minetest.register_node("default:sandstone_block", {
296 description = "Sandstone Block",
297 tiles = {"default_sandstone_block.png"},
298 is_ground_content = false,
299 groups = {cracky = 2},
300 sounds = default.node_sound_stone_defaults(),
304 minetest.register_node("default:obsidian", {
305 description = "Obsidian",
306 tiles = {"default_obsidian.png"},
307 sounds = default.node_sound_stone_defaults(),
308 groups = {cracky = 1, level = 2},
311 minetest.register_node("default:obsidianbrick", {
312 description = "Obsidian Brick",
313 paramtype2 = "facedir",
315 tiles = {"default_obsidian_brick.png"},
316 is_ground_content = false,
317 sounds = default.node_sound_stone_defaults(),
318 groups = {cracky = 1, level = 2},
321 minetest.register_node("default:obsidian_block", {
322 description = "Obsidian Block",
323 tiles = {"default_obsidian_block.png"},
324 is_ground_content = false,
325 sounds = default.node_sound_stone_defaults(),
326 groups = {cracky = 1, level = 2},
333 minetest.register_node("default:dirt", {
334 description = "Dirt",
335 tiles = {"default_dirt.png"},
336 groups = {crumbly = 3, soil = 1},
337 sounds = default.node_sound_dirt_defaults(),
340 minetest.register_node("default:dirt_with_grass", {
341 description = "Dirt with Grass",
342 tiles = {"default_grass.png", "default_dirt.png",
343 {name = "default_dirt.png^default_grass_side.png",
344 tileable_vertical = false}},
345 groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
346 drop = 'default:dirt',
347 sounds = default.node_sound_dirt_defaults({
348 footstep = {name = "default_grass_footstep", gain = 0.25},
352 minetest.register_node("default:dirt_with_grass_footsteps", {
353 description = "Dirt with Grass and Footsteps",
354 tiles = {"default_grass.png^default_footprint.png", "default_dirt.png",
355 {name = "default_dirt.png^default_grass_side.png",
356 tileable_vertical = false}},
357 groups = {crumbly = 3, soil = 1, not_in_creative_inventory = 1},
358 drop = 'default:dirt',
359 sounds = default.node_sound_dirt_defaults({
360 footstep = {name = "default_grass_footstep", gain = 0.25},
364 minetest.register_node("default:dirt_with_dry_grass", {
365 description = "Dirt with Dry Grass",
366 tiles = {"default_dry_grass.png",
368 {name = "default_dirt.png^default_dry_grass_side.png",
369 tileable_vertical = false}},
370 groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
371 drop = 'default:dirt',
372 sounds = default.node_sound_dirt_defaults({
373 footstep = {name = "default_grass_footstep", gain = 0.4},
377 minetest.register_node("default:dirt_with_snow", {
378 description = "Dirt with Snow",
379 tiles = {"default_snow.png", "default_dirt.png",
380 {name = "default_dirt.png^default_snow_side.png",
381 tileable_vertical = false}},
382 groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1, snowy = 1},
383 drop = 'default:dirt',
384 sounds = default.node_sound_dirt_defaults({
385 footstep = {name = "default_snow_footstep", gain = 0.15},
389 minetest.register_node("default:sand", {
390 description = "Sand",
391 tiles = {"default_sand.png"},
392 groups = {crumbly = 3, falling_node = 1, sand = 1},
393 sounds = default.node_sound_sand_defaults(),
396 minetest.register_node("default:desert_sand", {
397 description = "Desert Sand",
398 tiles = {"default_desert_sand.png"},
399 groups = {crumbly = 3, falling_node = 1, sand = 1},
400 sounds = default.node_sound_sand_defaults(),
403 minetest.register_node("default:silver_sand", {
404 description = "Silver Sand",
405 tiles = {"default_silver_sand.png"},
406 groups = {crumbly = 3, falling_node = 1, sand = 1},
407 sounds = default.node_sound_sand_defaults(),
411 minetest.register_node("default:gravel", {
412 description = "Gravel",
413 tiles = {"default_gravel.png"},
414 groups = {crumbly = 2, falling_node = 1},
415 sounds = default.node_sound_gravel_defaults(),
419 {items = {'default:flint'}, rarity = 16},
420 {items = {'default:gravel'}}
425 minetest.register_node("default:clay", {
426 description = "Clay",
427 tiles = {"default_clay.png"},
428 groups = {crumbly = 3},
429 drop = 'default:clay_lump 4',
430 sounds = default.node_sound_dirt_defaults(),
434 minetest.register_node("default:snow", {
435 description = "Snow",
436 tiles = {"default_snow.png"},
437 inventory_image = "default_snowball.png",
438 wield_image = "default_snowball.png",
442 drawtype = "nodebox",
446 {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
449 groups = {crumbly = 3, falling_node = 1, puts_out_fire = 1, snowy = 1},
450 sounds = default.node_sound_dirt_defaults({
451 footstep = {name = "default_snow_footstep", gain = 0.15},
452 dug = {name = "default_snow_footstep", gain = 0.2},
453 dig = {name = "default_snow_footstep", gain = 0.2}
456 on_construct = function(pos)
458 if minetest.get_node(pos).name == "default:dirt_with_grass" then
459 minetest.set_node(pos, {name = "default:dirt_with_snow"})
464 minetest.register_node("default:snowblock", {
465 description = "Snow Block",
466 tiles = {"default_snow.png"},
467 groups = {crumbly = 3, puts_out_fire = 1, cools_lava = 1, snowy = 1},
468 sounds = default.node_sound_dirt_defaults({
469 footstep = {name = "default_snow_footstep", gain = 0.15},
470 dug = {name = "default_snow_footstep", gain = 0.2},
471 dig = {name = "default_snow_footstep", gain = 0.2}
474 on_construct = function(pos)
476 if minetest.get_node(pos).name == "default:dirt_with_grass" then
477 minetest.set_node(pos, {name = "default:dirt_with_snow"})
482 minetest.register_node("default:ice", {
484 tiles = {"default_ice.png"},
485 is_ground_content = false,
487 groups = {cracky = 3, puts_out_fire = 1, cools_lava = 1},
488 sounds = default.node_sound_glass_defaults(),
495 minetest.register_node("default:tree", {
496 description = "Tree",
497 tiles = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"},
498 paramtype2 = "facedir",
499 is_ground_content = false,
500 groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
501 sounds = default.node_sound_wood_defaults(),
503 on_place = minetest.rotate_node
506 minetest.register_node("default:wood", {
507 description = "Wooden Planks",
508 paramtype2 = "facedir",
510 tiles = {"default_wood.png"},
511 is_ground_content = false,
512 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
513 sounds = default.node_sound_wood_defaults(),
516 minetest.register_node("default:sapling", {
517 description = "Sapling",
518 drawtype = "plantlike",
519 tiles = {"default_sapling.png"},
520 inventory_image = "default_sapling.png",
521 wield_image = "default_sapling.png",
523 sunlight_propagates = true,
525 on_timer = default.grow_sapling,
528 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
530 groups = {snappy = 2, dig_immediate = 3, flammable = 2,
531 attached_node = 1, sapling = 1},
532 sounds = default.node_sound_leaves_defaults(),
534 on_construct = function(pos)
535 minetest.get_node_timer(pos):start(math.random(2400,4800))
538 on_place = function(itemstack, placer, pointed_thing)
539 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
541 -- minp, maxp to be checked, relative to sapling pos
542 -- minp_relative.y = 1 because sapling pos has been checked
543 {x = -2, y = 1, z = -2},
544 {x = 2, y = 6, z = 2},
545 -- maximum interval of interior volume check
552 minetest.register_node("default:leaves", {
553 description = "Leaves",
554 drawtype = "allfaces_optional",
556 tiles = {"default_leaves.png"},
557 special_tiles = {"default_leaves_simple.png"},
559 is_ground_content = false,
560 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
565 -- player will get sapling with 1/20 chance
566 items = {'default:sapling'},
570 -- player will get leaves only if he get no saplings,
571 -- this is because max_items is 1
572 items = {'default:leaves'},
576 sounds = default.node_sound_leaves_defaults(),
578 after_place_node = default.after_place_leaves,
581 minetest.register_node("default:apple", {
582 description = "Apple",
583 drawtype = "plantlike",
584 tiles = {"default_apple.png"},
585 inventory_image = "default_apple.png",
587 sunlight_propagates = true,
589 is_ground_content = false,
592 fixed = {-3 / 16, -7 / 16, -3 / 16, 3 / 16, 4 / 16, 3 / 16}
594 groups = {fleshy = 3, dig_immediate = 3, flammable = 2,
595 leafdecay = 3, leafdecay_drop = 1},
596 on_use = minetest.item_eat(2),
597 sounds = default.node_sound_leaves_defaults(),
599 after_place_node = function(pos, placer, itemstack)
600 if placer:is_player() then
601 minetest.set_node(pos, {name = "default:apple", param2 = 1})
607 minetest.register_node("default:jungletree", {
608 description = "Jungle Tree",
609 tiles = {"default_jungletree_top.png", "default_jungletree_top.png",
610 "default_jungletree.png"},
611 paramtype2 = "facedir",
612 is_ground_content = false,
613 groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
614 sounds = default.node_sound_wood_defaults(),
616 on_place = minetest.rotate_node
619 minetest.register_node("default:junglewood", {
620 description = "Junglewood Planks",
621 paramtype2 = "facedir",
623 tiles = {"default_junglewood.png"},
624 is_ground_content = false,
625 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
626 sounds = default.node_sound_wood_defaults(),
629 minetest.register_node("default:jungleleaves", {
630 description = "Jungle Leaves",
631 drawtype = "allfaces_optional",
633 tiles = {"default_jungleleaves.png"},
634 special_tiles = {"default_jungleleaves_simple.png"},
636 is_ground_content = false,
637 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
641 {items = {'default:junglesapling'}, rarity = 20},
642 {items = {'default:jungleleaves'}}
645 sounds = default.node_sound_leaves_defaults(),
647 after_place_node = default.after_place_leaves,
650 minetest.register_node("default:junglesapling", {
651 description = "Jungle Sapling",
652 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",
732 tiles = {"default_pine_sapling.png"},
733 inventory_image = "default_pine_sapling.png",
734 wield_image = "default_pine_sapling.png",
736 sunlight_propagates = true,
738 on_timer = default.grow_sapling,
741 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
743 groups = {snappy = 2, dig_immediate = 3, flammable = 3,
744 attached_node = 1, sapling = 1},
745 sounds = default.node_sound_leaves_defaults(),
747 on_construct = function(pos)
748 minetest.get_node_timer(pos):start(math.random(2400,4800))
751 on_place = function(itemstack, placer, pointed_thing)
752 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
753 "default:pine_sapling",
754 -- minp, maxp to be checked, relative to sapling pos
755 -- minp_relative.y = 1 because sapling pos has been checked
756 {x = -2, y = 1, z = -2},
757 {x = 2, y = 12, z = 2},
758 -- maximum interval of interior volume check
766 minetest.register_node("default:acacia_tree", {
767 description = "Acacia Tree",
768 tiles = {"default_acacia_tree_top.png", "default_acacia_tree_top.png",
769 "default_acacia_tree.png"},
770 paramtype2 = "facedir",
771 is_ground_content = false,
772 groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
773 sounds = default.node_sound_wood_defaults(),
775 on_place = minetest.rotate_node
778 minetest.register_node("default:acacia_wood", {
779 description = "Acacia Wood Planks",
780 paramtype2 = "facedir",
782 tiles = {"default_acacia_wood.png"},
783 is_ground_content = false,
784 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
785 sounds = default.node_sound_wood_defaults(),
788 minetest.register_node("default:acacia_leaves", {
789 description = "Acacia Leaves",
790 drawtype = "allfaces_optional",
791 tiles = {"default_acacia_leaves.png"},
792 special_tiles = {"default_acacia_leaves_simple.png"},
795 is_ground_content = false,
796 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
800 {items = {"default:acacia_sapling"}, rarity = 20},
801 {items = {"default:acacia_leaves"}}
804 sounds = default.node_sound_leaves_defaults(),
806 after_place_node = default.after_place_leaves,
809 minetest.register_node("default:acacia_sapling", {
810 description = "Acacia Tree Sapling",
811 drawtype = "plantlike",
812 tiles = {"default_acacia_sapling.png"},
813 inventory_image = "default_acacia_sapling.png",
814 wield_image = "default_acacia_sapling.png",
816 sunlight_propagates = true,
818 on_timer = default.grow_sapling,
821 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
823 groups = {snappy = 2, dig_immediate = 3, flammable = 2,
824 attached_node = 1, sapling = 1},
825 sounds = default.node_sound_leaves_defaults(),
827 on_construct = function(pos)
828 minetest.get_node_timer(pos):start(math.random(2400,4800))
831 on_place = function(itemstack, placer, pointed_thing)
832 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
833 "default:acacia_sapling",
834 -- minp, maxp to be checked, relative to sapling pos
835 -- minp_relative.y = 1 because sapling pos has been checked
836 {x = -4, y = 1, z = -4},
837 {x = 4, y = 6, z = 4},
838 -- maximum interval of interior volume check
845 minetest.register_node("default:aspen_tree", {
846 description = "Aspen Tree",
847 tiles = {"default_aspen_tree_top.png", "default_aspen_tree_top.png",
848 "default_aspen_tree.png"},
849 paramtype2 = "facedir",
850 is_ground_content = false,
851 groups = {tree = 1, choppy = 3, oddly_breakable_by_hand = 1, flammable = 3},
852 sounds = default.node_sound_wood_defaults(),
854 on_place = minetest.rotate_node
857 minetest.register_node("default:aspen_wood", {
858 description = "Aspen Wood Planks",
859 paramtype2 = "facedir",
861 tiles = {"default_aspen_wood.png"},
862 is_ground_content = false,
863 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
864 sounds = default.node_sound_wood_defaults(),
867 minetest.register_node("default:aspen_leaves", {
868 description = "Aspen Leaves",
869 drawtype = "allfaces_optional",
870 tiles = {"default_aspen_leaves.png"},
873 is_ground_content = false,
874 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
878 {items = {"default:aspen_sapling"}, rarity = 20},
879 {items = {"default:aspen_leaves"}}
882 sounds = default.node_sound_leaves_defaults(),
884 after_place_node = default.after_place_leaves,
887 minetest.register_node("default:aspen_sapling", {
888 description = "Aspen Tree Sapling",
889 drawtype = "plantlike",
890 tiles = {"default_aspen_sapling.png"},
891 inventory_image = "default_aspen_sapling.png",
892 wield_image = "default_aspen_sapling.png",
894 sunlight_propagates = true,
896 on_timer = default.grow_sapling,
899 fixed = {-3 / 16, -0.5, -3 / 16, 3 / 16, 0.5, 3 / 16}
901 groups = {snappy = 2, dig_immediate = 3, flammable = 3,
902 attached_node = 1, sapling = 1},
903 sounds = default.node_sound_leaves_defaults(),
905 on_construct = function(pos)
906 minetest.get_node_timer(pos):start(math.random(2400,4800))
909 on_place = function(itemstack, placer, pointed_thing)
910 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
911 "default:aspen_sapling",
912 -- minp, maxp to be checked, relative to sapling pos
913 -- minp_relative.y = 1 because sapling pos has been checked
914 {x = -2, y = 1, z = -2},
915 {x = 2, y = 12, z = 2},
916 -- maximum interval of interior volume check
927 minetest.register_node("default:stone_with_coal", {
928 description = "Coal Ore",
929 tiles = {"default_stone.png^default_mineral_coal.png"},
930 groups = {cracky = 3},
931 drop = 'default:coal_lump',
932 sounds = default.node_sound_stone_defaults(),
935 minetest.register_node("default:coalblock", {
936 description = "Coal Block",
937 tiles = {"default_coal_block.png"},
938 is_ground_content = false,
939 groups = {cracky = 3},
940 sounds = default.node_sound_stone_defaults(),
944 minetest.register_node("default:stone_with_iron", {
945 description = "Iron Ore",
946 tiles = {"default_stone.png^default_mineral_iron.png"},
947 groups = {cracky = 2},
948 drop = 'default:iron_lump',
949 sounds = default.node_sound_stone_defaults(),
952 minetest.register_node("default:steelblock", {
953 description = "Steel Block",
954 tiles = {"default_steel_block.png"},
955 is_ground_content = false,
956 groups = {cracky = 1, level = 2},
957 sounds = default.node_sound_metal_defaults(),
961 minetest.register_node("default:stone_with_copper", {
962 description = "Copper Ore",
963 tiles = {"default_stone.png^default_mineral_copper.png"},
964 groups = {cracky = 2},
965 drop = 'default:copper_lump',
966 sounds = default.node_sound_stone_defaults(),
969 minetest.register_node("default:copperblock", {
970 description = "Copper Block",
971 tiles = {"default_copper_block.png"},
972 is_ground_content = false,
973 groups = {cracky = 1, level = 2},
974 sounds = default.node_sound_metal_defaults(),
977 minetest.register_node("default:bronzeblock", {
978 description = "Bronze Block",
979 tiles = {"default_bronze_block.png"},
980 is_ground_content = false,
981 groups = {cracky = 1, level = 2},
982 sounds = default.node_sound_metal_defaults(),
986 minetest.register_node("default:stone_with_mese", {
987 description = "Mese Ore",
988 tiles = {"default_stone.png^default_mineral_mese.png"},
989 groups = {cracky = 1},
990 drop = "default:mese_crystal",
991 sounds = default.node_sound_stone_defaults(),
994 minetest.register_node("default:mese", {
995 description = "Mese Block",
996 tiles = {"default_mese_block.png"},
998 groups = {cracky = 1, level = 2},
999 sounds = default.node_sound_stone_defaults(),
1004 minetest.register_node("default:stone_with_gold", {
1005 description = "Gold Ore",
1006 tiles = {"default_stone.png^default_mineral_gold.png"},
1007 groups = {cracky = 2},
1008 drop = "default:gold_lump",
1009 sounds = default.node_sound_stone_defaults(),
1012 minetest.register_node("default:goldblock", {
1013 description = "Gold Block",
1014 tiles = {"default_gold_block.png"},
1015 is_ground_content = false,
1016 groups = {cracky = 1},
1017 sounds = default.node_sound_metal_defaults(),
1021 minetest.register_node("default:stone_with_diamond", {
1022 description = "Diamond Ore",
1023 tiles = {"default_stone.png^default_mineral_diamond.png"},
1024 groups = {cracky = 1},
1025 drop = "default:diamond",
1026 sounds = default.node_sound_stone_defaults(),
1029 minetest.register_node("default:diamondblock", {
1030 description = "Diamond Block",
1031 tiles = {"default_diamond_block.png"},
1032 is_ground_content = false,
1033 groups = {cracky = 1, level = 3},
1034 sounds = default.node_sound_stone_defaults(),
1038 -- Plantlife (non-cubic)
1041 minetest.register_node("default:cactus", {
1042 description = "Cactus",
1043 tiles = {"default_cactus_top.png", "default_cactus_top.png",
1044 "default_cactus_side.png"},
1045 paramtype2 = "facedir",
1046 groups = {choppy = 3},
1047 sounds = default.node_sound_wood_defaults(),
1048 on_place = minetest.rotate_node,
1051 minetest.register_node("default:papyrus", {
1052 description = "Papyrus",
1053 drawtype = "plantlike",
1054 tiles = {"default_papyrus.png"},
1055 inventory_image = "default_papyrus.png",
1056 wield_image = "default_papyrus.png",
1057 paramtype = "light",
1058 sunlight_propagates = true,
1062 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16},
1064 groups = {snappy = 3, flammable = 2},
1065 sounds = default.node_sound_leaves_defaults(),
1067 after_dig_node = function(pos, node, metadata, digger)
1068 default.dig_up(pos, node, digger)
1072 minetest.register_node("default:dry_shrub", {
1073 description = "Dry Shrub",
1074 drawtype = "plantlike",
1076 tiles = {"default_dry_shrub.png"},
1077 inventory_image = "default_dry_shrub.png",
1078 wield_image = "default_dry_shrub.png",
1079 paramtype = "light",
1080 sunlight_propagates = true,
1082 buildable_to = true,
1083 groups = {snappy = 3, flammable = 3, attached_node = 1},
1084 sounds = default.node_sound_leaves_defaults(),
1087 fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 4 / 16, 5 / 16},
1091 minetest.register_node("default:junglegrass", {
1092 description = "Jungle Grass",
1093 drawtype = "plantlike",
1095 visual_scale = 1.69,
1096 tiles = {"default_junglegrass.png"},
1097 inventory_image = "default_junglegrass.png",
1098 wield_image = "default_junglegrass.png",
1099 paramtype = "light",
1100 sunlight_propagates = true,
1102 buildable_to = true,
1103 groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1, flammable = 1},
1104 sounds = default.node_sound_leaves_defaults(),
1107 fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 1.19, 7 / 16},
1112 minetest.register_node("default:grass_1", {
1113 description = "Grass",
1114 drawtype = "plantlike",
1116 tiles = {"default_grass_1.png"},
1117 -- Use texture of a taller grass stage in inventory
1118 inventory_image = "default_grass_3.png",
1119 wield_image = "default_grass_3.png",
1120 paramtype = "light",
1121 sunlight_propagates = true,
1123 buildable_to = true,
1124 groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1, flammable = 1},
1125 sounds = default.node_sound_leaves_defaults(),
1128 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -5 / 16, 6 / 16},
1131 on_place = function(itemstack, placer, pointed_thing)
1132 -- place a random grass node
1133 local stack = ItemStack("default:grass_" .. math.random(1,5))
1134 local ret = minetest.item_place(stack, placer, pointed_thing)
1135 return ItemStack("default:grass_1 " ..
1136 itemstack:get_count() - (1 - ret:get_count()))
1141 minetest.register_node("default:grass_" .. i, {
1142 description = "Grass",
1143 drawtype = "plantlike",
1145 tiles = {"default_grass_" .. i .. ".png"},
1146 inventory_image = "default_grass_" .. i .. ".png",
1147 wield_image = "default_grass_" .. i .. ".png",
1148 paramtype = "light",
1149 sunlight_propagates = true,
1151 buildable_to = true,
1152 drop = "default:grass_1",
1153 groups = {snappy = 3, flora = 1, attached_node = 1,
1154 not_in_creative_inventory = 1, grass = 1, flammable = 1},
1155 sounds = default.node_sound_leaves_defaults(),
1158 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -3 / 16, 6 / 16},
1164 minetest.register_node("default:dry_grass_1", {
1165 description = "Dry Grass",
1166 drawtype = "plantlike",
1168 tiles = {"default_dry_grass_1.png"},
1169 inventory_image = "default_dry_grass_3.png",
1170 wield_image = "default_dry_grass_3.png",
1171 paramtype = "light",
1172 sunlight_propagates = true,
1174 buildable_to = true,
1175 groups = {snappy = 3, flammable = 3, flora = 1,
1176 attached_node = 1, dry_grass = 1},
1177 sounds = default.node_sound_leaves_defaults(),
1180 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -3 / 16, 6 / 16},
1183 on_place = function(itemstack, placer, pointed_thing)
1184 -- place a random dry grass node
1185 local stack = ItemStack("default:dry_grass_" .. math.random(1, 5))
1186 local ret = minetest.item_place(stack, placer, pointed_thing)
1187 return ItemStack("default:dry_grass_1 " ..
1188 itemstack:get_count() - (1 - ret:get_count()))
1193 minetest.register_node("default:dry_grass_" .. i, {
1194 description = "Dry Grass",
1195 drawtype = "plantlike",
1197 tiles = {"default_dry_grass_" .. i .. ".png"},
1198 inventory_image = "default_dry_grass_" .. i .. ".png",
1199 wield_image = "default_dry_grass_" .. i .. ".png",
1200 paramtype = "light",
1201 sunlight_propagates = true,
1203 buildable_to = true,
1204 groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1,
1205 not_in_creative_inventory=1, dry_grass = 1},
1206 drop = "default:dry_grass_1",
1207 sounds = default.node_sound_leaves_defaults(),
1210 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -1 / 16, 6 / 16},
1216 minetest.register_node("default:bush_stem", {
1217 description = "Bush Stem",
1218 drawtype = "plantlike",
1219 visual_scale = 1.41,
1220 tiles = {"default_bush_stem.png"},
1221 inventory_image = "default_bush_stem.png",
1222 wield_image = "default_bush_stem.png",
1223 paramtype = "light",
1224 sunlight_propagates = true,
1225 groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
1226 sounds = default.node_sound_wood_defaults(),
1229 fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.54, 7 / 16},
1233 minetest.register_node("default:bush_leaves", {
1234 description = "Bush Leaves",
1235 drawtype = "allfaces_optional",
1237 tiles = {"default_leaves_simple.png"},
1238 paramtype = "light",
1239 groups = {snappy = 3, flammable = 2, leaves = 1},
1240 sounds = default.node_sound_leaves_defaults(),
1243 minetest.register_node("default:acacia_bush_stem", {
1244 description = "Acacia Bush Stem",
1245 drawtype = "plantlike",
1246 visual_scale = 1.41,
1247 tiles = {"default_acacia_bush_stem.png"},
1248 inventory_image = "default_acacia_bush_stem.png",
1249 wield_image = "default_acacia_bush_stem.png",
1250 paramtype = "light",
1251 sunlight_propagates = true,
1252 groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
1253 sounds = default.node_sound_wood_defaults(),
1256 fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.54, 7 / 16},
1260 minetest.register_node("default:acacia_bush_leaves", {
1261 description = "Acacia Bush Leaves",
1262 drawtype = "allfaces_optional",
1264 tiles = {"default_acacia_leaves_simple.png"},
1265 paramtype = "light",
1266 groups = {snappy = 3, flammable = 2, leaves = 1},
1267 sounds = default.node_sound_leaves_defaults(),
1275 minetest.register_node("default:coral_brown", {
1276 description = "Brown Coral",
1277 tiles = {"default_coral_brown.png"},
1278 groups = {cracky = 3},
1279 drop = "default:coral_skeleton",
1280 sounds = default.node_sound_stone_defaults(),
1283 minetest.register_node("default:coral_orange", {
1284 description = "Orange Coral",
1285 tiles = {"default_coral_orange.png"},
1286 groups = {cracky = 3},
1287 drop = "default:coral_skeleton",
1288 sounds = default.node_sound_stone_defaults(),
1291 minetest.register_node("default:coral_skeleton", {
1292 description = "Coral Skeleton",
1293 tiles = {"default_coral_skeleton.png"},
1294 groups = {cracky = 3},
1295 sounds = default.node_sound_stone_defaults(),
1303 minetest.register_node("default:water_source", {
1304 description = "Water Source",
1305 drawtype = "liquid",
1308 name = "default_water_source_animated.png",
1310 type = "vertical_frames",
1318 -- New-style water source material (mostly unused)
1320 name = "default_water_source_animated.png",
1322 type = "vertical_frames",
1327 backface_culling = false,
1331 paramtype = "light",
1335 buildable_to = true,
1336 is_ground_content = false,
1339 liquidtype = "source",
1340 liquid_alternative_flowing = "default:water_flowing",
1341 liquid_alternative_source = "default:water_source",
1342 liquid_viscosity = 1,
1343 post_effect_color = {a = 103, r = 30, g = 60, b = 90},
1344 groups = {water = 3, liquid = 3, puts_out_fire = 1, cools_lava = 1},
1345 sounds = default.node_sound_water_defaults(),
1348 minetest.register_node("default:water_flowing", {
1349 description = "Flowing Water",
1350 drawtype = "flowingliquid",
1351 tiles = {"default_water.png"},
1354 name = "default_water_flowing_animated.png",
1355 backface_culling = false,
1357 type = "vertical_frames",
1364 name = "default_water_flowing_animated.png",
1365 backface_culling = true,
1367 type = "vertical_frames",
1375 paramtype = "light",
1376 paramtype2 = "flowingliquid",
1380 buildable_to = true,
1381 is_ground_content = false,
1384 liquidtype = "flowing",
1385 liquid_alternative_flowing = "default:water_flowing",
1386 liquid_alternative_source = "default:water_source",
1387 liquid_viscosity = 1,
1388 post_effect_color = {a = 103, r = 30, g = 60, b = 90},
1389 groups = {water = 3, liquid = 3, puts_out_fire = 1,
1390 not_in_creative_inventory = 1, cools_lava = 1},
1391 sounds = default.node_sound_water_defaults(),
1395 minetest.register_node("default:river_water_source", {
1396 description = "River Water Source",
1397 drawtype = "liquid",
1400 name = "default_river_water_source_animated.png",
1402 type = "vertical_frames",
1411 name = "default_river_water_source_animated.png",
1413 type = "vertical_frames",
1418 backface_culling = false,
1422 paramtype = "light",
1426 buildable_to = true,
1427 is_ground_content = false,
1430 liquidtype = "source",
1431 liquid_alternative_flowing = "default:river_water_flowing",
1432 liquid_alternative_source = "default:river_water_source",
1433 liquid_viscosity = 1,
1434 liquid_renewable = false,
1436 post_effect_color = {a = 103, r = 30, g = 76, b = 90},
1437 groups = {water = 3, liquid = 3, puts_out_fire = 1, cools_lava = 1},
1438 sounds = default.node_sound_water_defaults(),
1441 minetest.register_node("default:river_water_flowing", {
1442 description = "Flowing River Water",
1443 drawtype = "flowingliquid",
1444 tiles = {"default_river_water.png"},
1447 name = "default_river_water_flowing_animated.png",
1448 backface_culling = false,
1450 type = "vertical_frames",
1457 name = "default_river_water_flowing_animated.png",
1458 backface_culling = true,
1460 type = "vertical_frames",
1468 paramtype = "light",
1469 paramtype2 = "flowingliquid",
1473 buildable_to = true,
1474 is_ground_content = false,
1477 liquidtype = "flowing",
1478 liquid_alternative_flowing = "default:river_water_flowing",
1479 liquid_alternative_source = "default:river_water_source",
1480 liquid_viscosity = 1,
1481 liquid_renewable = false,
1483 post_effect_color = {a = 103, r = 30, g = 76, b = 90},
1484 groups = {water = 3, liquid = 3, puts_out_fire = 1,
1485 not_in_creative_inventory = 1, cools_lava = 1},
1486 sounds = default.node_sound_water_defaults(),
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 local chest_formspec =
1590 default.gui_bg_img ..
1591 default.gui_slots ..
1592 "list[current_name;main;0,0.3;8,4;]" ..
1593 "list[current_player;main;0,4.85;8,1;]" ..
1594 "list[current_player;main;0,6.08;8,3;8]" ..
1595 "listring[current_name;main]" ..
1596 "listring[current_player;main]" ..
1597 default.get_hotbar_bg(0,4.85)
1599 local function get_locked_chest_formspec(pos)
1600 local spos = pos.x .. "," .. pos.y .. "," .. pos.z
1604 default.gui_bg_img ..
1605 default.gui_slots ..
1606 "list[nodemeta:" .. spos .. ";main;0,0.3;8,4;]" ..
1607 "list[current_player;main;0,4.85;8,1;]" ..
1608 "list[current_player;main;0,6.08;8,3;8]" ..
1609 "listring[nodemeta:" .. spos .. ";main]" ..
1610 "listring[current_player;main]" ..
1611 default.get_hotbar_bg(0,4.85)
1615 local function has_locked_chest_privilege(meta, player)
1617 if minetest.check_player_privs(player, "protection_bypass") then
1624 -- is player wielding the right key?
1625 local item = player:get_wielded_item()
1626 if item:get_name() == "default:key" then
1627 local key_meta = minetest.parse_json(item:get_metadata())
1628 local secret = meta:get_string("key_lock_secret")
1629 if secret ~= key_meta.secret then
1636 if player:get_player_name() ~= meta:get_string("owner") then
1643 minetest.register_node("default:chest", {
1644 description = "Chest",
1645 tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
1646 "default_chest_side.png", "default_chest_side.png", "default_chest_front.png"},
1647 paramtype2 = "facedir",
1648 groups = {choppy = 2, oddly_breakable_by_hand = 2},
1649 legacy_facedir_simple = true,
1650 is_ground_content = false,
1651 sounds = default.node_sound_wood_defaults(),
1653 on_construct = function(pos)
1654 local meta = minetest.get_meta(pos)
1655 meta:set_string("formspec", chest_formspec)
1656 local inv = meta:get_inventory()
1657 inv:set_size("main", 8*4)
1659 can_dig = function(pos,player)
1660 local meta = minetest.get_meta(pos);
1661 local inv = meta:get_inventory()
1662 return inv:is_empty("main")
1664 on_metadata_inventory_move = function(pos, from_list, from_index,
1665 to_list, to_index, count, player)
1666 minetest.log("action", player:get_player_name() ..
1667 " moves stuff in chest at " .. minetest.pos_to_string(pos))
1669 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1670 minetest.log("action", player:get_player_name() ..
1671 " moves " .. stack:get_name() ..
1672 " to chest at " .. minetest.pos_to_string(pos))
1674 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1675 minetest.log("action", player:get_player_name() ..
1676 " takes " .. stack:get_name() ..
1677 " from chest at " .. minetest.pos_to_string(pos))
1679 on_blast = function(pos)
1681 default.get_inventory_drops(pos, "main", drops)
1682 drops[#drops+1] = "default:chest"
1683 minetest.remove_node(pos)
1688 minetest.register_node("default:chest_locked", {
1689 description = "Locked Chest",
1690 tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
1691 "default_chest_side.png", "default_chest_side.png", "default_chest_lock.png"},
1692 paramtype2 = "facedir",
1693 groups = {choppy = 2, oddly_breakable_by_hand = 2},
1694 legacy_facedir_simple = true,
1695 is_ground_content = false,
1696 sounds = default.node_sound_wood_defaults(),
1698 after_place_node = function(pos, placer)
1699 local meta = minetest.get_meta(pos)
1700 meta:set_string("owner", placer:get_player_name() or "")
1701 meta:set_string("infotext", "Locked Chest (owned by " ..
1702 meta:get_string("owner") .. ")")
1704 on_construct = function(pos)
1705 local meta = minetest.get_meta(pos)
1706 meta:set_string("owner", "")
1707 local inv = meta:get_inventory()
1708 inv:set_size("main", 8 * 4)
1710 can_dig = function(pos,player)
1711 local meta = minetest.get_meta(pos);
1712 local inv = meta:get_inventory()
1713 return inv:is_empty("main") and has_locked_chest_privilege(meta, player)
1715 allow_metadata_inventory_move = function(pos, from_list, from_index,
1716 to_list, to_index, count, player)
1717 local meta = minetest.get_meta(pos)
1718 if not has_locked_chest_privilege(meta, player) then
1723 allow_metadata_inventory_put = function(pos, listname, index, stack, player)
1724 local meta = minetest.get_meta(pos)
1725 if not has_locked_chest_privilege(meta, player) then
1728 return stack:get_count()
1730 allow_metadata_inventory_take = function(pos, listname, index, stack, player)
1731 local meta = minetest.get_meta(pos)
1732 if not has_locked_chest_privilege(meta, player) then
1735 return stack:get_count()
1737 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1738 minetest.log("action", player:get_player_name() ..
1739 " moves " .. stack:get_name() ..
1740 " to locked chest at " .. minetest.pos_to_string(pos))
1742 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1743 minetest.log("action", player:get_player_name() ..
1744 " takes " .. stack:get_name() ..
1745 " from locked chest at " .. minetest.pos_to_string(pos))
1747 on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
1748 local meta = minetest.get_meta(pos)
1749 if has_locked_chest_privilege(meta, clicker) then
1750 minetest.show_formspec(
1751 clicker:get_player_name(),
1752 "default:chest_locked",
1753 get_locked_chest_formspec(pos)
1758 on_blast = function() end,
1759 on_key_use = function(pos, player)
1760 local secret = minetest.get_meta(pos):get_string("key_lock_secret")
1761 local itemstack = player:get_wielded_item()
1762 local key_meta = minetest.parse_json(itemstack:get_metadata())
1764 if secret ~= key_meta.secret then
1768 minetest.show_formspec(
1769 player:get_player_name(),
1770 "default:chest_locked",
1771 get_locked_chest_formspec(pos)
1774 on_skeleton_key_use = function(pos, player, newsecret)
1775 local meta = minetest.get_meta(pos)
1776 local owner = meta:get_string("owner")
1777 local name = player:get_player_name()
1779 -- verify placer is owner of lockable chest
1780 if owner ~= name then
1781 minetest.record_protection_violation(pos, name)
1782 minetest.chat_send_player(name, "You do not own this chest.")
1786 local secret = meta:get_string("key_lock_secret")
1787 if secret == "" then
1789 meta:set_string("key_lock_secret", secret)
1792 return secret, "a locked chest", owner
1797 local bookshelf_formspec =
1800 default.gui_bg_img ..
1801 default.gui_slots ..
1802 "list[context;books;0,0.3;8,2;]" ..
1803 "list[current_player;main;0,2.85;8,1;]" ..
1804 "list[current_player;main;0,4.08;8,3;8]" ..
1805 "listring[context;books]" ..
1806 "listring[current_player;main]" ..
1807 default.get_hotbar_bg(0,2.85)
1809 local function get_bookshelf_formspec(inv)
1810 local formspec = bookshelf_formspec
1811 local invlist = inv and inv:get_list("books")
1812 -- Inventory slots overlay
1813 local bx, by = 0, 0.3
1819 if not invlist or invlist[i]:is_empty() then
1820 formspec = formspec ..
1821 "image[" .. bx .. "," .. by .. ";1,1;default_bookshelf_slot.png]"
1828 minetest.register_node("default:bookshelf", {
1829 description = "Bookshelf",
1830 tiles = {"default_wood.png", "default_wood.png", "default_wood.png",
1831 "default_wood.png", "default_bookshelf.png", "default_bookshelf.png"},
1832 paramtype2 = "facedir",
1833 is_ground_content = false,
1834 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
1835 sounds = default.node_sound_wood_defaults(),
1837 on_construct = function(pos)
1838 local meta = minetest.get_meta(pos)
1839 meta:set_string("formspec", get_bookshelf_formspec(nil))
1840 local inv = meta:get_inventory()
1841 inv:set_size("books", 8 * 2)
1843 can_dig = function(pos,player)
1844 local inv = minetest.get_meta(pos):get_inventory()
1845 return inv:is_empty("books")
1847 allow_metadata_inventory_put = function(pos, listname, index, stack)
1848 if minetest.get_item_group(stack:get_name(), "book") ~= 0 then
1849 return stack:get_count()
1853 on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
1854 minetest.log("action", player:get_player_name() ..
1855 " moves stuff in bookshelf at " .. minetest.pos_to_string(pos))
1856 local meta = minetest.get_meta(pos)
1857 meta:set_string("formspec", get_bookshelf_formspec(meta:get_inventory()))
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))
1862 local meta = minetest.get_meta(pos)
1863 meta:set_string("formspec", get_bookshelf_formspec(meta:get_inventory()))
1865 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1866 minetest.log("action", player:get_player_name() ..
1867 " takes stuff from bookshelf at " .. minetest.pos_to_string(pos))
1868 local meta = minetest.get_meta(pos)
1869 meta:set_string("formspec", get_bookshelf_formspec(meta:get_inventory()))
1871 on_blast = function(pos)
1873 default.get_inventory_drops(pos, "books", drops)
1874 drops[#drops+1] = "default:bookshelf"
1875 minetest.remove_node(pos)
1880 local function register_sign(material, desc, def)
1881 minetest.register_node("default:sign_wall_" .. material, {
1882 description = desc .. " Sign",
1883 drawtype = "nodebox",
1884 tiles = {"default_sign_wall_" .. material .. ".png"},
1885 inventory_image = "default_sign_" .. material .. ".png",
1886 wield_image = "default_sign_" .. material .. ".png",
1887 paramtype = "light",
1888 paramtype2 = "wallmounted",
1889 sunlight_propagates = true,
1890 is_ground_content = false,
1893 type = "wallmounted",
1894 wall_top = {-0.4375, 0.4375, -0.3125, 0.4375, 0.5, 0.3125},
1895 wall_bottom = {-0.4375, -0.5, -0.3125, 0.4375, -0.4375, 0.3125},
1896 wall_side = {-0.5, -0.3125, -0.4375, -0.4375, 0.3125, 0.4375},
1898 groups = def.groups,
1899 legacy_wallmounted = true,
1900 sounds = def.sounds,
1902 on_construct = function(pos)
1903 --local n = minetest.get_node(pos)
1904 local meta = minetest.get_meta(pos)
1905 meta:set_string("formspec", "field[text;;${text}]")
1907 on_receive_fields = function(pos, formname, fields, sender)
1908 --print("Sign at "..minetest.pos_to_string(pos).." got "..dump(fields))
1909 local player_name = sender:get_player_name()
1910 if minetest.is_protected(pos, player_name) then
1911 minetest.record_protection_violation(pos, player_name)
1914 local meta = minetest.get_meta(pos)
1915 if not fields.text then return end
1916 minetest.log("action", (player_name or "") .. " wrote \"" ..
1917 fields.text .. "\" to sign at " .. minetest.pos_to_string(pos))
1918 meta:set_string("text", fields.text)
1919 meta:set_string("infotext", '"' .. fields.text .. '"')
1924 register_sign("wood", "Wooden", {
1925 sounds = default.node_sound_wood_defaults(),
1926 groups = {choppy = 2, attached_node = 1, flammable = 2, oddly_breakable_by_hand = 3}
1929 register_sign("steel", "Steel", {
1930 sounds = default.node_sound_metal_defaults(),
1931 groups = {cracky = 2, attached_node = 1}
1934 minetest.register_node("default:ladder_wood", {
1935 description = "Wooden Ladder",
1936 drawtype = "signlike",
1937 tiles = {"default_ladder_wood.png"},
1938 inventory_image = "default_ladder_wood.png",
1939 wield_image = "default_ladder_wood.png",
1940 paramtype = "light",
1941 paramtype2 = "wallmounted",
1942 sunlight_propagates = true,
1945 is_ground_content = false,
1947 type = "wallmounted",
1948 --wall_top = = <default>
1949 --wall_bottom = = <default>
1950 --wall_side = = <default>
1952 groups = {choppy = 2, oddly_breakable_by_hand = 3, flammable = 2},
1953 legacy_wallmounted = true,
1954 sounds = default.node_sound_wood_defaults(),
1957 minetest.register_node("default:ladder_steel", {
1958 description = "Steel Ladder",
1959 drawtype = "signlike",
1960 tiles = {"default_ladder_steel.png"},
1961 inventory_image = "default_ladder_steel.png",
1962 wield_image = "default_ladder_steel.png",
1963 paramtype = "light",
1964 paramtype2 = "wallmounted",
1965 sunlight_propagates = true,
1968 is_ground_content = false,
1970 type = "wallmounted",
1971 --wall_top = = <default>
1972 --wall_bottom = = <default>
1973 --wall_side = = <default>
1975 groups = {cracky = 2},
1976 sounds = default.node_sound_metal_defaults(),
1979 default.register_fence("default:fence_wood", {
1980 description = "Wooden Fence",
1981 texture = "default_fence_wood.png",
1982 inventory_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1983 wield_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1984 material = "default: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_acacia_wood", {
1990 description = "Acacia Fence",
1991 texture = "default_fence_acacia_wood.png",
1992 inventory_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1993 wield_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1994 material = "default:acacia_wood",
1995 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
1996 sounds = default.node_sound_wood_defaults()
1999 default.register_fence("default:fence_junglewood", {
2000 description = "Junglewood Fence",
2001 texture = "default_fence_junglewood.png",
2002 inventory_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126",
2003 wield_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126",
2004 material = "default:junglewood",
2005 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
2006 sounds = default.node_sound_wood_defaults()
2009 default.register_fence("default:fence_pine_wood", {
2010 description = "Pine Fence",
2011 texture = "default_fence_pine_wood.png",
2012 inventory_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2013 wield_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2014 material = "default:pine_wood",
2015 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
2016 sounds = default.node_sound_wood_defaults()
2019 default.register_fence("default:fence_aspen_wood", {
2020 description = "Aspen Fence",
2021 texture = "default_fence_aspen_wood.png",
2022 inventory_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2023 wield_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2024 material = "default:aspen_wood",
2025 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
2026 sounds = default.node_sound_wood_defaults()
2029 minetest.register_node("default:glass", {
2030 description = "Glass",
2031 drawtype = "glasslike_framed_optional",
2032 tiles = {"default_glass.png", "default_glass_detail.png"},
2033 paramtype = "light",
2034 sunlight_propagates = true,
2035 is_ground_content = false,
2036 groups = {cracky = 3, oddly_breakable_by_hand = 3},
2037 sounds = default.node_sound_glass_defaults(),
2040 minetest.register_node("default:obsidian_glass", {
2041 description = "Obsidian Glass",
2042 drawtype = "glasslike_framed_optional",
2043 tiles = {"default_obsidian_glass.png", "default_obsidian_glass_detail.png"},
2044 paramtype = "light",
2045 is_ground_content = false,
2046 sunlight_propagates = true,
2047 sounds = default.node_sound_glass_defaults(),
2048 groups = {cracky = 3},
2052 minetest.register_node("default:brick", {
2053 description = "Brick Block",
2054 paramtype2 = "facedir",
2056 tiles = {"default_brick.png"},
2057 is_ground_content = false,
2058 groups = {cracky = 3},
2059 sounds = default.node_sound_stone_defaults(),
2063 minetest.register_node("default:meselamp", {
2064 description = "Mese Lamp",
2065 drawtype = "glasslike",
2066 tiles = {"default_meselamp.png"},
2067 paramtype = "light",
2068 sunlight_propagates = true,
2069 is_ground_content = false,
2070 groups = {cracky = 3, oddly_breakable_by_hand = 3},
2071 sounds = default.node_sound_glass_defaults(),
2072 light_source = default.LIGHT_MAX,
2075 minetest.register_node("default:mese_post_light", {
2076 description = "Mese Post Light",
2077 tiles = {"default_mese_post_light_top.png", "default_mese_post_light_top.png",
2078 "default_mese_post_light_side_dark.png", "default_mese_post_light_side_dark.png",
2079 "default_mese_post_light_side.png", "default_mese_post_light_side.png"},
2080 wield_image = "default_mese_post_light_side.png",
2081 drawtype = "nodebox",
2085 {-2 / 16, -8 / 16, -2 / 16, 2 / 16, 8 / 16, 2 / 16},
2088 paramtype = "light",
2089 light_source = default.LIGHT_MAX,
2090 sunlight_propagates = true,
2091 is_ground_content = false,
2092 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
2093 sounds = default.node_sound_wood_defaults(),
2100 minetest.register_node("default:cloud", {
2101 description = "Cloud",
2102 tiles = {"default_cloud.png"},
2103 is_ground_content = false,
2104 sounds = default.node_sound_defaults(),
2105 groups = {not_in_creative_inventory = 1},