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
47 default:dirt_with_rainforest_litter
64 (1. Trunk 2. Fabricated trunk 3. Leaves 4. Sapling 5. Fruits)
85 default:acacia_sapling
94 (1. In stone 2. Blocks)
96 default:stone_with_coal
99 default:stone_with_iron
102 default:stone_with_copper
106 default:stone_with_gold
109 default:stone_with_mese
112 default:stone_with_diamond
137 default:acacia_bush_stem
138 default:acacia_bush_leaves
145 default:coral_skeleton
149 (1. Source 2. Flowing)
152 default:water_flowing
154 default:river_water_source
155 default:river_water_flowing
160 Tools / "Advanced" crafting / Non-"natural"
161 -------------------------------------------
168 default:sign_wall_wood
169 default:sign_wall_steel
175 default:fence_acacia_wood
176 default:fence_junglewood
177 default:fence_pine_wood
178 default:fence_aspen_wood
181 default:obsidian_glass
186 default:mese_post_light
199 minetest.register_node("default:stone", {
200 description = "Stone",
201 tiles = {"default_stone.png"},
202 groups = {cracky = 3, stone = 1},
203 drop = 'default:cobble',
204 legacy_mineral = true,
205 sounds = default.node_sound_stone_defaults(),
208 minetest.register_node("default:cobble", {
209 description = "Cobblestone",
210 tiles = {"default_cobble.png"},
211 is_ground_content = false,
212 groups = {cracky = 3, stone = 2},
213 sounds = default.node_sound_stone_defaults(),
216 minetest.register_node("default:stonebrick", {
217 description = "Stone Brick",
218 paramtype2 = "facedir",
220 tiles = {"default_stone_brick.png"},
221 is_ground_content = false,
222 groups = {cracky = 2, stone = 1},
223 sounds = default.node_sound_stone_defaults(),
226 minetest.register_node("default:stone_block", {
227 description = "Stone Block",
228 tiles = {"default_stone_block.png"},
229 is_ground_content = false,
230 groups = {cracky = 2, stone = 1},
231 sounds = default.node_sound_stone_defaults(),
234 minetest.register_node("default:mossycobble", {
235 description = "Mossy Cobblestone",
236 tiles = {"default_mossycobble.png"},
237 is_ground_content = false,
238 groups = {cracky = 3, stone = 1},
239 sounds = default.node_sound_stone_defaults(),
243 minetest.register_node("default:desert_stone", {
244 description = "Desert Stone",
245 tiles = {"default_desert_stone.png"},
246 groups = {cracky = 3, stone = 1},
247 drop = 'default:desert_cobble',
248 legacy_mineral = true,
249 sounds = default.node_sound_stone_defaults(),
252 minetest.register_node("default:desert_cobble", {
253 description = "Desert Cobblestone",
254 tiles = {"default_desert_cobble.png"},
255 is_ground_content = false,
256 groups = {cracky = 3, stone = 2},
257 sounds = default.node_sound_stone_defaults(),
260 minetest.register_node("default:desert_stonebrick", {
261 description = "Desert Stone Brick",
262 paramtype2 = "facedir",
264 tiles = {"default_desert_stone_brick.png"},
265 is_ground_content = false,
266 groups = {cracky = 2, stone = 1},
267 sounds = default.node_sound_stone_defaults(),
270 minetest.register_node("default:desert_stone_block", {
271 description = "Desert Stone Block",
272 tiles = {"default_desert_stone_block.png"},
273 is_ground_content = false,
274 groups = {cracky = 2, stone = 1},
275 sounds = default.node_sound_stone_defaults(),
279 minetest.register_node("default:sandstone", {
280 description = "Sandstone",
281 tiles = {"default_sandstone.png"},
282 groups = {crumbly = 1, cracky = 3},
283 sounds = default.node_sound_stone_defaults(),
286 minetest.register_node("default:sandstonebrick", {
287 description = "Sandstone Brick",
288 paramtype2 = "facedir",
290 tiles = {"default_sandstone_brick.png"},
291 is_ground_content = false,
292 groups = {cracky = 2},
293 sounds = default.node_sound_stone_defaults(),
296 minetest.register_node("default:sandstone_block", {
297 description = "Sandstone Block",
298 tiles = {"default_sandstone_block.png"},
299 is_ground_content = false,
300 groups = {cracky = 2},
301 sounds = default.node_sound_stone_defaults(),
305 minetest.register_node("default:obsidian", {
306 description = "Obsidian",
307 tiles = {"default_obsidian.png"},
308 sounds = default.node_sound_stone_defaults(),
309 groups = {cracky = 1, level = 2},
312 minetest.register_node("default:obsidianbrick", {
313 description = "Obsidian Brick",
314 paramtype2 = "facedir",
316 tiles = {"default_obsidian_brick.png"},
317 is_ground_content = false,
318 sounds = default.node_sound_stone_defaults(),
319 groups = {cracky = 1, level = 2},
322 minetest.register_node("default:obsidian_block", {
323 description = "Obsidian Block",
324 tiles = {"default_obsidian_block.png"},
325 is_ground_content = false,
326 sounds = default.node_sound_stone_defaults(),
327 groups = {cracky = 1, level = 2},
334 minetest.register_node("default:dirt", {
335 description = "Dirt",
336 tiles = {"default_dirt.png"},
337 groups = {crumbly = 3, soil = 1},
338 sounds = default.node_sound_dirt_defaults(),
341 minetest.register_node("default:dirt_with_grass", {
342 description = "Dirt with Grass",
343 tiles = {"default_grass.png", "default_dirt.png",
344 {name = "default_dirt.png^default_grass_side.png",
345 tileable_vertical = false}},
346 groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
347 drop = 'default:dirt',
348 sounds = default.node_sound_dirt_defaults({
349 footstep = {name = "default_grass_footstep", gain = 0.25},
353 minetest.register_node("default:dirt_with_grass_footsteps", {
354 description = "Dirt with Grass and Footsteps",
355 tiles = {"default_grass.png^default_footprint.png", "default_dirt.png",
356 {name = "default_dirt.png^default_grass_side.png",
357 tileable_vertical = false}},
358 groups = {crumbly = 3, soil = 1, not_in_creative_inventory = 1},
359 drop = 'default:dirt',
360 sounds = default.node_sound_dirt_defaults({
361 footstep = {name = "default_grass_footstep", gain = 0.25},
365 minetest.register_node("default:dirt_with_dry_grass", {
366 description = "Dirt with Dry Grass",
367 tiles = {"default_dry_grass.png",
369 {name = "default_dirt.png^default_dry_grass_side.png",
370 tileable_vertical = false}},
371 groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
372 drop = 'default:dirt',
373 sounds = default.node_sound_dirt_defaults({
374 footstep = {name = "default_grass_footstep", gain = 0.4},
378 minetest.register_node("default:dirt_with_snow", {
379 description = "Dirt with Snow",
380 tiles = {"default_snow.png", "default_dirt.png",
381 {name = "default_dirt.png^default_snow_side.png",
382 tileable_vertical = false}},
383 groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1, snowy = 1},
384 drop = 'default:dirt',
385 sounds = default.node_sound_dirt_defaults({
386 footstep = {name = "default_snow_footstep", gain = 0.15},
390 minetest.register_node("default:dirt_with_rainforest_litter", {
391 description = "Dirt with Rainforest Litter",
393 "default_rainforest_litter.png",
395 {name = "default_dirt.png^default_rainforest_litter_side.png",
396 tileable_vertical = false}
398 groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
399 drop = "default:dirt",
400 sounds = default.node_sound_dirt_defaults({
401 footstep = {name = "default_grass_footstep", gain = 0.4},
405 minetest.register_node("default:sand", {
406 description = "Sand",
407 tiles = {"default_sand.png"},
408 groups = {crumbly = 3, falling_node = 1, sand = 1},
409 sounds = default.node_sound_sand_defaults(),
412 minetest.register_node("default:desert_sand", {
413 description = "Desert Sand",
414 tiles = {"default_desert_sand.png"},
415 groups = {crumbly = 3, falling_node = 1, sand = 1},
416 sounds = default.node_sound_sand_defaults(),
419 minetest.register_node("default:silver_sand", {
420 description = "Silver Sand",
421 tiles = {"default_silver_sand.png"},
422 groups = {crumbly = 3, falling_node = 1, sand = 1},
423 sounds = default.node_sound_sand_defaults(),
427 minetest.register_node("default:gravel", {
428 description = "Gravel",
429 tiles = {"default_gravel.png"},
430 groups = {crumbly = 2, falling_node = 1},
431 sounds = default.node_sound_gravel_defaults(),
435 {items = {'default:flint'}, rarity = 16},
436 {items = {'default:gravel'}}
441 minetest.register_node("default:clay", {
442 description = "Clay",
443 tiles = {"default_clay.png"},
444 groups = {crumbly = 3},
445 drop = 'default:clay_lump 4',
446 sounds = default.node_sound_dirt_defaults(),
450 minetest.register_node("default:snow", {
451 description = "Snow",
452 tiles = {"default_snow.png"},
453 inventory_image = "default_snowball.png",
454 wield_image = "default_snowball.png",
458 drawtype = "nodebox",
462 {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
465 groups = {crumbly = 3, falling_node = 1, puts_out_fire = 1, snowy = 1},
466 sounds = default.node_sound_dirt_defaults({
467 footstep = {name = "default_snow_footstep", gain = 0.15},
468 dug = {name = "default_snow_footstep", gain = 0.2},
469 dig = {name = "default_snow_footstep", gain = 0.2}
472 on_construct = function(pos)
474 if minetest.get_node(pos).name == "default:dirt_with_grass" then
475 minetest.set_node(pos, {name = "default:dirt_with_snow"})
480 minetest.register_node("default:snowblock", {
481 description = "Snow Block",
482 tiles = {"default_snow.png"},
483 groups = {crumbly = 3, puts_out_fire = 1, cools_lava = 1, snowy = 1},
484 sounds = default.node_sound_dirt_defaults({
485 footstep = {name = "default_snow_footstep", gain = 0.15},
486 dug = {name = "default_snow_footstep", gain = 0.2},
487 dig = {name = "default_snow_footstep", gain = 0.2}
490 on_construct = function(pos)
492 if minetest.get_node(pos).name == "default:dirt_with_grass" then
493 minetest.set_node(pos, {name = "default:dirt_with_snow"})
498 minetest.register_node("default:ice", {
500 tiles = {"default_ice.png"},
501 is_ground_content = false,
503 groups = {cracky = 3, puts_out_fire = 1, cools_lava = 1},
504 sounds = default.node_sound_glass_defaults(),
511 minetest.register_node("default:tree", {
512 description = "Tree",
513 tiles = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"},
514 paramtype2 = "facedir",
515 is_ground_content = false,
516 groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
517 sounds = default.node_sound_wood_defaults(),
519 on_place = minetest.rotate_node
522 minetest.register_node("default:wood", {
523 description = "Wooden Planks",
524 paramtype2 = "facedir",
526 tiles = {"default_wood.png"},
527 is_ground_content = false,
528 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
529 sounds = default.node_sound_wood_defaults(),
532 minetest.register_node("default:sapling", {
533 description = "Sapling",
534 drawtype = "plantlike",
535 tiles = {"default_sapling.png"},
536 inventory_image = "default_sapling.png",
537 wield_image = "default_sapling.png",
539 sunlight_propagates = true,
541 on_timer = default.grow_sapling,
544 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
546 groups = {snappy = 2, dig_immediate = 3, flammable = 2,
547 attached_node = 1, sapling = 1},
548 sounds = default.node_sound_leaves_defaults(),
550 on_construct = function(pos)
551 minetest.get_node_timer(pos):start(math.random(2400,4800))
554 on_place = function(itemstack, placer, pointed_thing)
555 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
557 -- minp, maxp to be checked, relative to sapling pos
558 -- minp_relative.y = 1 because sapling pos has been checked
559 {x = -2, y = 1, z = -2},
560 {x = 2, y = 6, z = 2},
561 -- maximum interval of interior volume check
568 minetest.register_node("default:leaves", {
569 description = "Leaves",
570 drawtype = "allfaces_optional",
572 tiles = {"default_leaves.png"},
573 special_tiles = {"default_leaves_simple.png"},
575 is_ground_content = false,
576 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
581 -- player will get sapling with 1/20 chance
582 items = {'default:sapling'},
586 -- player will get leaves only if he get no saplings,
587 -- this is because max_items is 1
588 items = {'default:leaves'},
592 sounds = default.node_sound_leaves_defaults(),
594 after_place_node = default.after_place_leaves,
597 minetest.register_node("default:apple", {
598 description = "Apple",
599 drawtype = "plantlike",
600 tiles = {"default_apple.png"},
601 inventory_image = "default_apple.png",
603 sunlight_propagates = true,
605 is_ground_content = false,
608 fixed = {-3 / 16, -7 / 16, -3 / 16, 3 / 16, 4 / 16, 3 / 16}
610 groups = {fleshy = 3, dig_immediate = 3, flammable = 2,
611 leafdecay = 3, leafdecay_drop = 1},
612 on_use = minetest.item_eat(2),
613 sounds = default.node_sound_leaves_defaults(),
615 after_place_node = function(pos, placer, itemstack)
616 if placer:is_player() then
617 minetest.set_node(pos, {name = "default:apple", param2 = 1})
623 minetest.register_node("default:jungletree", {
624 description = "Jungle Tree",
625 tiles = {"default_jungletree_top.png", "default_jungletree_top.png",
626 "default_jungletree.png"},
627 paramtype2 = "facedir",
628 is_ground_content = false,
629 groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
630 sounds = default.node_sound_wood_defaults(),
632 on_place = minetest.rotate_node
635 minetest.register_node("default:junglewood", {
636 description = "Junglewood Planks",
637 paramtype2 = "facedir",
639 tiles = {"default_junglewood.png"},
640 is_ground_content = false,
641 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
642 sounds = default.node_sound_wood_defaults(),
645 minetest.register_node("default:jungleleaves", {
646 description = "Jungle Leaves",
647 drawtype = "allfaces_optional",
649 tiles = {"default_jungleleaves.png"},
650 special_tiles = {"default_jungleleaves_simple.png"},
652 is_ground_content = false,
653 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
657 {items = {'default:junglesapling'}, rarity = 20},
658 {items = {'default:jungleleaves'}}
661 sounds = default.node_sound_leaves_defaults(),
663 after_place_node = default.after_place_leaves,
666 minetest.register_node("default:junglesapling", {
667 description = "Jungle Sapling",
668 drawtype = "plantlike",
669 tiles = {"default_junglesapling.png"},
670 inventory_image = "default_junglesapling.png",
671 wield_image = "default_junglesapling.png",
673 sunlight_propagates = true,
675 on_timer = default.grow_sapling,
678 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
680 groups = {snappy = 2, dig_immediate = 3, flammable = 2,
681 attached_node = 1, sapling = 1},
682 sounds = default.node_sound_leaves_defaults(),
684 on_construct = function(pos)
685 minetest.get_node_timer(pos):start(math.random(2400,4800))
688 on_place = function(itemstack, placer, pointed_thing)
689 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
690 "default:junglesapling",
691 -- minp, maxp to be checked, relative to sapling pos
692 -- minp_relative.y = 1 because sapling pos has been checked
693 {x = -2, y = 1, z = -2},
694 {x = 2, y = 15, z = 2},
695 -- maximum interval of interior volume check
703 minetest.register_node("default:pine_tree", {
704 description = "Pine Tree",
705 tiles = {"default_pine_tree_top.png", "default_pine_tree_top.png",
706 "default_pine_tree.png"},
707 paramtype2 = "facedir",
708 is_ground_content = false,
709 groups = {tree = 1, choppy = 3, oddly_breakable_by_hand = 1, flammable = 3},
710 sounds = default.node_sound_wood_defaults(),
712 on_place = minetest.rotate_node
715 minetest.register_node("default:pine_wood", {
716 description = "Pine Wood Planks",
717 paramtype2 = "facedir",
719 tiles = {"default_pine_wood.png"},
720 is_ground_content = false,
721 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
722 sounds = default.node_sound_wood_defaults(),
725 minetest.register_node("default:pine_needles",{
726 description = "Pine Needles",
727 drawtype = "allfaces_optional",
728 tiles = {"default_pine_needles.png"},
731 is_ground_content = false,
732 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
736 {items = {"default:pine_sapling"}, rarity = 20},
737 {items = {"default:pine_needles"}}
740 sounds = default.node_sound_leaves_defaults(),
742 after_place_node = default.after_place_leaves,
745 minetest.register_node("default:pine_sapling", {
746 description = "Pine Sapling",
747 drawtype = "plantlike",
748 tiles = {"default_pine_sapling.png"},
749 inventory_image = "default_pine_sapling.png",
750 wield_image = "default_pine_sapling.png",
752 sunlight_propagates = true,
754 on_timer = default.grow_sapling,
757 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
759 groups = {snappy = 2, dig_immediate = 3, flammable = 3,
760 attached_node = 1, sapling = 1},
761 sounds = default.node_sound_leaves_defaults(),
763 on_construct = function(pos)
764 minetest.get_node_timer(pos):start(math.random(2400,4800))
767 on_place = function(itemstack, placer, pointed_thing)
768 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
769 "default:pine_sapling",
770 -- minp, maxp to be checked, relative to sapling pos
771 -- minp_relative.y = 1 because sapling pos has been checked
772 {x = -2, y = 1, z = -2},
773 {x = 2, y = 12, z = 2},
774 -- maximum interval of interior volume check
782 minetest.register_node("default:acacia_tree", {
783 description = "Acacia Tree",
784 tiles = {"default_acacia_tree_top.png", "default_acacia_tree_top.png",
785 "default_acacia_tree.png"},
786 paramtype2 = "facedir",
787 is_ground_content = false,
788 groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
789 sounds = default.node_sound_wood_defaults(),
791 on_place = minetest.rotate_node
794 minetest.register_node("default:acacia_wood", {
795 description = "Acacia Wood Planks",
796 paramtype2 = "facedir",
798 tiles = {"default_acacia_wood.png"},
799 is_ground_content = false,
800 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
801 sounds = default.node_sound_wood_defaults(),
804 minetest.register_node("default:acacia_leaves", {
805 description = "Acacia Leaves",
806 drawtype = "allfaces_optional",
807 tiles = {"default_acacia_leaves.png"},
808 special_tiles = {"default_acacia_leaves_simple.png"},
811 is_ground_content = false,
812 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
816 {items = {"default:acacia_sapling"}, rarity = 20},
817 {items = {"default:acacia_leaves"}}
820 sounds = default.node_sound_leaves_defaults(),
822 after_place_node = default.after_place_leaves,
825 minetest.register_node("default:acacia_sapling", {
826 description = "Acacia Tree Sapling",
827 drawtype = "plantlike",
828 tiles = {"default_acacia_sapling.png"},
829 inventory_image = "default_acacia_sapling.png",
830 wield_image = "default_acacia_sapling.png",
832 sunlight_propagates = true,
834 on_timer = default.grow_sapling,
837 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
839 groups = {snappy = 2, dig_immediate = 3, flammable = 2,
840 attached_node = 1, sapling = 1},
841 sounds = default.node_sound_leaves_defaults(),
843 on_construct = function(pos)
844 minetest.get_node_timer(pos):start(math.random(2400,4800))
847 on_place = function(itemstack, placer, pointed_thing)
848 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
849 "default:acacia_sapling",
850 -- minp, maxp to be checked, relative to sapling pos
851 -- minp_relative.y = 1 because sapling pos has been checked
852 {x = -4, y = 1, z = -4},
853 {x = 4, y = 6, z = 4},
854 -- maximum interval of interior volume check
861 minetest.register_node("default:aspen_tree", {
862 description = "Aspen Tree",
863 tiles = {"default_aspen_tree_top.png", "default_aspen_tree_top.png",
864 "default_aspen_tree.png"},
865 paramtype2 = "facedir",
866 is_ground_content = false,
867 groups = {tree = 1, choppy = 3, oddly_breakable_by_hand = 1, flammable = 3},
868 sounds = default.node_sound_wood_defaults(),
870 on_place = minetest.rotate_node
873 minetest.register_node("default:aspen_wood", {
874 description = "Aspen Wood Planks",
875 paramtype2 = "facedir",
877 tiles = {"default_aspen_wood.png"},
878 is_ground_content = false,
879 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
880 sounds = default.node_sound_wood_defaults(),
883 minetest.register_node("default:aspen_leaves", {
884 description = "Aspen Leaves",
885 drawtype = "allfaces_optional",
886 tiles = {"default_aspen_leaves.png"},
889 is_ground_content = false,
890 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
894 {items = {"default:aspen_sapling"}, rarity = 20},
895 {items = {"default:aspen_leaves"}}
898 sounds = default.node_sound_leaves_defaults(),
900 after_place_node = default.after_place_leaves,
903 minetest.register_node("default:aspen_sapling", {
904 description = "Aspen Tree Sapling",
905 drawtype = "plantlike",
906 tiles = {"default_aspen_sapling.png"},
907 inventory_image = "default_aspen_sapling.png",
908 wield_image = "default_aspen_sapling.png",
910 sunlight_propagates = true,
912 on_timer = default.grow_sapling,
915 fixed = {-3 / 16, -0.5, -3 / 16, 3 / 16, 0.5, 3 / 16}
917 groups = {snappy = 2, dig_immediate = 3, flammable = 3,
918 attached_node = 1, sapling = 1},
919 sounds = default.node_sound_leaves_defaults(),
921 on_construct = function(pos)
922 minetest.get_node_timer(pos):start(math.random(2400,4800))
925 on_place = function(itemstack, placer, pointed_thing)
926 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
927 "default:aspen_sapling",
928 -- minp, maxp to be checked, relative to sapling pos
929 -- minp_relative.y = 1 because sapling pos has been checked
930 {x = -2, y = 1, z = -2},
931 {x = 2, y = 12, z = 2},
932 -- maximum interval of interior volume check
943 minetest.register_node("default:stone_with_coal", {
944 description = "Coal Ore",
945 tiles = {"default_stone.png^default_mineral_coal.png"},
946 groups = {cracky = 3},
947 drop = 'default:coal_lump',
948 sounds = default.node_sound_stone_defaults(),
951 minetest.register_node("default:coalblock", {
952 description = "Coal Block",
953 tiles = {"default_coal_block.png"},
954 is_ground_content = false,
955 groups = {cracky = 3},
956 sounds = default.node_sound_stone_defaults(),
960 minetest.register_node("default:stone_with_iron", {
961 description = "Iron Ore",
962 tiles = {"default_stone.png^default_mineral_iron.png"},
963 groups = {cracky = 2},
964 drop = 'default:iron_lump',
965 sounds = default.node_sound_stone_defaults(),
968 minetest.register_node("default:steelblock", {
969 description = "Steel Block",
970 tiles = {"default_steel_block.png"},
971 is_ground_content = false,
972 groups = {cracky = 1, level = 2},
973 sounds = default.node_sound_metal_defaults(),
977 minetest.register_node("default:stone_with_copper", {
978 description = "Copper Ore",
979 tiles = {"default_stone.png^default_mineral_copper.png"},
980 groups = {cracky = 2},
981 drop = 'default:copper_lump',
982 sounds = default.node_sound_stone_defaults(),
985 minetest.register_node("default:copperblock", {
986 description = "Copper Block",
987 tiles = {"default_copper_block.png"},
988 is_ground_content = false,
989 groups = {cracky = 1, level = 2},
990 sounds = default.node_sound_metal_defaults(),
993 minetest.register_node("default:bronzeblock", {
994 description = "Bronze Block",
995 tiles = {"default_bronze_block.png"},
996 is_ground_content = false,
997 groups = {cracky = 1, level = 2},
998 sounds = default.node_sound_metal_defaults(),
1002 minetest.register_node("default:stone_with_mese", {
1003 description = "Mese Ore",
1004 tiles = {"default_stone.png^default_mineral_mese.png"},
1005 groups = {cracky = 1},
1006 drop = "default:mese_crystal",
1007 sounds = default.node_sound_stone_defaults(),
1010 minetest.register_node("default:mese", {
1011 description = "Mese Block",
1012 tiles = {"default_mese_block.png"},
1013 paramtype = "light",
1014 groups = {cracky = 1, level = 2},
1015 sounds = default.node_sound_stone_defaults(),
1020 minetest.register_node("default:stone_with_gold", {
1021 description = "Gold Ore",
1022 tiles = {"default_stone.png^default_mineral_gold.png"},
1023 groups = {cracky = 2},
1024 drop = "default:gold_lump",
1025 sounds = default.node_sound_stone_defaults(),
1028 minetest.register_node("default:goldblock", {
1029 description = "Gold Block",
1030 tiles = {"default_gold_block.png"},
1031 is_ground_content = false,
1032 groups = {cracky = 1},
1033 sounds = default.node_sound_metal_defaults(),
1037 minetest.register_node("default:stone_with_diamond", {
1038 description = "Diamond Ore",
1039 tiles = {"default_stone.png^default_mineral_diamond.png"},
1040 groups = {cracky = 1},
1041 drop = "default:diamond",
1042 sounds = default.node_sound_stone_defaults(),
1045 minetest.register_node("default:diamondblock", {
1046 description = "Diamond Block",
1047 tiles = {"default_diamond_block.png"},
1048 is_ground_content = false,
1049 groups = {cracky = 1, level = 3},
1050 sounds = default.node_sound_stone_defaults(),
1054 -- Plantlife (non-cubic)
1057 minetest.register_node("default:cactus", {
1058 description = "Cactus",
1059 tiles = {"default_cactus_top.png", "default_cactus_top.png",
1060 "default_cactus_side.png"},
1061 paramtype2 = "facedir",
1062 groups = {choppy = 3},
1063 sounds = default.node_sound_wood_defaults(),
1064 on_place = minetest.rotate_node,
1067 minetest.register_node("default:papyrus", {
1068 description = "Papyrus",
1069 drawtype = "plantlike",
1070 tiles = {"default_papyrus.png"},
1071 inventory_image = "default_papyrus.png",
1072 wield_image = "default_papyrus.png",
1073 paramtype = "light",
1074 sunlight_propagates = true,
1078 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16},
1080 groups = {snappy = 3, flammable = 2},
1081 sounds = default.node_sound_leaves_defaults(),
1083 after_dig_node = function(pos, node, metadata, digger)
1084 default.dig_up(pos, node, digger)
1088 minetest.register_node("default:dry_shrub", {
1089 description = "Dry Shrub",
1090 drawtype = "plantlike",
1092 tiles = {"default_dry_shrub.png"},
1093 inventory_image = "default_dry_shrub.png",
1094 wield_image = "default_dry_shrub.png",
1095 paramtype = "light",
1096 sunlight_propagates = true,
1098 buildable_to = true,
1099 groups = {snappy = 3, flammable = 3, attached_node = 1},
1100 sounds = default.node_sound_leaves_defaults(),
1103 fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 4 / 16, 5 / 16},
1107 minetest.register_node("default:junglegrass", {
1108 description = "Jungle Grass",
1109 drawtype = "plantlike",
1111 visual_scale = 1.69,
1112 tiles = {"default_junglegrass.png"},
1113 inventory_image = "default_junglegrass.png",
1114 wield_image = "default_junglegrass.png",
1115 paramtype = "light",
1116 sunlight_propagates = true,
1118 buildable_to = true,
1119 groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1, flammable = 1},
1120 sounds = default.node_sound_leaves_defaults(),
1123 fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 1.19, 7 / 16},
1128 minetest.register_node("default:grass_1", {
1129 description = "Grass",
1130 drawtype = "plantlike",
1132 tiles = {"default_grass_1.png"},
1133 -- Use texture of a taller grass stage in inventory
1134 inventory_image = "default_grass_3.png",
1135 wield_image = "default_grass_3.png",
1136 paramtype = "light",
1137 sunlight_propagates = true,
1139 buildable_to = true,
1140 groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1, flammable = 1},
1141 sounds = default.node_sound_leaves_defaults(),
1144 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -5 / 16, 6 / 16},
1147 on_place = function(itemstack, placer, pointed_thing)
1148 -- place a random grass node
1149 local stack = ItemStack("default:grass_" .. math.random(1,5))
1150 local ret = minetest.item_place(stack, placer, pointed_thing)
1151 return ItemStack("default:grass_1 " ..
1152 itemstack:get_count() - (1 - ret:get_count()))
1157 minetest.register_node("default:grass_" .. i, {
1158 description = "Grass",
1159 drawtype = "plantlike",
1161 tiles = {"default_grass_" .. i .. ".png"},
1162 inventory_image = "default_grass_" .. i .. ".png",
1163 wield_image = "default_grass_" .. i .. ".png",
1164 paramtype = "light",
1165 sunlight_propagates = true,
1167 buildable_to = true,
1168 drop = "default:grass_1",
1169 groups = {snappy = 3, flora = 1, attached_node = 1,
1170 not_in_creative_inventory = 1, grass = 1, flammable = 1},
1171 sounds = default.node_sound_leaves_defaults(),
1174 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -3 / 16, 6 / 16},
1180 minetest.register_node("default:dry_grass_1", {
1181 description = "Dry Grass",
1182 drawtype = "plantlike",
1184 tiles = {"default_dry_grass_1.png"},
1185 inventory_image = "default_dry_grass_3.png",
1186 wield_image = "default_dry_grass_3.png",
1187 paramtype = "light",
1188 sunlight_propagates = true,
1190 buildable_to = true,
1191 groups = {snappy = 3, flammable = 3, flora = 1,
1192 attached_node = 1, dry_grass = 1},
1193 sounds = default.node_sound_leaves_defaults(),
1196 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -3 / 16, 6 / 16},
1199 on_place = function(itemstack, placer, pointed_thing)
1200 -- place a random dry grass node
1201 local stack = ItemStack("default:dry_grass_" .. math.random(1, 5))
1202 local ret = minetest.item_place(stack, placer, pointed_thing)
1203 return ItemStack("default:dry_grass_1 " ..
1204 itemstack:get_count() - (1 - ret:get_count()))
1209 minetest.register_node("default:dry_grass_" .. i, {
1210 description = "Dry Grass",
1211 drawtype = "plantlike",
1213 tiles = {"default_dry_grass_" .. i .. ".png"},
1214 inventory_image = "default_dry_grass_" .. i .. ".png",
1215 wield_image = "default_dry_grass_" .. i .. ".png",
1216 paramtype = "light",
1217 sunlight_propagates = true,
1219 buildable_to = true,
1220 groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1,
1221 not_in_creative_inventory=1, dry_grass = 1},
1222 drop = "default:dry_grass_1",
1223 sounds = default.node_sound_leaves_defaults(),
1226 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -1 / 16, 6 / 16},
1232 minetest.register_node("default:bush_stem", {
1233 description = "Bush Stem",
1234 drawtype = "plantlike",
1235 visual_scale = 1.41,
1236 tiles = {"default_bush_stem.png"},
1237 inventory_image = "default_bush_stem.png",
1238 wield_image = "default_bush_stem.png",
1239 paramtype = "light",
1240 sunlight_propagates = true,
1241 groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
1242 sounds = default.node_sound_wood_defaults(),
1245 fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.54, 7 / 16},
1249 minetest.register_node("default:bush_leaves", {
1250 description = "Bush Leaves",
1251 drawtype = "allfaces_optional",
1253 tiles = {"default_leaves_simple.png"},
1254 paramtype = "light",
1255 groups = {snappy = 3, flammable = 2, leaves = 1},
1256 sounds = default.node_sound_leaves_defaults(),
1259 minetest.register_node("default:acacia_bush_stem", {
1260 description = "Acacia Bush Stem",
1261 drawtype = "plantlike",
1262 visual_scale = 1.41,
1263 tiles = {"default_acacia_bush_stem.png"},
1264 inventory_image = "default_acacia_bush_stem.png",
1265 wield_image = "default_acacia_bush_stem.png",
1266 paramtype = "light",
1267 sunlight_propagates = true,
1268 groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
1269 sounds = default.node_sound_wood_defaults(),
1272 fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.54, 7 / 16},
1276 minetest.register_node("default:acacia_bush_leaves", {
1277 description = "Acacia Bush Leaves",
1278 drawtype = "allfaces_optional",
1280 tiles = {"default_acacia_leaves_simple.png"},
1281 paramtype = "light",
1282 groups = {snappy = 3, flammable = 2, leaves = 1},
1283 sounds = default.node_sound_leaves_defaults(),
1291 minetest.register_node("default:coral_brown", {
1292 description = "Brown Coral",
1293 tiles = {"default_coral_brown.png"},
1294 groups = {cracky = 3},
1295 drop = "default:coral_skeleton",
1296 sounds = default.node_sound_stone_defaults(),
1299 minetest.register_node("default:coral_orange", {
1300 description = "Orange Coral",
1301 tiles = {"default_coral_orange.png"},
1302 groups = {cracky = 3},
1303 drop = "default:coral_skeleton",
1304 sounds = default.node_sound_stone_defaults(),
1307 minetest.register_node("default:coral_skeleton", {
1308 description = "Coral Skeleton",
1309 tiles = {"default_coral_skeleton.png"},
1310 groups = {cracky = 3},
1311 sounds = default.node_sound_stone_defaults(),
1319 minetest.register_node("default:water_source", {
1320 description = "Water Source",
1321 drawtype = "liquid",
1324 name = "default_water_source_animated.png",
1326 type = "vertical_frames",
1334 -- New-style water source material (mostly unused)
1336 name = "default_water_source_animated.png",
1338 type = "vertical_frames",
1343 backface_culling = false,
1347 paramtype = "light",
1351 buildable_to = true,
1352 is_ground_content = false,
1355 liquidtype = "source",
1356 liquid_alternative_flowing = "default:water_flowing",
1357 liquid_alternative_source = "default:water_source",
1358 liquid_viscosity = 1,
1359 post_effect_color = {a = 103, r = 30, g = 60, b = 90},
1360 groups = {water = 3, liquid = 3, puts_out_fire = 1, cools_lava = 1},
1361 sounds = default.node_sound_water_defaults(),
1364 minetest.register_node("default:water_flowing", {
1365 description = "Flowing Water",
1366 drawtype = "flowingliquid",
1367 tiles = {"default_water.png"},
1370 name = "default_water_flowing_animated.png",
1371 backface_culling = false,
1373 type = "vertical_frames",
1380 name = "default_water_flowing_animated.png",
1381 backface_culling = true,
1383 type = "vertical_frames",
1391 paramtype = "light",
1392 paramtype2 = "flowingliquid",
1396 buildable_to = true,
1397 is_ground_content = false,
1400 liquidtype = "flowing",
1401 liquid_alternative_flowing = "default:water_flowing",
1402 liquid_alternative_source = "default:water_source",
1403 liquid_viscosity = 1,
1404 post_effect_color = {a = 103, r = 30, g = 60, b = 90},
1405 groups = {water = 3, liquid = 3, puts_out_fire = 1,
1406 not_in_creative_inventory = 1, cools_lava = 1},
1407 sounds = default.node_sound_water_defaults(),
1411 minetest.register_node("default:river_water_source", {
1412 description = "River Water Source",
1413 drawtype = "liquid",
1416 name = "default_river_water_source_animated.png",
1418 type = "vertical_frames",
1427 name = "default_river_water_source_animated.png",
1429 type = "vertical_frames",
1434 backface_culling = false,
1438 paramtype = "light",
1442 buildable_to = true,
1443 is_ground_content = false,
1446 liquidtype = "source",
1447 liquid_alternative_flowing = "default:river_water_flowing",
1448 liquid_alternative_source = "default:river_water_source",
1449 liquid_viscosity = 1,
1450 liquid_renewable = false,
1452 post_effect_color = {a = 103, r = 30, g = 76, b = 90},
1453 groups = {water = 3, liquid = 3, puts_out_fire = 1, cools_lava = 1},
1454 sounds = default.node_sound_water_defaults(),
1457 minetest.register_node("default:river_water_flowing", {
1458 description = "Flowing River Water",
1459 drawtype = "flowingliquid",
1460 tiles = {"default_river_water.png"},
1463 name = "default_river_water_flowing_animated.png",
1464 backface_culling = false,
1466 type = "vertical_frames",
1473 name = "default_river_water_flowing_animated.png",
1474 backface_culling = true,
1476 type = "vertical_frames",
1484 paramtype = "light",
1485 paramtype2 = "flowingliquid",
1489 buildable_to = true,
1490 is_ground_content = false,
1493 liquidtype = "flowing",
1494 liquid_alternative_flowing = "default:river_water_flowing",
1495 liquid_alternative_source = "default:river_water_source",
1496 liquid_viscosity = 1,
1497 liquid_renewable = false,
1499 post_effect_color = {a = 103, r = 30, g = 76, b = 90},
1500 groups = {water = 3, liquid = 3, puts_out_fire = 1,
1501 not_in_creative_inventory = 1, cools_lava = 1},
1502 sounds = default.node_sound_water_defaults(),
1506 minetest.register_node("default:lava_source", {
1507 description = "Lava Source",
1508 drawtype = "liquid",
1511 name = "default_lava_source_animated.png",
1513 type = "vertical_frames",
1521 -- New-style lava source material (mostly unused)
1523 name = "default_lava_source_animated.png",
1525 type = "vertical_frames",
1530 backface_culling = false,
1533 paramtype = "light",
1534 light_source = default.LIGHT_MAX - 1,
1538 buildable_to = true,
1539 is_ground_content = false,
1542 liquidtype = "source",
1543 liquid_alternative_flowing = "default:lava_flowing",
1544 liquid_alternative_source = "default:lava_source",
1545 liquid_viscosity = 7,
1546 liquid_renewable = false,
1547 damage_per_second = 4 * 2,
1548 post_effect_color = {a = 191, r = 255, g = 64, b = 0},
1549 groups = {lava = 3, liquid = 2, igniter = 1},
1552 minetest.register_node("default:lava_flowing", {
1553 description = "Flowing Lava",
1554 drawtype = "flowingliquid",
1555 tiles = {"default_lava.png"},
1558 name = "default_lava_flowing_animated.png",
1559 backface_culling = false,
1561 type = "vertical_frames",
1568 name = "default_lava_flowing_animated.png",
1569 backface_culling = true,
1571 type = "vertical_frames",
1578 paramtype = "light",
1579 paramtype2 = "flowingliquid",
1580 light_source = default.LIGHT_MAX - 1,
1584 buildable_to = true,
1585 is_ground_content = false,
1588 liquidtype = "flowing",
1589 liquid_alternative_flowing = "default:lava_flowing",
1590 liquid_alternative_source = "default:lava_source",
1591 liquid_viscosity = 7,
1592 liquid_renewable = false,
1593 damage_per_second = 4 * 2,
1594 post_effect_color = {a = 191, r = 255, g = 64, b = 0},
1595 groups = {lava = 3, liquid = 2, igniter = 1,
1596 not_in_creative_inventory = 1},
1600 -- Tools / "Advanced" crafting / Non-"natural"
1603 local chest_formspec =
1606 default.gui_bg_img ..
1607 default.gui_slots ..
1608 "list[current_name;main;0,0.3;8,4;]" ..
1609 "list[current_player;main;0,4.85;8,1;]" ..
1610 "list[current_player;main;0,6.08;8,3;8]" ..
1611 "listring[current_name;main]" ..
1612 "listring[current_player;main]" ..
1613 default.get_hotbar_bg(0,4.85)
1615 local function get_locked_chest_formspec(pos)
1616 local spos = pos.x .. "," .. pos.y .. "," .. pos.z
1620 default.gui_bg_img ..
1621 default.gui_slots ..
1622 "list[nodemeta:" .. spos .. ";main;0,0.3;8,4;]" ..
1623 "list[current_player;main;0,4.85;8,1;]" ..
1624 "list[current_player;main;0,6.08;8,3;8]" ..
1625 "listring[nodemeta:" .. spos .. ";main]" ..
1626 "listring[current_player;main]" ..
1627 default.get_hotbar_bg(0,4.85)
1631 minetest.register_node("default:chest", {
1632 description = "Chest",
1633 tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
1634 "default_chest_side.png", "default_chest_side.png", "default_chest_front.png"},
1635 paramtype2 = "facedir",
1636 groups = {choppy = 2, oddly_breakable_by_hand = 2},
1637 legacy_facedir_simple = true,
1638 is_ground_content = false,
1639 sounds = default.node_sound_wood_defaults(),
1641 on_construct = function(pos)
1642 local meta = minetest.get_meta(pos)
1643 meta:set_string("formspec", chest_formspec)
1644 local inv = meta:get_inventory()
1645 inv:set_size("main", 8*4)
1647 can_dig = function(pos,player)
1648 local meta = minetest.get_meta(pos);
1649 local inv = meta:get_inventory()
1650 return inv:is_empty("main")
1652 on_metadata_inventory_move = function(pos, from_list, from_index,
1653 to_list, to_index, count, player)
1654 minetest.log("action", player:get_player_name() ..
1655 " moves stuff in chest at " .. minetest.pos_to_string(pos))
1657 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1658 minetest.log("action", player:get_player_name() ..
1659 " moves " .. stack:get_name() ..
1660 " to chest at " .. minetest.pos_to_string(pos))
1662 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1663 minetest.log("action", player:get_player_name() ..
1664 " takes " .. stack:get_name() ..
1665 " from chest at " .. minetest.pos_to_string(pos))
1667 on_blast = function(pos)
1669 default.get_inventory_drops(pos, "main", drops)
1670 drops[#drops+1] = "default:chest"
1671 minetest.remove_node(pos)
1676 minetest.register_node("default:chest_locked", {
1677 description = "Locked Chest",
1678 tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
1679 "default_chest_side.png", "default_chest_side.png", "default_chest_lock.png"},
1680 paramtype2 = "facedir",
1681 groups = {choppy = 2, oddly_breakable_by_hand = 2},
1682 legacy_facedir_simple = true,
1683 is_ground_content = false,
1684 sounds = default.node_sound_wood_defaults(),
1686 after_place_node = function(pos, placer)
1687 local meta = minetest.get_meta(pos)
1688 meta:set_string("owner", placer:get_player_name() or "")
1689 meta:set_string("infotext", "Locked Chest (owned by " ..
1690 meta:get_string("owner") .. ")")
1692 on_construct = function(pos)
1693 local meta = minetest.get_meta(pos)
1694 meta:set_string("owner", "")
1695 local inv = meta:get_inventory()
1696 inv:set_size("main", 8 * 4)
1698 can_dig = function(pos,player)
1699 local meta = minetest.get_meta(pos);
1700 local inv = meta:get_inventory()
1701 return inv:is_empty("main") and default.can_interact_with_node(player, pos)
1703 allow_metadata_inventory_move = function(pos, from_list, from_index,
1704 to_list, to_index, count, player)
1705 if not default.can_interact_with_node(player, pos) then
1710 allow_metadata_inventory_put = function(pos, listname, index, stack, player)
1711 if not default.can_interact_with_node(player, pos) then
1714 return stack:get_count()
1716 allow_metadata_inventory_take = function(pos, listname, index, stack, player)
1717 if not default.can_interact_with_node(player, pos) then
1720 return stack:get_count()
1722 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1723 minetest.log("action", player:get_player_name() ..
1724 " moves " .. stack:get_name() ..
1725 " to locked chest at " .. minetest.pos_to_string(pos))
1727 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1728 minetest.log("action", player:get_player_name() ..
1729 " takes " .. stack:get_name() ..
1730 " from locked chest at " .. minetest.pos_to_string(pos))
1732 on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
1733 if default.can_interact_with_node(clicker, pos) then
1734 minetest.show_formspec(
1735 clicker:get_player_name(),
1736 "default:chest_locked",
1737 get_locked_chest_formspec(pos)
1742 on_blast = function() end,
1743 on_key_use = function(pos, player)
1744 local secret = minetest.get_meta(pos):get_string("key_lock_secret")
1745 local itemstack = player:get_wielded_item()
1746 local key_meta = itemstack:get_meta()
1748 if key_meta:get_string("secret") == "" then
1749 key_meta:set_string("secret", minetest.parse_json(itemstack:get_metadata()).secret)
1752 if secret ~= key_meta:get_string("secret") then
1756 minetest.show_formspec(
1757 player:get_player_name(),
1758 "default:chest_locked",
1759 get_locked_chest_formspec(pos)
1762 on_skeleton_key_use = function(pos, player, newsecret)
1763 local meta = minetest.get_meta(pos)
1764 local owner = meta:get_string("owner")
1765 local name = player:get_player_name()
1767 -- verify placer is owner of lockable chest
1768 if owner ~= name then
1769 minetest.record_protection_violation(pos, name)
1770 minetest.chat_send_player(name, "You do not own this chest.")
1774 local secret = meta:get_string("key_lock_secret")
1775 if secret == "" then
1777 meta:set_string("key_lock_secret", secret)
1780 return secret, "a locked chest", owner
1785 local bookshelf_formspec =
1788 default.gui_bg_img ..
1789 default.gui_slots ..
1790 "list[context;books;0,0.3;8,2;]" ..
1791 "list[current_player;main;0,2.85;8,1;]" ..
1792 "list[current_player;main;0,4.08;8,3;8]" ..
1793 "listring[context;books]" ..
1794 "listring[current_player;main]" ..
1795 default.get_hotbar_bg(0,2.85)
1797 local function get_bookshelf_formspec(inv)
1798 local formspec = bookshelf_formspec
1799 local invlist = inv and inv:get_list("books")
1800 -- Inventory slots overlay
1801 local bx, by = 0, 0.3
1807 if not invlist or invlist[i]:is_empty() then
1808 formspec = formspec ..
1809 "image[" .. bx .. "," .. by .. ";1,1;default_bookshelf_slot.png]"
1816 minetest.register_node("default:bookshelf", {
1817 description = "Bookshelf",
1818 tiles = {"default_wood.png", "default_wood.png", "default_wood.png",
1819 "default_wood.png", "default_bookshelf.png", "default_bookshelf.png"},
1820 paramtype2 = "facedir",
1821 is_ground_content = false,
1822 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
1823 sounds = default.node_sound_wood_defaults(),
1825 on_construct = function(pos)
1826 local meta = minetest.get_meta(pos)
1827 meta:set_string("formspec", get_bookshelf_formspec(nil))
1828 local inv = meta:get_inventory()
1829 inv:set_size("books", 8 * 2)
1831 can_dig = function(pos,player)
1832 local inv = minetest.get_meta(pos):get_inventory()
1833 return inv:is_empty("books")
1835 allow_metadata_inventory_put = function(pos, listname, index, stack)
1836 if minetest.get_item_group(stack:get_name(), "book") ~= 0 then
1837 return stack:get_count()
1841 on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
1842 minetest.log("action", player:get_player_name() ..
1843 " moves stuff in bookshelf at " .. minetest.pos_to_string(pos))
1844 local meta = minetest.get_meta(pos)
1845 meta:set_string("formspec", get_bookshelf_formspec(meta:get_inventory()))
1847 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1848 minetest.log("action", player:get_player_name() ..
1849 " moves stuff to bookshelf at " .. minetest.pos_to_string(pos))
1850 local meta = minetest.get_meta(pos)
1851 meta:set_string("formspec", get_bookshelf_formspec(meta:get_inventory()))
1853 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1854 minetest.log("action", player:get_player_name() ..
1855 " takes stuff from 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_blast = function(pos)
1861 default.get_inventory_drops(pos, "books", drops)
1862 drops[#drops+1] = "default:bookshelf"
1863 minetest.remove_node(pos)
1868 local function register_sign(material, desc, def)
1869 minetest.register_node("default:sign_wall_" .. material, {
1870 description = desc .. " Sign",
1871 drawtype = "nodebox",
1872 tiles = {"default_sign_wall_" .. material .. ".png"},
1873 inventory_image = "default_sign_" .. material .. ".png",
1874 wield_image = "default_sign_" .. material .. ".png",
1875 paramtype = "light",
1876 paramtype2 = "wallmounted",
1877 sunlight_propagates = true,
1878 is_ground_content = false,
1881 type = "wallmounted",
1882 wall_top = {-0.4375, 0.4375, -0.3125, 0.4375, 0.5, 0.3125},
1883 wall_bottom = {-0.4375, -0.5, -0.3125, 0.4375, -0.4375, 0.3125},
1884 wall_side = {-0.5, -0.3125, -0.4375, -0.4375, 0.3125, 0.4375},
1886 groups = def.groups,
1887 legacy_wallmounted = true,
1888 sounds = def.sounds,
1890 on_construct = function(pos)
1891 --local n = minetest.get_node(pos)
1892 local meta = minetest.get_meta(pos)
1893 meta:set_string("formspec", "field[text;;${text}]")
1895 on_receive_fields = function(pos, formname, fields, sender)
1896 --print("Sign at "..minetest.pos_to_string(pos).." got "..dump(fields))
1897 local player_name = sender:get_player_name()
1898 if minetest.is_protected(pos, player_name) then
1899 minetest.record_protection_violation(pos, player_name)
1902 local meta = minetest.get_meta(pos)
1903 if not fields.text then return end
1904 minetest.log("action", (player_name or "") .. " wrote \"" ..
1905 fields.text .. "\" to sign at " .. minetest.pos_to_string(pos))
1906 meta:set_string("text", fields.text)
1907 meta:set_string("infotext", '"' .. fields.text .. '"')
1912 register_sign("wood", "Wooden", {
1913 sounds = default.node_sound_wood_defaults(),
1914 groups = {choppy = 2, attached_node = 1, flammable = 2, oddly_breakable_by_hand = 3}
1917 register_sign("steel", "Steel", {
1918 sounds = default.node_sound_metal_defaults(),
1919 groups = {cracky = 2, attached_node = 1}
1922 minetest.register_node("default:ladder_wood", {
1923 description = "Wooden Ladder",
1924 drawtype = "signlike",
1925 tiles = {"default_ladder_wood.png"},
1926 inventory_image = "default_ladder_wood.png",
1927 wield_image = "default_ladder_wood.png",
1928 paramtype = "light",
1929 paramtype2 = "wallmounted",
1930 sunlight_propagates = true,
1933 is_ground_content = false,
1935 type = "wallmounted",
1936 --wall_top = = <default>
1937 --wall_bottom = = <default>
1938 --wall_side = = <default>
1940 groups = {choppy = 2, oddly_breakable_by_hand = 3, flammable = 2},
1941 legacy_wallmounted = true,
1942 sounds = default.node_sound_wood_defaults(),
1945 minetest.register_node("default:ladder_steel", {
1946 description = "Steel Ladder",
1947 drawtype = "signlike",
1948 tiles = {"default_ladder_steel.png"},
1949 inventory_image = "default_ladder_steel.png",
1950 wield_image = "default_ladder_steel.png",
1951 paramtype = "light",
1952 paramtype2 = "wallmounted",
1953 sunlight_propagates = true,
1956 is_ground_content = false,
1958 type = "wallmounted",
1959 --wall_top = = <default>
1960 --wall_bottom = = <default>
1961 --wall_side = = <default>
1963 groups = {cracky = 2},
1964 sounds = default.node_sound_metal_defaults(),
1967 default.register_fence("default:fence_wood", {
1968 description = "Wooden Fence",
1969 texture = "default_fence_wood.png",
1970 inventory_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1971 wield_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1972 material = "default:wood",
1973 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
1974 sounds = default.node_sound_wood_defaults()
1977 default.register_fence("default:fence_acacia_wood", {
1978 description = "Acacia Fence",
1979 texture = "default_fence_acacia_wood.png",
1980 inventory_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1981 wield_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1982 material = "default:acacia_wood",
1983 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
1984 sounds = default.node_sound_wood_defaults()
1987 default.register_fence("default:fence_junglewood", {
1988 description = "Junglewood Fence",
1989 texture = "default_fence_junglewood.png",
1990 inventory_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126",
1991 wield_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126",
1992 material = "default:junglewood",
1993 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
1994 sounds = default.node_sound_wood_defaults()
1997 default.register_fence("default:fence_pine_wood", {
1998 description = "Pine Fence",
1999 texture = "default_fence_pine_wood.png",
2000 inventory_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2001 wield_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2002 material = "default:pine_wood",
2003 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
2004 sounds = default.node_sound_wood_defaults()
2007 default.register_fence("default:fence_aspen_wood", {
2008 description = "Aspen Fence",
2009 texture = "default_fence_aspen_wood.png",
2010 inventory_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2011 wield_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2012 material = "default:aspen_wood",
2013 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
2014 sounds = default.node_sound_wood_defaults()
2017 minetest.register_node("default:glass", {
2018 description = "Glass",
2019 drawtype = "glasslike_framed_optional",
2020 tiles = {"default_glass.png", "default_glass_detail.png"},
2021 paramtype = "light",
2022 sunlight_propagates = true,
2023 is_ground_content = false,
2024 groups = {cracky = 3, oddly_breakable_by_hand = 3},
2025 sounds = default.node_sound_glass_defaults(),
2028 minetest.register_node("default:obsidian_glass", {
2029 description = "Obsidian Glass",
2030 drawtype = "glasslike_framed_optional",
2031 tiles = {"default_obsidian_glass.png", "default_obsidian_glass_detail.png"},
2032 paramtype = "light",
2033 is_ground_content = false,
2034 sunlight_propagates = true,
2035 sounds = default.node_sound_glass_defaults(),
2036 groups = {cracky = 3},
2040 minetest.register_node("default:brick", {
2041 description = "Brick Block",
2042 paramtype2 = "facedir",
2044 tiles = {"default_brick.png"},
2045 is_ground_content = false,
2046 groups = {cracky = 3},
2047 sounds = default.node_sound_stone_defaults(),
2051 minetest.register_node("default:meselamp", {
2052 description = "Mese Lamp",
2053 drawtype = "glasslike",
2054 tiles = {"default_meselamp.png"},
2055 paramtype = "light",
2056 sunlight_propagates = true,
2057 is_ground_content = false,
2058 groups = {cracky = 3, oddly_breakable_by_hand = 3},
2059 sounds = default.node_sound_glass_defaults(),
2060 light_source = default.LIGHT_MAX,
2063 minetest.register_node("default:mese_post_light", {
2064 description = "Mese Post Light",
2065 tiles = {"default_mese_post_light_top.png", "default_mese_post_light_top.png",
2066 "default_mese_post_light_side_dark.png", "default_mese_post_light_side_dark.png",
2067 "default_mese_post_light_side.png", "default_mese_post_light_side.png"},
2068 wield_image = "default_mese_post_light_side.png",
2069 drawtype = "nodebox",
2073 {-2 / 16, -8 / 16, -2 / 16, 2 / 16, 8 / 16, 2 / 16},
2076 paramtype = "light",
2077 light_source = default.LIGHT_MAX,
2078 sunlight_propagates = true,
2079 is_ground_content = false,
2080 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
2081 sounds = default.node_sound_wood_defaults(),
2088 minetest.register_node("default:cloud", {
2089 description = "Cloud",
2090 tiles = {"default_cloud.png"},
2091 is_ground_content = false,
2092 sounds = default.node_sound_defaults(),
2093 groups = {not_in_creative_inventory = 1},
2097 -- register trees for leafdecay
2100 if minetest.get_mapgen_setting("mg_name") == "v6" then
2101 default.register_leafdecay({
2102 trunks = {"default:tree"},
2103 leaves = {"default:apple", "default:leaves"},
2107 default.register_leafdecay({
2108 trunks = {"default:jungletree"},
2109 leaves = {"default:jungleleaves"},
2113 default.register_leafdecay({
2114 trunks = {"default:pine_tree"},
2115 leaves = {"default:pine_needles"},
2119 default.register_leafdecay({
2120 trunks = {"default:tree"},
2121 leaves = {"default:apple", "default:leaves"},
2125 default.register_leafdecay({
2126 trunks = {"default:jungletree"},
2127 leaves = {"default:jungleleaves"},
2131 default.register_leafdecay({
2132 trunks = {"default:pine_tree"},
2133 leaves = {"default:pine_needles"},
2138 default.register_leafdecay({
2139 trunks = {"default:acacia_tree"},
2140 leaves = {"default:acacia_leaves"},
2144 default.register_leafdecay({
2145 trunks = {"default:aspen_tree"},
2146 leaves = {"default:aspen_leaves"},