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",
520 tiles = {"default_sapling.png"},
521 inventory_image = "default_sapling.png",
522 wield_image = "default_sapling.png",
524 sunlight_propagates = true,
526 on_timer = default.grow_sapling,
529 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
531 groups = {snappy = 2, dig_immediate = 3, flammable = 2,
532 attached_node = 1, sapling = 1},
533 sounds = default.node_sound_leaves_defaults(),
535 on_construct = function(pos)
536 minetest.get_node_timer(pos):start(math.random(2400,4800))
539 on_place = function(itemstack, placer, pointed_thing)
540 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
542 -- minp, maxp to be checked, relative to sapling pos
543 -- minp_relative.y = 1 because sapling pos has been checked
544 {x = -2, y = 1, z = -2},
545 {x = 2, y = 6, z = 2},
546 -- maximum interval of interior volume check
553 minetest.register_node("default:leaves", {
554 description = "Leaves",
555 drawtype = "allfaces_optional",
557 tiles = {"default_leaves.png"},
558 special_tiles = {"default_leaves_simple.png"},
560 is_ground_content = false,
561 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
566 -- player will get sapling with 1/20 chance
567 items = {'default:sapling'},
571 -- player will get leaves only if he get no saplings,
572 -- this is because max_items is 1
573 items = {'default:leaves'},
577 sounds = default.node_sound_leaves_defaults(),
579 after_place_node = default.after_place_leaves,
582 minetest.register_node("default:apple", {
583 description = "Apple",
584 drawtype = "plantlike",
586 tiles = {"default_apple.png"},
587 inventory_image = "default_apple.png",
589 sunlight_propagates = true,
591 is_ground_content = false,
594 fixed = {-3 / 16, -7 / 16, -3 / 16, 3 / 16, 4 / 16, 3 / 16}
596 groups = {fleshy = 3, dig_immediate = 3, flammable = 2,
597 leafdecay = 3, leafdecay_drop = 1},
598 on_use = minetest.item_eat(2),
599 sounds = default.node_sound_leaves_defaults(),
601 after_place_node = function(pos, placer, itemstack)
602 if placer:is_player() then
603 minetest.set_node(pos, {name = "default:apple", param2 = 1})
609 minetest.register_node("default:jungletree", {
610 description = "Jungle Tree",
611 tiles = {"default_jungletree_top.png", "default_jungletree_top.png",
612 "default_jungletree.png"},
613 paramtype2 = "facedir",
614 is_ground_content = false,
615 groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
616 sounds = default.node_sound_wood_defaults(),
618 on_place = minetest.rotate_node
621 minetest.register_node("default:junglewood", {
622 description = "Junglewood Planks",
623 paramtype2 = "facedir",
625 tiles = {"default_junglewood.png"},
626 is_ground_content = false,
627 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
628 sounds = default.node_sound_wood_defaults(),
631 minetest.register_node("default:jungleleaves", {
632 description = "Jungle Leaves",
633 drawtype = "allfaces_optional",
635 tiles = {"default_jungleleaves.png"},
636 special_tiles = {"default_jungleleaves_simple.png"},
638 is_ground_content = false,
639 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
643 {items = {'default:junglesapling'}, rarity = 20},
644 {items = {'default:jungleleaves'}}
647 sounds = default.node_sound_leaves_defaults(),
649 after_place_node = default.after_place_leaves,
652 minetest.register_node("default:junglesapling", {
653 description = "Jungle Sapling",
654 drawtype = "plantlike",
656 tiles = {"default_junglesapling.png"},
657 inventory_image = "default_junglesapling.png",
658 wield_image = "default_junglesapling.png",
660 sunlight_propagates = true,
662 on_timer = default.grow_sapling,
665 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
667 groups = {snappy = 2, dig_immediate = 3, flammable = 2,
668 attached_node = 1, sapling = 1},
669 sounds = default.node_sound_leaves_defaults(),
671 on_construct = function(pos)
672 minetest.get_node_timer(pos):start(math.random(2400,4800))
675 on_place = function(itemstack, placer, pointed_thing)
676 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
677 "default:junglesapling",
678 -- minp, maxp to be checked, relative to sapling pos
679 -- minp_relative.y = 1 because sapling pos has been checked
680 {x = -2, y = 1, z = -2},
681 {x = 2, y = 15, z = 2},
682 -- maximum interval of interior volume check
690 minetest.register_node("default:pine_tree", {
691 description = "Pine Tree",
692 tiles = {"default_pine_tree_top.png", "default_pine_tree_top.png",
693 "default_pine_tree.png"},
694 paramtype2 = "facedir",
695 is_ground_content = false,
696 groups = {tree = 1, choppy = 3, oddly_breakable_by_hand = 1, flammable = 3},
697 sounds = default.node_sound_wood_defaults(),
699 on_place = minetest.rotate_node
702 minetest.register_node("default:pine_wood", {
703 description = "Pine Wood Planks",
704 paramtype2 = "facedir",
706 tiles = {"default_pine_wood.png"},
707 is_ground_content = false,
708 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
709 sounds = default.node_sound_wood_defaults(),
712 minetest.register_node("default:pine_needles",{
713 description = "Pine Needles",
714 drawtype = "allfaces_optional",
715 tiles = {"default_pine_needles.png"},
718 is_ground_content = false,
719 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
723 {items = {"default:pine_sapling"}, rarity = 20},
724 {items = {"default:pine_needles"}}
727 sounds = default.node_sound_leaves_defaults(),
729 after_place_node = default.after_place_leaves,
732 minetest.register_node("default:pine_sapling", {
733 description = "Pine Sapling",
734 drawtype = "plantlike",
736 tiles = {"default_pine_sapling.png"},
737 inventory_image = "default_pine_sapling.png",
738 wield_image = "default_pine_sapling.png",
740 sunlight_propagates = true,
742 on_timer = default.grow_sapling,
745 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
747 groups = {snappy = 2, dig_immediate = 3, flammable = 3,
748 attached_node = 1, sapling = 1},
749 sounds = default.node_sound_leaves_defaults(),
751 on_construct = function(pos)
752 minetest.get_node_timer(pos):start(math.random(2400,4800))
755 on_place = function(itemstack, placer, pointed_thing)
756 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
757 "default:pine_sapling",
758 -- minp, maxp to be checked, relative to sapling pos
759 -- minp_relative.y = 1 because sapling pos has been checked
760 {x = -2, y = 1, z = -2},
761 {x = 2, y = 12, z = 2},
762 -- maximum interval of interior volume check
770 minetest.register_node("default:acacia_tree", {
771 description = "Acacia Tree",
772 tiles = {"default_acacia_tree_top.png", "default_acacia_tree_top.png",
773 "default_acacia_tree.png"},
774 paramtype2 = "facedir",
775 is_ground_content = false,
776 groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
777 sounds = default.node_sound_wood_defaults(),
779 on_place = minetest.rotate_node
782 minetest.register_node("default:acacia_wood", {
783 description = "Acacia Wood Planks",
784 paramtype2 = "facedir",
786 tiles = {"default_acacia_wood.png"},
787 is_ground_content = false,
788 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
789 sounds = default.node_sound_wood_defaults(),
792 minetest.register_node("default:acacia_leaves", {
793 description = "Acacia Leaves",
794 drawtype = "allfaces_optional",
795 tiles = {"default_acacia_leaves.png"},
796 special_tiles = {"default_acacia_leaves_simple.png"},
799 is_ground_content = false,
800 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
804 {items = {"default:acacia_sapling"}, rarity = 20},
805 {items = {"default:acacia_leaves"}}
808 sounds = default.node_sound_leaves_defaults(),
810 after_place_node = default.after_place_leaves,
813 minetest.register_node("default:acacia_sapling", {
814 description = "Acacia Tree Sapling",
815 drawtype = "plantlike",
817 tiles = {"default_acacia_sapling.png"},
818 inventory_image = "default_acacia_sapling.png",
819 wield_image = "default_acacia_sapling.png",
821 sunlight_propagates = true,
823 on_timer = default.grow_sapling,
826 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
828 groups = {snappy = 2, dig_immediate = 3, flammable = 2,
829 attached_node = 1, sapling = 1},
830 sounds = default.node_sound_leaves_defaults(),
832 on_construct = function(pos)
833 minetest.get_node_timer(pos):start(math.random(2400,4800))
836 on_place = function(itemstack, placer, pointed_thing)
837 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
838 "default:acacia_sapling",
839 -- minp, maxp to be checked, relative to sapling pos
840 -- minp_relative.y = 1 because sapling pos has been checked
841 {x = -4, y = 1, z = -4},
842 {x = 4, y = 6, z = 4},
843 -- maximum interval of interior volume check
850 minetest.register_node("default:aspen_tree", {
851 description = "Aspen Tree",
852 tiles = {"default_aspen_tree_top.png", "default_aspen_tree_top.png",
853 "default_aspen_tree.png"},
854 paramtype2 = "facedir",
855 is_ground_content = false,
856 groups = {tree = 1, choppy = 3, oddly_breakable_by_hand = 1, flammable = 3},
857 sounds = default.node_sound_wood_defaults(),
859 on_place = minetest.rotate_node
862 minetest.register_node("default:aspen_wood", {
863 description = "Aspen Wood Planks",
864 paramtype2 = "facedir",
866 tiles = {"default_aspen_wood.png"},
867 is_ground_content = false,
868 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
869 sounds = default.node_sound_wood_defaults(),
872 minetest.register_node("default:aspen_leaves", {
873 description = "Aspen Leaves",
874 drawtype = "allfaces_optional",
875 tiles = {"default_aspen_leaves.png"},
878 is_ground_content = false,
879 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
883 {items = {"default:aspen_sapling"}, rarity = 20},
884 {items = {"default:aspen_leaves"}}
887 sounds = default.node_sound_leaves_defaults(),
889 after_place_node = default.after_place_leaves,
892 minetest.register_node("default:aspen_sapling", {
893 description = "Aspen Tree Sapling",
894 drawtype = "plantlike",
896 tiles = {"default_aspen_sapling.png"},
897 inventory_image = "default_aspen_sapling.png",
898 wield_image = "default_aspen_sapling.png",
900 sunlight_propagates = true,
902 on_timer = default.grow_sapling,
905 fixed = {-3 / 16, -0.5, -3 / 16, 3 / 16, 0.5, 3 / 16}
907 groups = {snappy = 2, dig_immediate = 3, flammable = 3,
908 attached_node = 1, sapling = 1},
909 sounds = default.node_sound_leaves_defaults(),
911 on_construct = function(pos)
912 minetest.get_node_timer(pos):start(math.random(2400,4800))
915 on_place = function(itemstack, placer, pointed_thing)
916 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
917 "default:aspen_sapling",
918 -- minp, maxp to be checked, relative to sapling pos
919 -- minp_relative.y = 1 because sapling pos has been checked
920 {x = -2, y = 1, z = -2},
921 {x = 2, y = 12, z = 2},
922 -- maximum interval of interior volume check
933 minetest.register_node("default:stone_with_coal", {
934 description = "Coal Ore",
935 tiles = {"default_stone.png^default_mineral_coal.png"},
936 groups = {cracky = 3},
937 drop = 'default:coal_lump',
938 sounds = default.node_sound_stone_defaults(),
941 minetest.register_node("default:coalblock", {
942 description = "Coal Block",
943 tiles = {"default_coal_block.png"},
944 is_ground_content = false,
945 groups = {cracky = 3},
946 sounds = default.node_sound_stone_defaults(),
950 minetest.register_node("default:stone_with_iron", {
951 description = "Iron Ore",
952 tiles = {"default_stone.png^default_mineral_iron.png"},
953 groups = {cracky = 2},
954 drop = 'default:iron_lump',
955 sounds = default.node_sound_stone_defaults(),
958 minetest.register_node("default:steelblock", {
959 description = "Steel Block",
960 tiles = {"default_steel_block.png"},
961 is_ground_content = false,
962 groups = {cracky = 1, level = 2},
963 sounds = default.node_sound_metal_defaults(),
967 minetest.register_node("default:stone_with_copper", {
968 description = "Copper Ore",
969 tiles = {"default_stone.png^default_mineral_copper.png"},
970 groups = {cracky = 2},
971 drop = 'default:copper_lump',
972 sounds = default.node_sound_stone_defaults(),
975 minetest.register_node("default:copperblock", {
976 description = "Copper Block",
977 tiles = {"default_copper_block.png"},
978 is_ground_content = false,
979 groups = {cracky = 1, level = 2},
980 sounds = default.node_sound_metal_defaults(),
983 minetest.register_node("default:bronzeblock", {
984 description = "Bronze Block",
985 tiles = {"default_bronze_block.png"},
986 is_ground_content = false,
987 groups = {cracky = 1, level = 2},
988 sounds = default.node_sound_metal_defaults(),
992 minetest.register_node("default:stone_with_mese", {
993 description = "Mese Ore",
994 tiles = {"default_stone.png^default_mineral_mese.png"},
995 groups = {cracky = 1},
996 drop = "default:mese_crystal",
997 sounds = default.node_sound_stone_defaults(),
1000 minetest.register_node("default:mese", {
1001 description = "Mese Block",
1002 tiles = {"default_mese_block.png"},
1003 paramtype = "light",
1004 groups = {cracky = 1, level = 2},
1005 sounds = default.node_sound_stone_defaults(),
1010 minetest.register_node("default:stone_with_gold", {
1011 description = "Gold Ore",
1012 tiles = {"default_stone.png^default_mineral_gold.png"},
1013 groups = {cracky = 2},
1014 drop = "default:gold_lump",
1015 sounds = default.node_sound_stone_defaults(),
1018 minetest.register_node("default:goldblock", {
1019 description = "Gold Block",
1020 tiles = {"default_gold_block.png"},
1021 is_ground_content = false,
1022 groups = {cracky = 1},
1023 sounds = default.node_sound_metal_defaults(),
1027 minetest.register_node("default:stone_with_diamond", {
1028 description = "Diamond Ore",
1029 tiles = {"default_stone.png^default_mineral_diamond.png"},
1030 groups = {cracky = 1},
1031 drop = "default:diamond",
1032 sounds = default.node_sound_stone_defaults(),
1035 minetest.register_node("default:diamondblock", {
1036 description = "Diamond Block",
1037 tiles = {"default_diamond_block.png"},
1038 is_ground_content = false,
1039 groups = {cracky = 1, level = 3},
1040 sounds = default.node_sound_stone_defaults(),
1044 -- Plantlife (non-cubic)
1047 minetest.register_node("default:cactus", {
1048 description = "Cactus",
1049 tiles = {"default_cactus_top.png", "default_cactus_top.png",
1050 "default_cactus_side.png"},
1051 paramtype2 = "facedir",
1052 groups = {choppy = 3},
1053 sounds = default.node_sound_wood_defaults(),
1054 on_place = minetest.rotate_node,
1057 minetest.register_node("default:papyrus", {
1058 description = "Papyrus",
1059 drawtype = "plantlike",
1060 tiles = {"default_papyrus.png"},
1061 inventory_image = "default_papyrus.png",
1062 wield_image = "default_papyrus.png",
1063 paramtype = "light",
1064 sunlight_propagates = true,
1068 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16},
1070 groups = {snappy = 3, flammable = 2},
1071 sounds = default.node_sound_leaves_defaults(),
1073 after_dig_node = function(pos, node, metadata, digger)
1074 default.dig_up(pos, node, digger)
1078 minetest.register_node("default:dry_shrub", {
1079 description = "Dry Shrub",
1080 drawtype = "plantlike",
1083 tiles = {"default_dry_shrub.png"},
1084 inventory_image = "default_dry_shrub.png",
1085 wield_image = "default_dry_shrub.png",
1086 paramtype = "light",
1087 sunlight_propagates = true,
1089 buildable_to = true,
1090 groups = {snappy = 3, flammable = 3, attached_node = 1},
1091 sounds = default.node_sound_leaves_defaults(),
1094 fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 4 / 16, 5 / 16},
1098 minetest.register_node("default:junglegrass", {
1099 description = "Jungle Grass",
1100 drawtype = "plantlike",
1103 tiles = {"default_junglegrass.png"},
1104 inventory_image = "default_junglegrass.png",
1105 wield_image = "default_junglegrass.png",
1106 paramtype = "light",
1107 sunlight_propagates = true,
1109 buildable_to = true,
1110 groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1, flammable = 1},
1111 sounds = default.node_sound_leaves_defaults(),
1114 fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 1.19, 7 / 16},
1119 minetest.register_node("default:grass_1", {
1120 description = "Grass",
1121 drawtype = "plantlike",
1123 tiles = {"default_grass_1.png"},
1124 -- Use texture of a taller grass stage in inventory
1125 inventory_image = "default_grass_3.png",
1126 wield_image = "default_grass_3.png",
1127 paramtype = "light",
1128 sunlight_propagates = true,
1130 buildable_to = true,
1131 groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1, flammable = 1},
1132 sounds = default.node_sound_leaves_defaults(),
1135 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -5 / 16, 6 / 16},
1138 on_place = function(itemstack, placer, pointed_thing)
1139 -- place a random grass node
1140 local stack = ItemStack("default:grass_" .. math.random(1,5))
1141 local ret = minetest.item_place(stack, placer, pointed_thing)
1142 return ItemStack("default:grass_1 " ..
1143 itemstack:get_count() - (1 - ret:get_count()))
1148 minetest.register_node("default:grass_" .. i, {
1149 description = "Grass",
1150 drawtype = "plantlike",
1152 tiles = {"default_grass_" .. i .. ".png"},
1153 inventory_image = "default_grass_" .. i .. ".png",
1154 wield_image = "default_grass_" .. i .. ".png",
1155 paramtype = "light",
1156 sunlight_propagates = true,
1158 buildable_to = true,
1159 drop = "default:grass_1",
1160 groups = {snappy = 3, flora = 1, attached_node = 1,
1161 not_in_creative_inventory = 1, grass = 1, flammable = 1},
1162 sounds = default.node_sound_leaves_defaults(),
1165 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -3 / 16, 6 / 16},
1171 minetest.register_node("default:dry_grass_1", {
1172 description = "Dry Grass",
1173 drawtype = "plantlike",
1175 tiles = {"default_dry_grass_1.png"},
1176 inventory_image = "default_dry_grass_3.png",
1177 wield_image = "default_dry_grass_3.png",
1178 paramtype = "light",
1179 sunlight_propagates = true,
1181 buildable_to = true,
1182 groups = {snappy = 3, flammable = 3, flora = 1,
1183 attached_node = 1, dry_grass = 1},
1184 sounds = default.node_sound_leaves_defaults(),
1187 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -3 / 16, 6 / 16},
1190 on_place = function(itemstack, placer, pointed_thing)
1191 -- place a random dry grass node
1192 local stack = ItemStack("default:dry_grass_" .. math.random(1, 5))
1193 local ret = minetest.item_place(stack, placer, pointed_thing)
1194 return ItemStack("default:dry_grass_1 " ..
1195 itemstack:get_count() - (1 - ret:get_count()))
1200 minetest.register_node("default:dry_grass_" .. i, {
1201 description = "Dry Grass",
1202 drawtype = "plantlike",
1204 tiles = {"default_dry_grass_" .. i .. ".png"},
1205 inventory_image = "default_dry_grass_" .. i .. ".png",
1206 wield_image = "default_dry_grass_" .. i .. ".png",
1207 paramtype = "light",
1208 sunlight_propagates = true,
1210 buildable_to = true,
1211 groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1,
1212 not_in_creative_inventory=1, dry_grass = 1},
1213 drop = "default:dry_grass_1",
1214 sounds = default.node_sound_leaves_defaults(),
1217 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -1 / 16, 6 / 16},
1223 minetest.register_node("default:bush_stem", {
1224 description = "Bush Stem",
1225 drawtype = "plantlike",
1226 visual_scale = 1.18,
1227 tiles = {"default_bush_stem.png"},
1228 inventory_image = "default_bush_stem.png",
1229 wield_image = "default_bush_stem.png",
1230 paramtype = "light",
1231 sunlight_propagates = true,
1232 groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
1233 sounds = default.node_sound_wood_defaults(),
1236 fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.54, 7 / 16},
1240 minetest.register_node("default:bush_leaves", {
1241 description = "Bush Leaves",
1242 drawtype = "allfaces_optional",
1244 tiles = {"default_leaves_simple.png"},
1245 paramtype = "light",
1246 groups = {snappy = 3, flammable = 2, leaves = 1},
1247 sounds = default.node_sound_leaves_defaults(),
1250 minetest.register_node("default:acacia_bush_stem", {
1251 description = "Acacia Bush Stem",
1252 drawtype = "plantlike",
1253 visual_scale = 1.18,
1254 tiles = {"default_acacia_bush_stem.png"},
1255 inventory_image = "default_acacia_bush_stem.png",
1256 wield_image = "default_acacia_bush_stem.png",
1257 paramtype = "light",
1258 sunlight_propagates = true,
1259 groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
1260 sounds = default.node_sound_wood_defaults(),
1263 fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.54, 7 / 16},
1267 minetest.register_node("default:acacia_bush_leaves", {
1268 description = "Acacia Bush Leaves",
1269 drawtype = "allfaces_optional",
1271 tiles = {"default_acacia_leaves_simple.png"},
1272 paramtype = "light",
1273 groups = {snappy = 3, flammable = 2, leaves = 1},
1274 sounds = default.node_sound_leaves_defaults(),
1282 minetest.register_node("default:coral_brown", {
1283 description = "Brown Coral",
1284 tiles = {"default_coral_brown.png"},
1285 groups = {cracky = 3},
1286 drop = "default:coral_skeleton",
1287 sounds = default.node_sound_stone_defaults(),
1290 minetest.register_node("default:coral_orange", {
1291 description = "Orange Coral",
1292 tiles = {"default_coral_orange.png"},
1293 groups = {cracky = 3},
1294 drop = "default:coral_skeleton",
1295 sounds = default.node_sound_stone_defaults(),
1298 minetest.register_node("default:coral_skeleton", {
1299 description = "Coral Skeleton",
1300 tiles = {"default_coral_skeleton.png"},
1301 groups = {cracky = 3},
1302 sounds = default.node_sound_stone_defaults(),
1310 minetest.register_node("default:water_source", {
1311 description = "Water Source",
1312 drawtype = "liquid",
1315 name = "default_water_source_animated.png",
1317 type = "vertical_frames",
1325 -- New-style water source material (mostly unused)
1327 name = "default_water_source_animated.png",
1329 type = "vertical_frames",
1334 backface_culling = false,
1338 paramtype = "light",
1342 buildable_to = true,
1343 is_ground_content = false,
1346 liquidtype = "source",
1347 liquid_alternative_flowing = "default:water_flowing",
1348 liquid_alternative_source = "default:water_source",
1349 liquid_viscosity = 1,
1350 post_effect_color = {a = 103, r = 30, g = 60, b = 90},
1351 groups = {water = 3, liquid = 3, puts_out_fire = 1, cools_lava = 1},
1352 sounds = default.node_sound_water_defaults(),
1355 minetest.register_node("default:water_flowing", {
1356 description = "Flowing Water",
1357 drawtype = "flowingliquid",
1358 tiles = {"default_water.png"},
1361 name = "default_water_flowing_animated.png",
1362 backface_culling = false,
1364 type = "vertical_frames",
1371 name = "default_water_flowing_animated.png",
1372 backface_culling = true,
1374 type = "vertical_frames",
1382 paramtype = "light",
1383 paramtype2 = "flowingliquid",
1387 buildable_to = true,
1388 is_ground_content = false,
1391 liquidtype = "flowing",
1392 liquid_alternative_flowing = "default:water_flowing",
1393 liquid_alternative_source = "default:water_source",
1394 liquid_viscosity = 1,
1395 post_effect_color = {a = 103, r = 30, g = 60, b = 90},
1396 groups = {water = 3, liquid = 3, puts_out_fire = 1,
1397 not_in_creative_inventory = 1, cools_lava = 1},
1398 sounds = default.node_sound_water_defaults(),
1402 minetest.register_node("default:river_water_source", {
1403 description = "River Water Source",
1404 drawtype = "liquid",
1407 name = "default_river_water_source_animated.png",
1409 type = "vertical_frames",
1418 name = "default_river_water_source_animated.png",
1420 type = "vertical_frames",
1425 backface_culling = false,
1429 paramtype = "light",
1433 buildable_to = true,
1434 is_ground_content = false,
1437 liquidtype = "source",
1438 liquid_alternative_flowing = "default:river_water_flowing",
1439 liquid_alternative_source = "default:river_water_source",
1440 liquid_viscosity = 1,
1441 liquid_renewable = false,
1443 post_effect_color = {a = 103, r = 30, g = 76, b = 90},
1444 groups = {water = 3, liquid = 3, puts_out_fire = 1, cools_lava = 1},
1445 sounds = default.node_sound_water_defaults(),
1448 minetest.register_node("default:river_water_flowing", {
1449 description = "Flowing River Water",
1450 drawtype = "flowingliquid",
1451 tiles = {"default_river_water.png"},
1454 name = "default_river_water_flowing_animated.png",
1455 backface_culling = false,
1457 type = "vertical_frames",
1464 name = "default_river_water_flowing_animated.png",
1465 backface_culling = true,
1467 type = "vertical_frames",
1475 paramtype = "light",
1476 paramtype2 = "flowingliquid",
1480 buildable_to = true,
1481 is_ground_content = false,
1484 liquidtype = "flowing",
1485 liquid_alternative_flowing = "default:river_water_flowing",
1486 liquid_alternative_source = "default:river_water_source",
1487 liquid_viscosity = 1,
1488 liquid_renewable = false,
1490 post_effect_color = {a = 103, r = 30, g = 76, b = 90},
1491 groups = {water = 3, liquid = 3, puts_out_fire = 1,
1492 not_in_creative_inventory = 1, cools_lava = 1},
1493 sounds = default.node_sound_water_defaults(),
1497 minetest.register_node("default:lava_source", {
1498 description = "Lava Source",
1499 drawtype = "liquid",
1502 name = "default_lava_source_animated.png",
1504 type = "vertical_frames",
1512 -- New-style lava source material (mostly unused)
1514 name = "default_lava_source_animated.png",
1516 type = "vertical_frames",
1521 backface_culling = false,
1524 paramtype = "light",
1525 light_source = default.LIGHT_MAX - 1,
1529 buildable_to = true,
1530 is_ground_content = false,
1533 liquidtype = "source",
1534 liquid_alternative_flowing = "default:lava_flowing",
1535 liquid_alternative_source = "default:lava_source",
1536 liquid_viscosity = 7,
1537 liquid_renewable = false,
1538 damage_per_second = 4 * 2,
1539 post_effect_color = {a = 191, r = 255, g = 64, b = 0},
1540 groups = {lava = 3, liquid = 2, igniter = 1},
1543 minetest.register_node("default:lava_flowing", {
1544 description = "Flowing Lava",
1545 drawtype = "flowingliquid",
1546 tiles = {"default_lava.png"},
1549 name = "default_lava_flowing_animated.png",
1550 backface_culling = false,
1552 type = "vertical_frames",
1559 name = "default_lava_flowing_animated.png",
1560 backface_culling = true,
1562 type = "vertical_frames",
1569 paramtype = "light",
1570 paramtype2 = "flowingliquid",
1571 light_source = default.LIGHT_MAX - 1,
1575 buildable_to = true,
1576 is_ground_content = false,
1579 liquidtype = "flowing",
1580 liquid_alternative_flowing = "default:lava_flowing",
1581 liquid_alternative_source = "default:lava_source",
1582 liquid_viscosity = 7,
1583 liquid_renewable = false,
1584 damage_per_second = 4 * 2,
1585 post_effect_color = {a = 191, r = 255, g = 64, b = 0},
1586 groups = {lava = 3, liquid = 2, igniter = 1,
1587 not_in_creative_inventory = 1},
1591 -- Tools / "Advanced" crafting / Non-"natural"
1594 local chest_formspec =
1597 default.gui_bg_img ..
1598 default.gui_slots ..
1599 "list[current_name;main;0,0.3;8,4;]" ..
1600 "list[current_player;main;0,4.85;8,1;]" ..
1601 "list[current_player;main;0,6.08;8,3;8]" ..
1602 "listring[current_name;main]" ..
1603 "listring[current_player;main]" ..
1604 default.get_hotbar_bg(0,4.85)
1606 local function get_locked_chest_formspec(pos)
1607 local spos = pos.x .. "," .. pos.y .. "," .. pos.z
1611 default.gui_bg_img ..
1612 default.gui_slots ..
1613 "list[nodemeta:" .. spos .. ";main;0,0.3;8,4;]" ..
1614 "list[current_player;main;0,4.85;8,1;]" ..
1615 "list[current_player;main;0,6.08;8,3;8]" ..
1616 "listring[nodemeta:" .. spos .. ";main]" ..
1617 "listring[current_player;main]" ..
1618 default.get_hotbar_bg(0,4.85)
1622 local function has_locked_chest_privilege(meta, player)
1624 if minetest.check_player_privs(player, "protection_bypass") then
1631 -- is player wielding the right key?
1632 local item = player:get_wielded_item()
1633 if item:get_name() == "default:key" then
1634 local key_meta = minetest.parse_json(item:get_metadata())
1635 local secret = meta:get_string("key_lock_secret")
1636 if secret ~= key_meta.secret then
1643 if player:get_player_name() ~= meta:get_string("owner") then
1650 minetest.register_node("default:chest", {
1651 description = "Chest",
1652 tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
1653 "default_chest_side.png", "default_chest_side.png", "default_chest_front.png"},
1654 paramtype2 = "facedir",
1655 groups = {choppy = 2, oddly_breakable_by_hand = 2},
1656 legacy_facedir_simple = true,
1657 is_ground_content = false,
1658 sounds = default.node_sound_wood_defaults(),
1660 on_construct = function(pos)
1661 local meta = minetest.get_meta(pos)
1662 meta:set_string("formspec", chest_formspec)
1663 local inv = meta:get_inventory()
1664 inv:set_size("main", 8*4)
1666 can_dig = function(pos,player)
1667 local meta = minetest.get_meta(pos);
1668 local inv = meta:get_inventory()
1669 return inv:is_empty("main")
1671 on_metadata_inventory_move = function(pos, from_list, from_index,
1672 to_list, to_index, count, player)
1673 minetest.log("action", player:get_player_name() ..
1674 " moves stuff in chest at " .. minetest.pos_to_string(pos))
1676 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1677 minetest.log("action", player:get_player_name() ..
1678 " moves " .. stack:get_name() ..
1679 " to chest at " .. minetest.pos_to_string(pos))
1681 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1682 minetest.log("action", player:get_player_name() ..
1683 " takes " .. stack:get_name() ..
1684 " from chest at " .. minetest.pos_to_string(pos))
1686 on_blast = function(pos)
1688 default.get_inventory_drops(pos, "main", drops)
1689 drops[#drops+1] = "default:chest"
1690 minetest.remove_node(pos)
1695 minetest.register_node("default:chest_locked", {
1696 description = "Locked Chest",
1697 tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
1698 "default_chest_side.png", "default_chest_side.png", "default_chest_lock.png"},
1699 paramtype2 = "facedir",
1700 groups = {choppy = 2, oddly_breakable_by_hand = 2},
1701 legacy_facedir_simple = true,
1702 is_ground_content = false,
1703 sounds = default.node_sound_wood_defaults(),
1705 after_place_node = function(pos, placer)
1706 local meta = minetest.get_meta(pos)
1707 meta:set_string("owner", placer:get_player_name() or "")
1708 meta:set_string("infotext", "Locked Chest (owned by " ..
1709 meta:get_string("owner") .. ")")
1711 on_construct = function(pos)
1712 local meta = minetest.get_meta(pos)
1713 meta:set_string("owner", "")
1714 local inv = meta:get_inventory()
1715 inv:set_size("main", 8 * 4)
1717 can_dig = function(pos,player)
1718 local meta = minetest.get_meta(pos);
1719 local inv = meta:get_inventory()
1720 return inv:is_empty("main") and has_locked_chest_privilege(meta, player)
1722 allow_metadata_inventory_move = function(pos, from_list, from_index,
1723 to_list, to_index, count, player)
1724 local meta = minetest.get_meta(pos)
1725 if not has_locked_chest_privilege(meta, player) then
1730 allow_metadata_inventory_put = 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 allow_metadata_inventory_take = function(pos, listname, index, stack, player)
1738 local meta = minetest.get_meta(pos)
1739 if not has_locked_chest_privilege(meta, player) then
1742 return stack:get_count()
1744 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1745 minetest.log("action", player:get_player_name() ..
1746 " moves " .. stack:get_name() ..
1747 " to locked chest at " .. minetest.pos_to_string(pos))
1749 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1750 minetest.log("action", player:get_player_name() ..
1751 " takes " .. stack:get_name() ..
1752 " from locked chest at " .. minetest.pos_to_string(pos))
1754 on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
1755 local meta = minetest.get_meta(pos)
1756 if has_locked_chest_privilege(meta, clicker) then
1757 minetest.show_formspec(
1758 clicker:get_player_name(),
1759 "default:chest_locked",
1760 get_locked_chest_formspec(pos)
1765 on_blast = function() end,
1766 on_key_use = function(pos, player)
1767 local secret = minetest.get_meta(pos):get_string("key_lock_secret")
1768 local itemstack = player:get_wielded_item()
1769 local key_meta = minetest.parse_json(itemstack:get_metadata())
1771 if secret ~= key_meta.secret then
1775 minetest.show_formspec(
1776 player:get_player_name(),
1777 "default:chest_locked",
1778 get_locked_chest_formspec(pos)
1781 on_skeleton_key_use = function(pos, player, newsecret)
1782 local meta = minetest.get_meta(pos)
1783 local owner = meta:get_string("owner")
1784 local name = player:get_player_name()
1786 -- verify placer is owner of lockable chest
1787 if owner ~= name then
1788 minetest.record_protection_violation(pos, name)
1789 minetest.chat_send_player(name, "You do not own this chest.")
1793 local secret = meta:get_string("key_lock_secret")
1794 if secret == "" then
1796 meta:set_string("key_lock_secret", secret)
1799 return secret, "a locked chest", owner
1804 local bookshelf_formspec =
1807 default.gui_bg_img ..
1808 default.gui_slots ..
1809 "list[context;books;0,0.3;8,2;]" ..
1810 "list[current_player;main;0,2.85;8,1;]" ..
1811 "list[current_player;main;0,4.08;8,3;8]" ..
1812 "listring[context;books]" ..
1813 "listring[current_player;main]" ..
1814 default.get_hotbar_bg(0,2.85)
1816 local function get_bookshelf_formspec(inv)
1817 local formspec = bookshelf_formspec
1818 local invlist = inv and inv:get_list("books")
1819 -- Inventory slots overlay
1820 local bx, by = 0, 0.3
1826 if not invlist or invlist[i]:is_empty() then
1827 formspec = formspec ..
1828 "image[" .. bx .. "," .. by .. ";1,1;default_bookshelf_slot.png]"
1835 minetest.register_node("default:bookshelf", {
1836 description = "Bookshelf",
1837 tiles = {"default_wood.png", "default_wood.png", "default_wood.png",
1838 "default_wood.png", "default_bookshelf.png", "default_bookshelf.png"},
1839 paramtype2 = "facedir",
1840 is_ground_content = false,
1841 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
1842 sounds = default.node_sound_wood_defaults(),
1844 on_construct = function(pos)
1845 local meta = minetest.get_meta(pos)
1846 meta:set_string("formspec", get_bookshelf_formspec(nil))
1847 local inv = meta:get_inventory()
1848 inv:set_size("books", 8 * 2)
1850 can_dig = function(pos,player)
1851 local inv = minetest.get_meta(pos):get_inventory()
1852 return inv:is_empty("books")
1854 allow_metadata_inventory_put = function(pos, listname, index, stack)
1855 if minetest.get_item_group(stack:get_name(), "book") ~= 0 then
1856 return stack:get_count()
1860 on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
1861 minetest.log("action", player:get_player_name() ..
1862 " moves stuff in bookshelf at " .. minetest.pos_to_string(pos))
1863 local meta = minetest.get_meta(pos)
1864 meta:set_string("formspec", get_bookshelf_formspec(meta:get_inventory()))
1866 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1867 minetest.log("action", player:get_player_name() ..
1868 " moves stuff to bookshelf at " .. minetest.pos_to_string(pos))
1869 local meta = minetest.get_meta(pos)
1870 meta:set_string("formspec", get_bookshelf_formspec(meta:get_inventory()))
1872 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1873 minetest.log("action", player:get_player_name() ..
1874 " takes stuff from bookshelf at " .. minetest.pos_to_string(pos))
1875 local meta = minetest.get_meta(pos)
1876 meta:set_string("formspec", get_bookshelf_formspec(meta:get_inventory()))
1878 on_blast = function(pos)
1880 default.get_inventory_drops(pos, "books", drops)
1881 drops[#drops+1] = "default:bookshelf"
1882 minetest.remove_node(pos)
1887 local function register_sign(material, desc, def)
1888 minetest.register_node("default:sign_wall_" .. material, {
1889 description = desc .. " Sign",
1890 drawtype = "nodebox",
1891 tiles = {"default_sign_wall_" .. material .. ".png"},
1892 inventory_image = "default_sign_" .. material .. ".png",
1893 wield_image = "default_sign_" .. material .. ".png",
1894 paramtype = "light",
1895 paramtype2 = "wallmounted",
1896 sunlight_propagates = true,
1897 is_ground_content = false,
1900 type = "wallmounted",
1901 wall_top = {-0.4375, 0.4375, -0.3125, 0.4375, 0.5, 0.3125},
1902 wall_bottom = {-0.4375, -0.5, -0.3125, 0.4375, -0.4375, 0.3125},
1903 wall_side = {-0.5, -0.3125, -0.4375, -0.4375, 0.3125, 0.4375},
1905 groups = def.groups,
1906 legacy_wallmounted = true,
1907 sounds = def.sounds,
1909 on_construct = function(pos)
1910 --local n = minetest.get_node(pos)
1911 local meta = minetest.get_meta(pos)
1912 meta:set_string("formspec", "field[text;;${text}]")
1914 on_receive_fields = function(pos, formname, fields, sender)
1915 --print("Sign at "..minetest.pos_to_string(pos).." got "..dump(fields))
1916 local player_name = sender:get_player_name()
1917 if minetest.is_protected(pos, player_name) then
1918 minetest.record_protection_violation(pos, player_name)
1921 local meta = minetest.get_meta(pos)
1922 if not fields.text then return end
1923 minetest.log("action", (player_name or "") .. " wrote \"" ..
1924 fields.text .. "\" to sign at " .. minetest.pos_to_string(pos))
1925 meta:set_string("text", fields.text)
1926 meta:set_string("infotext", '"' .. fields.text .. '"')
1931 register_sign("wood", "Wooden", {
1932 sounds = default.node_sound_wood_defaults(),
1933 groups = {choppy = 2, attached_node = 1, flammable = 2, oddly_breakable_by_hand = 3}
1936 register_sign("steel", "Steel", {
1937 sounds = default.node_sound_metal_defaults(),
1938 groups = {cracky = 2, attached_node = 1}
1941 minetest.register_node("default:ladder_wood", {
1942 description = "Wooden Ladder",
1943 drawtype = "signlike",
1944 tiles = {"default_ladder_wood.png"},
1945 inventory_image = "default_ladder_wood.png",
1946 wield_image = "default_ladder_wood.png",
1947 paramtype = "light",
1948 paramtype2 = "wallmounted",
1949 sunlight_propagates = true,
1952 is_ground_content = false,
1954 type = "wallmounted",
1955 --wall_top = = <default>
1956 --wall_bottom = = <default>
1957 --wall_side = = <default>
1959 groups = {choppy = 2, oddly_breakable_by_hand = 3, flammable = 2},
1960 legacy_wallmounted = true,
1961 sounds = default.node_sound_wood_defaults(),
1964 minetest.register_node("default:ladder_steel", {
1965 description = "Steel Ladder",
1966 drawtype = "signlike",
1967 tiles = {"default_ladder_steel.png"},
1968 inventory_image = "default_ladder_steel.png",
1969 wield_image = "default_ladder_steel.png",
1970 paramtype = "light",
1971 paramtype2 = "wallmounted",
1972 sunlight_propagates = true,
1975 is_ground_content = false,
1977 type = "wallmounted",
1978 --wall_top = = <default>
1979 --wall_bottom = = <default>
1980 --wall_side = = <default>
1982 groups = {cracky = 2},
1983 sounds = default.node_sound_metal_defaults(),
1986 default.register_fence("default:fence_wood", {
1987 description = "Wooden Fence",
1988 texture = "default_fence_wood.png",
1989 inventory_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1990 wield_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1991 material = "default:wood",
1992 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
1993 sounds = default.node_sound_wood_defaults()
1996 default.register_fence("default:fence_acacia_wood", {
1997 description = "Acacia Fence",
1998 texture = "default_fence_acacia_wood.png",
1999 inventory_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2000 wield_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2001 material = "default:acacia_wood",
2002 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
2003 sounds = default.node_sound_wood_defaults()
2006 default.register_fence("default:fence_junglewood", {
2007 description = "Junglewood Fence",
2008 texture = "default_fence_junglewood.png",
2009 inventory_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126",
2010 wield_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126",
2011 material = "default:junglewood",
2012 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
2013 sounds = default.node_sound_wood_defaults()
2016 default.register_fence("default:fence_pine_wood", {
2017 description = "Pine Fence",
2018 texture = "default_fence_pine_wood.png",
2019 inventory_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2020 wield_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2021 material = "default:pine_wood",
2022 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
2023 sounds = default.node_sound_wood_defaults()
2026 default.register_fence("default:fence_aspen_wood", {
2027 description = "Aspen Fence",
2028 texture = "default_fence_aspen_wood.png",
2029 inventory_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2030 wield_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2031 material = "default:aspen_wood",
2032 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
2033 sounds = default.node_sound_wood_defaults()
2036 minetest.register_node("default:glass", {
2037 description = "Glass",
2038 drawtype = "glasslike_framed_optional",
2039 tiles = {"default_glass.png", "default_glass_detail.png"},
2040 paramtype = "light",
2041 sunlight_propagates = true,
2042 is_ground_content = false,
2043 groups = {cracky = 3, oddly_breakable_by_hand = 3},
2044 sounds = default.node_sound_glass_defaults(),
2047 minetest.register_node("default:obsidian_glass", {
2048 description = "Obsidian Glass",
2049 drawtype = "glasslike_framed_optional",
2050 tiles = {"default_obsidian_glass.png", "default_obsidian_glass_detail.png"},
2051 paramtype = "light",
2052 is_ground_content = false,
2053 sunlight_propagates = true,
2054 sounds = default.node_sound_glass_defaults(),
2055 groups = {cracky = 3},
2059 minetest.register_node("default:brick", {
2060 description = "Brick Block",
2061 paramtype2 = "facedir",
2063 tiles = {"default_brick.png"},
2064 is_ground_content = false,
2065 groups = {cracky = 3},
2066 sounds = default.node_sound_stone_defaults(),
2070 minetest.register_node("default:meselamp", {
2071 description = "Mese Lamp",
2072 drawtype = "glasslike",
2073 tiles = {"default_meselamp.png"},
2074 paramtype = "light",
2075 sunlight_propagates = true,
2076 is_ground_content = false,
2077 groups = {cracky = 3, oddly_breakable_by_hand = 3},
2078 sounds = default.node_sound_glass_defaults(),
2079 light_source = default.LIGHT_MAX,
2082 minetest.register_node("default:mese_post_light", {
2083 description = "Mese Post Light",
2084 tiles = {"default_mese_post_light_top.png", "default_mese_post_light_top.png",
2085 "default_mese_post_light_side_dark.png", "default_mese_post_light_side_dark.png",
2086 "default_mese_post_light_side.png", "default_mese_post_light_side.png"},
2087 wield_image = "default_mese_post_light_side.png",
2088 drawtype = "nodebox",
2092 {-2 / 16, -8 / 16, -2 / 16, 2 / 16, 8 / 16, 2 / 16},
2095 paramtype = "light",
2096 light_source = default.LIGHT_MAX,
2097 sunlight_propagates = true,
2098 is_ground_content = false,
2099 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
2100 sounds = default.node_sound_wood_defaults(),
2107 minetest.register_node("default:cloud", {
2108 description = "Cloud",
2109 tiles = {"default_cloud.png"},
2110 is_ground_content = false,
2111 sounds = default.node_sound_defaults(),
2112 groups = {not_in_creative_inventory = 1},