1 -- mods/default/nodes.lua
4 --[[ Node name convention:
6 Although many node names are in combined-word form, the required form for new
7 node names is words separated by underscores. If both forms are used in written
8 language (for example pinewood and pine wood) the underscore form should be used.
17 (1. Material 2. Cobble variant 3. Brick variant 4. Modified forms)
27 default:desert_stonebrick
28 default:desert_stone_block
31 default:sandstonebrick
32 default:sandstone_block
36 default:obsidian_block
40 (1. Material 2. Modified forms)
43 default:dirt_with_grass
44 default:dirt_with_grass_footsteps
45 default:dirt_with_dry_grass
46 default:dirt_with_snow
63 (1. Trunk 2. Fabricated trunk 3. Leaves 4. Sapling 5. Fruits)
84 default:acacia_sapling
93 (1. In stone 2. Blocks)
95 default:stone_with_coal
98 default:stone_with_iron
101 default:stone_with_copper
105 default:stone_with_gold
108 default:stone_with_mese
111 default:stone_with_diamond
136 default:acacia_bush_stem
137 default:acacia_bush_leaves
144 default:coral_skeleton
148 (1. Source 2. Flowing)
151 default:water_flowing
153 default:river_water_source
154 default:river_water_flowing
159 Tools / "Advanced" crafting / Non-"natural"
160 -------------------------------------------
169 default:sign_wall_wood
170 default:sign_wall_steel
176 default:fence_acacia_wood
177 default:fence_junglewood
178 default:fence_pine_wood
179 default:fence_aspen_wood
182 default:obsidian_glass
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},
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:sand", {
391 description = "Sand",
392 tiles = {"default_sand.png"},
393 groups = {crumbly = 3, falling_node = 1, sand = 1},
394 sounds = default.node_sound_sand_defaults(),
397 minetest.register_node("default:desert_sand", {
398 description = "Desert Sand",
399 tiles = {"default_desert_sand.png"},
400 groups = {crumbly = 3, falling_node = 1, sand = 1},
401 sounds = default.node_sound_sand_defaults(),
404 minetest.register_node("default:silver_sand", {
405 description = "Silver Sand",
406 tiles = {"default_silver_sand.png"},
407 groups = {crumbly = 3, falling_node = 1, sand = 1},
408 sounds = default.node_sound_sand_defaults(),
412 minetest.register_node("default:gravel", {
413 description = "Gravel",
414 tiles = {"default_gravel.png"},
415 groups = {crumbly = 2, falling_node = 1},
416 sounds = default.node_sound_gravel_defaults(),
420 {items = {'default:flint'}, rarity = 16},
421 {items = {'default:gravel'}}
426 minetest.register_node("default:clay", {
427 description = "Clay",
428 tiles = {"default_clay.png"},
429 groups = {crumbly = 3},
430 drop = 'default:clay_lump 4',
431 sounds = default.node_sound_dirt_defaults(),
435 minetest.register_node("default:snow", {
436 description = "Snow",
437 tiles = {"default_snow.png"},
438 inventory_image = "default_snowball.png",
439 wield_image = "default_snowball.png",
443 drawtype = "nodebox",
447 {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
450 groups = {crumbly = 3, falling_node = 1, puts_out_fire = 1},
451 sounds = default.node_sound_dirt_defaults({
452 footstep = {name = "default_snow_footstep", gain = 0.15},
453 dug = {name = "default_snow_footstep", gain = 0.2},
454 dig = {name = "default_snow_footstep", gain = 0.2}
457 on_construct = function(pos)
459 if minetest.get_node(pos).name == "default:dirt_with_grass" then
460 minetest.set_node(pos, {name = "default:dirt_with_snow"})
465 minetest.register_node("default:snowblock", {
466 description = "Snow Block",
467 tiles = {"default_snow.png"},
468 groups = {crumbly = 3, puts_out_fire = 1, cools_lava = 1},
469 sounds = default.node_sound_dirt_defaults({
470 footstep = {name = "default_snow_footstep", gain = 0.15},
471 dug = {name = "default_snow_footstep", gain = 0.2},
472 dig = {name = "default_snow_footstep", gain = 0.2}
475 on_construct = function(pos)
477 if minetest.get_node(pos).name == "default:dirt_with_grass" then
478 minetest.set_node(pos, {name = "default:dirt_with_snow"})
483 minetest.register_node("default:ice", {
485 tiles = {"default_ice.png"},
486 is_ground_content = false,
488 groups = {cracky = 3, puts_out_fire = 1, cools_lava = 1},
489 sounds = default.node_sound_glass_defaults(),
496 minetest.register_node("default:tree", {
497 description = "Tree",
498 tiles = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"},
499 paramtype2 = "facedir",
500 is_ground_content = false,
501 groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
502 sounds = default.node_sound_wood_defaults(),
504 on_place = minetest.rotate_node
507 minetest.register_node("default:wood", {
508 description = "Wooden Planks",
509 paramtype2 = "facedir",
511 tiles = {"default_wood.png"},
512 is_ground_content = false,
513 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
514 sounds = default.node_sound_wood_defaults(),
517 minetest.register_node("default:sapling", {
518 description = "Sapling",
519 drawtype = "plantlike",
521 tiles = {"default_sapling.png"},
522 inventory_image = "default_sapling.png",
523 wield_image = "default_sapling.png",
525 sunlight_propagates = true,
527 on_timer = default.grow_sapling,
530 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
532 groups = {snappy = 2, dig_immediate = 3, flammable = 2,
533 attached_node = 1, sapling = 1},
534 sounds = default.node_sound_leaves_defaults(),
536 on_construct = function(pos)
537 minetest.get_node_timer(pos):start(math.random(2400,4800))
540 on_place = function(itemstack, placer, pointed_thing)
541 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
543 -- minp, maxp to be checked, relative to sapling pos
544 -- minp_relative.y = 1 because sapling pos has been checked
545 {x = -2, y = 1, z = -2},
546 {x = 2, y = 6, z = 2},
547 -- maximum interval of interior volume check
554 minetest.register_node("default:leaves", {
555 description = "Leaves",
556 drawtype = "allfaces_optional",
558 tiles = {"default_leaves.png"},
559 special_tiles = {"default_leaves_simple.png"},
561 is_ground_content = false,
562 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
567 -- player will get sapling with 1/20 chance
568 items = {'default:sapling'},
572 -- player will get leaves only if he get no saplings,
573 -- this is because max_items is 1
574 items = {'default:leaves'},
578 sounds = default.node_sound_leaves_defaults(),
580 after_place_node = default.after_place_leaves,
583 minetest.register_node("default:apple", {
584 description = "Apple",
585 drawtype = "plantlike",
587 tiles = {"default_apple.png"},
588 inventory_image = "default_apple.png",
590 sunlight_propagates = true,
592 is_ground_content = false,
595 fixed = {-3 / 16, -7 / 16, -3 / 16, 3 / 16, 4 / 16, 3 / 16}
597 groups = {fleshy = 3, dig_immediate = 3, flammable = 2,
598 leafdecay = 3, leafdecay_drop = 1},
599 on_use = minetest.item_eat(2),
600 sounds = default.node_sound_leaves_defaults(),
602 after_place_node = function(pos, placer, itemstack)
603 if placer:is_player() then
604 minetest.set_node(pos, {name = "default:apple", param2 = 1})
610 minetest.register_node("default:jungletree", {
611 description = "Jungle Tree",
612 tiles = {"default_jungletree_top.png", "default_jungletree_top.png",
613 "default_jungletree.png"},
614 paramtype2 = "facedir",
615 is_ground_content = false,
616 groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
617 sounds = default.node_sound_wood_defaults(),
619 on_place = minetest.rotate_node
622 minetest.register_node("default:junglewood", {
623 description = "Junglewood Planks",
624 paramtype2 = "facedir",
626 tiles = {"default_junglewood.png"},
627 is_ground_content = false,
628 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
629 sounds = default.node_sound_wood_defaults(),
632 minetest.register_node("default:jungleleaves", {
633 description = "Jungle Leaves",
634 drawtype = "allfaces_optional",
636 tiles = {"default_jungleleaves.png"},
637 special_tiles = {"default_jungleleaves_simple.png"},
639 is_ground_content = false,
640 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
644 {items = {'default:junglesapling'}, rarity = 20},
645 {items = {'default:jungleleaves'}}
648 sounds = default.node_sound_leaves_defaults(),
650 after_place_node = default.after_place_leaves,
653 minetest.register_node("default:junglesapling", {
654 description = "Jungle Sapling",
655 drawtype = "plantlike",
657 tiles = {"default_junglesapling.png"},
658 inventory_image = "default_junglesapling.png",
659 wield_image = "default_junglesapling.png",
661 sunlight_propagates = true,
663 on_timer = default.grow_sapling,
666 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
668 groups = {snappy = 2, dig_immediate = 3, flammable = 2,
669 attached_node = 1, sapling = 1},
670 sounds = default.node_sound_leaves_defaults(),
672 on_construct = function(pos)
673 minetest.get_node_timer(pos):start(math.random(2400,4800))
676 on_place = function(itemstack, placer, pointed_thing)
677 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
678 "default:junglesapling",
679 -- minp, maxp to be checked, relative to sapling pos
680 -- minp_relative.y = 1 because sapling pos has been checked
681 {x = -2, y = 1, z = -2},
682 {x = 2, y = 15, z = 2},
683 -- maximum interval of interior volume check
691 minetest.register_node("default:pine_tree", {
692 description = "Pine Tree",
693 tiles = {"default_pine_tree_top.png", "default_pine_tree_top.png",
694 "default_pine_tree.png"},
695 paramtype2 = "facedir",
696 is_ground_content = false,
697 groups = {tree = 1, choppy = 3, oddly_breakable_by_hand = 1, flammable = 3},
698 sounds = default.node_sound_wood_defaults(),
700 on_place = minetest.rotate_node
703 minetest.register_node("default:pine_wood", {
704 description = "Pine Wood Planks",
705 paramtype2 = "facedir",
707 tiles = {"default_pine_wood.png"},
708 is_ground_content = false,
709 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
710 sounds = default.node_sound_wood_defaults(),
713 minetest.register_node("default:pine_needles",{
714 description = "Pine Needles",
715 drawtype = "allfaces_optional",
716 tiles = {"default_pine_needles.png"},
719 is_ground_content = false,
720 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
724 {items = {"default:pine_sapling"}, rarity = 20},
725 {items = {"default:pine_needles"}}
728 sounds = default.node_sound_leaves_defaults(),
730 after_place_node = default.after_place_leaves,
733 minetest.register_node("default:pine_sapling", {
734 description = "Pine Sapling",
735 drawtype = "plantlike",
737 tiles = {"default_pine_sapling.png"},
738 inventory_image = "default_pine_sapling.png",
739 wield_image = "default_pine_sapling.png",
741 sunlight_propagates = true,
743 on_timer = default.grow_sapling,
746 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
748 groups = {snappy = 2, dig_immediate = 3, flammable = 3,
749 attached_node = 1, sapling = 1},
750 sounds = default.node_sound_leaves_defaults(),
752 on_construct = function(pos)
753 minetest.get_node_timer(pos):start(math.random(2400,4800))
756 on_place = function(itemstack, placer, pointed_thing)
757 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
758 "default:pine_sapling",
759 -- minp, maxp to be checked, relative to sapling pos
760 -- minp_relative.y = 1 because sapling pos has been checked
761 {x = -2, y = 1, z = -2},
762 {x = 2, y = 12, z = 2},
763 -- maximum interval of interior volume check
771 minetest.register_node("default:acacia_tree", {
772 description = "Acacia Tree",
773 tiles = {"default_acacia_tree_top.png", "default_acacia_tree_top.png",
774 "default_acacia_tree.png"},
775 paramtype2 = "facedir",
776 is_ground_content = false,
777 groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
778 sounds = default.node_sound_wood_defaults(),
780 on_place = minetest.rotate_node
783 minetest.register_node("default:acacia_wood", {
784 description = "Acacia Wood Planks",
785 paramtype2 = "facedir",
787 tiles = {"default_acacia_wood.png"},
788 is_ground_content = false,
789 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
790 sounds = default.node_sound_wood_defaults(),
793 minetest.register_node("default:acacia_leaves", {
794 description = "Acacia Leaves",
795 drawtype = "allfaces_optional",
796 tiles = {"default_acacia_leaves.png"},
797 special_tiles = {"default_acacia_leaves_simple.png"},
800 is_ground_content = false,
801 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
805 {items = {"default:acacia_sapling"}, rarity = 20},
806 {items = {"default:acacia_leaves"}}
809 sounds = default.node_sound_leaves_defaults(),
811 after_place_node = default.after_place_leaves,
814 minetest.register_node("default:acacia_sapling", {
815 description = "Acacia Tree Sapling",
816 drawtype = "plantlike",
818 tiles = {"default_acacia_sapling.png"},
819 inventory_image = "default_acacia_sapling.png",
820 wield_image = "default_acacia_sapling.png",
822 sunlight_propagates = true,
824 on_timer = default.grow_sapling,
827 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
829 groups = {snappy = 2, dig_immediate = 3, flammable = 2,
830 attached_node = 1, sapling = 1},
831 sounds = default.node_sound_leaves_defaults(),
833 on_construct = function(pos)
834 minetest.get_node_timer(pos):start(math.random(2400,4800))
837 on_place = function(itemstack, placer, pointed_thing)
838 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
839 "default:acacia_sapling",
840 -- minp, maxp to be checked, relative to sapling pos
841 -- minp_relative.y = 1 because sapling pos has been checked
842 {x = -4, y = 1, z = -4},
843 {x = 4, y = 6, z = 4},
844 -- maximum interval of interior volume check
851 minetest.register_node("default:aspen_tree", {
852 description = "Aspen Tree",
853 tiles = {"default_aspen_tree_top.png", "default_aspen_tree_top.png",
854 "default_aspen_tree.png"},
855 paramtype2 = "facedir",
856 is_ground_content = false,
857 groups = {tree = 1, choppy = 3, oddly_breakable_by_hand = 1, flammable = 3},
858 sounds = default.node_sound_wood_defaults(),
860 on_place = minetest.rotate_node
863 minetest.register_node("default:aspen_wood", {
864 description = "Aspen Wood Planks",
865 paramtype2 = "facedir",
867 tiles = {"default_aspen_wood.png"},
868 is_ground_content = false,
869 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
870 sounds = default.node_sound_wood_defaults(),
873 minetest.register_node("default:aspen_leaves", {
874 description = "Aspen Leaves",
875 drawtype = "allfaces_optional",
876 tiles = {"default_aspen_leaves.png"},
879 is_ground_content = false,
880 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
884 {items = {"default:aspen_sapling"}, rarity = 20},
885 {items = {"default:aspen_leaves"}}
888 sounds = default.node_sound_leaves_defaults(),
890 after_place_node = default.after_place_leaves,
893 minetest.register_node("default:aspen_sapling", {
894 description = "Aspen Tree Sapling",
895 drawtype = "plantlike",
897 tiles = {"default_aspen_sapling.png"},
898 inventory_image = "default_aspen_sapling.png",
899 wield_image = "default_aspen_sapling.png",
901 sunlight_propagates = true,
903 on_timer = default.grow_sapling,
906 fixed = {-3 / 16, -0.5, -3 / 16, 3 / 16, 0.5, 3 / 16}
908 groups = {snappy = 2, dig_immediate = 3, flammable = 3,
909 attached_node = 1, sapling = 1},
910 sounds = default.node_sound_leaves_defaults(),
912 on_construct = function(pos)
913 minetest.get_node_timer(pos):start(math.random(2400,4800))
916 on_place = function(itemstack, placer, pointed_thing)
917 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
918 "default:aspen_sapling",
919 -- minp, maxp to be checked, relative to sapling pos
920 -- minp_relative.y = 1 because sapling pos has been checked
921 {x = -2, y = 1, z = -2},
922 {x = 2, y = 12, z = 2},
923 -- maximum interval of interior volume check
934 minetest.register_node("default:stone_with_coal", {
935 description = "Coal Ore",
936 tiles = {"default_stone.png^default_mineral_coal.png"},
937 groups = {cracky = 3},
938 drop = 'default:coal_lump',
939 sounds = default.node_sound_stone_defaults(),
942 minetest.register_node("default:coalblock", {
943 description = "Coal Block",
944 tiles = {"default_coal_block.png"},
945 is_ground_content = false,
946 groups = {cracky = 3},
947 sounds = default.node_sound_stone_defaults(),
951 minetest.register_node("default:stone_with_iron", {
952 description = "Iron Ore",
953 tiles = {"default_stone.png^default_mineral_iron.png"},
954 groups = {cracky = 2},
955 drop = 'default:iron_lump',
956 sounds = default.node_sound_stone_defaults(),
959 minetest.register_node("default:steelblock", {
960 description = "Steel Block",
961 tiles = {"default_steel_block.png"},
962 is_ground_content = false,
963 groups = {cracky = 1, level = 2},
964 sounds = default.node_sound_metal_defaults(),
968 minetest.register_node("default:stone_with_copper", {
969 description = "Copper Ore",
970 tiles = {"default_stone.png^default_mineral_copper.png"},
971 groups = {cracky = 2},
972 drop = 'default:copper_lump',
973 sounds = default.node_sound_stone_defaults(),
976 minetest.register_node("default:copperblock", {
977 description = "Copper Block",
978 tiles = {"default_copper_block.png"},
979 is_ground_content = false,
980 groups = {cracky = 1, level = 2},
981 sounds = default.node_sound_metal_defaults(),
984 minetest.register_node("default:bronzeblock", {
985 description = "Bronze Block",
986 tiles = {"default_bronze_block.png"},
987 is_ground_content = false,
988 groups = {cracky = 1, level = 2},
989 sounds = default.node_sound_metal_defaults(),
993 minetest.register_node("default:stone_with_mese", {
994 description = "Mese Ore",
995 tiles = {"default_stone.png^default_mineral_mese.png"},
996 groups = {cracky = 1},
997 drop = "default:mese_crystal",
998 sounds = default.node_sound_stone_defaults(),
1001 minetest.register_node("default:mese", {
1002 description = "Mese Block",
1003 tiles = {"default_mese_block.png"},
1004 paramtype = "light",
1005 groups = {cracky = 1, level = 2},
1006 sounds = default.node_sound_stone_defaults(),
1011 minetest.register_node("default:stone_with_gold", {
1012 description = "Gold Ore",
1013 tiles = {"default_stone.png^default_mineral_gold.png"},
1014 groups = {cracky = 2},
1015 drop = "default:gold_lump",
1016 sounds = default.node_sound_stone_defaults(),
1019 minetest.register_node("default:goldblock", {
1020 description = "Gold Block",
1021 tiles = {"default_gold_block.png"},
1022 is_ground_content = false,
1023 groups = {cracky = 1},
1024 sounds = default.node_sound_metal_defaults(),
1028 minetest.register_node("default:stone_with_diamond", {
1029 description = "Diamond Ore",
1030 tiles = {"default_stone.png^default_mineral_diamond.png"},
1031 groups = {cracky = 1},
1032 drop = "default:diamond",
1033 sounds = default.node_sound_stone_defaults(),
1036 minetest.register_node("default:diamondblock", {
1037 description = "Diamond Block",
1038 tiles = {"default_diamond_block.png"},
1039 is_ground_content = false,
1040 groups = {cracky = 1, level = 3},
1041 sounds = default.node_sound_stone_defaults(),
1045 -- Plantlife (non-cubic)
1048 minetest.register_node("default:cactus", {
1049 description = "Cactus",
1050 tiles = {"default_cactus_top.png", "default_cactus_top.png",
1051 "default_cactus_side.png"},
1052 paramtype2 = "facedir",
1053 groups = {snappy = 1, choppy = 3},
1054 sounds = default.node_sound_wood_defaults(),
1055 on_place = minetest.rotate_node,
1058 minetest.register_node("default:papyrus", {
1059 description = "Papyrus",
1060 drawtype = "plantlike",
1061 tiles = {"default_papyrus.png"},
1062 inventory_image = "default_papyrus.png",
1063 wield_image = "default_papyrus.png",
1064 paramtype = "light",
1065 sunlight_propagates = true,
1069 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16},
1071 groups = {snappy = 3, flammable = 2},
1072 sounds = default.node_sound_leaves_defaults(),
1074 after_dig_node = function(pos, node, metadata, digger)
1075 default.dig_up(pos, node, digger)
1079 minetest.register_node("default:dry_shrub", {
1080 description = "Dry Shrub",
1081 drawtype = "plantlike",
1084 tiles = {"default_dry_shrub.png"},
1085 inventory_image = "default_dry_shrub.png",
1086 wield_image = "default_dry_shrub.png",
1087 paramtype = "light",
1088 sunlight_propagates = true,
1090 buildable_to = true,
1091 groups = {snappy = 3, flammable = 3, attached_node = 1},
1092 sounds = default.node_sound_leaves_defaults(),
1095 fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 4 / 16, 5 / 16},
1099 minetest.register_node("default:junglegrass", {
1100 description = "Jungle Grass",
1101 drawtype = "plantlike",
1104 tiles = {"default_junglegrass.png"},
1105 inventory_image = "default_junglegrass.png",
1106 wield_image = "default_junglegrass.png",
1107 paramtype = "light",
1108 sunlight_propagates = true,
1110 buildable_to = true,
1111 groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1, flammable = 1},
1112 sounds = default.node_sound_leaves_defaults(),
1115 fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 1.19, 7 / 16},
1120 minetest.register_node("default:grass_1", {
1121 description = "Grass",
1122 drawtype = "plantlike",
1124 tiles = {"default_grass_1.png"},
1125 -- Use texture of a taller grass stage in inventory
1126 inventory_image = "default_grass_3.png",
1127 wield_image = "default_grass_3.png",
1128 paramtype = "light",
1129 sunlight_propagates = true,
1131 buildable_to = true,
1132 groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1, flammable = 1},
1133 sounds = default.node_sound_leaves_defaults(),
1136 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -5 / 16, 6 / 16},
1139 on_place = function(itemstack, placer, pointed_thing)
1140 -- place a random grass node
1141 local stack = ItemStack("default:grass_" .. math.random(1,5))
1142 local ret = minetest.item_place(stack, placer, pointed_thing)
1143 return ItemStack("default:grass_1 " ..
1144 itemstack:get_count() - (1 - ret:get_count()))
1149 minetest.register_node("default:grass_" .. i, {
1150 description = "Grass",
1151 drawtype = "plantlike",
1153 tiles = {"default_grass_" .. i .. ".png"},
1154 inventory_image = "default_grass_" .. i .. ".png",
1155 wield_image = "default_grass_" .. i .. ".png",
1156 paramtype = "light",
1157 sunlight_propagates = true,
1159 buildable_to = true,
1160 drop = "default:grass_1",
1161 groups = {snappy = 3, flora = 1, attached_node = 1,
1162 not_in_creative_inventory = 1, grass = 1, flammable = 1},
1163 sounds = default.node_sound_leaves_defaults(),
1166 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -3 / 16, 6 / 16},
1172 minetest.register_node("default:dry_grass_1", {
1173 description = "Dry Grass",
1174 drawtype = "plantlike",
1176 tiles = {"default_dry_grass_1.png"},
1177 inventory_image = "default_dry_grass_3.png",
1178 wield_image = "default_dry_grass_3.png",
1179 paramtype = "light",
1180 sunlight_propagates = true,
1182 buildable_to = true,
1183 groups = {snappy = 3, flammable = 3, flora = 1,
1184 attached_node = 1, dry_grass = 1},
1185 sounds = default.node_sound_leaves_defaults(),
1188 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -3 / 16, 6 / 16},
1191 on_place = function(itemstack, placer, pointed_thing)
1192 -- place a random dry grass node
1193 local stack = ItemStack("default:dry_grass_" .. math.random(1, 5))
1194 local ret = minetest.item_place(stack, placer, pointed_thing)
1195 return ItemStack("default:dry_grass_1 " ..
1196 itemstack:get_count() - (1 - ret:get_count()))
1201 minetest.register_node("default:dry_grass_" .. i, {
1202 description = "Dry Grass",
1203 drawtype = "plantlike",
1205 tiles = {"default_dry_grass_" .. i .. ".png"},
1206 inventory_image = "default_dry_grass_" .. i .. ".png",
1207 wield_image = "default_dry_grass_" .. i .. ".png",
1208 paramtype = "light",
1209 sunlight_propagates = true,
1211 buildable_to = true,
1212 groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1,
1213 not_in_creative_inventory=1, dry_grass = 1},
1214 drop = "default:dry_grass_1",
1215 sounds = default.node_sound_leaves_defaults(),
1218 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -1 / 16, 6 / 16},
1224 minetest.register_node("default:bush_stem", {
1225 description = "Bush Stem",
1226 drawtype = "plantlike",
1227 visual_scale = 1.18,
1228 tiles = {"default_bush_stem.png"},
1229 inventory_image = "default_bush_stem.png",
1230 wield_image = "default_bush_stem.png",
1231 paramtype = "light",
1232 sunlight_propagates = true,
1233 groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
1234 sounds = default.node_sound_wood_defaults(),
1237 fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.54, 7 / 16},
1241 minetest.register_node("default:bush_leaves", {
1242 description = "Bush Leaves",
1243 drawtype = "allfaces_optional",
1245 tiles = {"default_leaves_simple.png"},
1246 paramtype = "light",
1247 groups = {snappy = 3, flammable = 2, leaves = 1},
1248 sounds = default.node_sound_leaves_defaults(),
1251 minetest.register_node("default:acacia_bush_stem", {
1252 description = "Acacia Bush Stem",
1253 drawtype = "plantlike",
1254 visual_scale = 1.18,
1255 tiles = {"default_acacia_bush_stem.png"},
1256 inventory_image = "default_acacia_bush_stem.png",
1257 wield_image = "default_acacia_bush_stem.png",
1258 paramtype = "light",
1259 sunlight_propagates = true,
1260 groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
1261 sounds = default.node_sound_wood_defaults(),
1264 fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.54, 7 / 16},
1268 minetest.register_node("default:acacia_bush_leaves", {
1269 description = "Acacia Bush Leaves",
1270 drawtype = "allfaces_optional",
1272 tiles = {"default_acacia_leaves_simple.png"},
1273 paramtype = "light",
1274 groups = {snappy = 3, flammable = 2, leaves = 1},
1275 sounds = default.node_sound_leaves_defaults(),
1283 minetest.register_node("default:coral_brown", {
1284 description = "Brown Coral",
1285 tiles = {"default_coral_brown.png"},
1286 groups = {cracky = 3},
1287 drop = "default:coral_skeleton",
1288 sounds = default.node_sound_stone_defaults(),
1291 minetest.register_node("default:coral_orange", {
1292 description = "Orange Coral",
1293 tiles = {"default_coral_orange.png"},
1294 groups = {cracky = 3},
1295 drop = "default:coral_skeleton",
1296 sounds = default.node_sound_stone_defaults(),
1299 minetest.register_node("default:coral_skeleton", {
1300 description = "Coral Skeleton",
1301 tiles = {"default_coral_skeleton.png"},
1302 groups = {cracky = 3},
1303 sounds = default.node_sound_stone_defaults(),
1311 minetest.register_node("default:water_source", {
1312 description = "Water Source",
1313 drawtype = "liquid",
1316 name = "default_water_source_animated.png",
1318 type = "vertical_frames",
1326 -- New-style water source material (mostly unused)
1328 name = "default_water_source_animated.png",
1330 type = "vertical_frames",
1335 backface_culling = false,
1339 paramtype = "light",
1343 buildable_to = true,
1344 is_ground_content = false,
1347 liquidtype = "source",
1348 liquid_alternative_flowing = "default:water_flowing",
1349 liquid_alternative_source = "default:water_source",
1350 liquid_viscosity = 1,
1351 post_effect_color = {a = 103, r = 30, g = 60, b = 90},
1352 groups = {water = 3, liquid = 3, puts_out_fire = 1, cools_lava = 1},
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},
1401 minetest.register_node("default:river_water_source", {
1402 description = "River Water Source",
1403 drawtype = "liquid",
1406 name = "default_river_water_source_animated.png",
1408 type = "vertical_frames",
1417 name = "default_river_water_source_animated.png",
1419 type = "vertical_frames",
1424 backface_culling = false,
1428 paramtype = "light",
1432 buildable_to = true,
1433 is_ground_content = false,
1436 liquidtype = "source",
1437 liquid_alternative_flowing = "default:river_water_flowing",
1438 liquid_alternative_source = "default:river_water_source",
1439 liquid_viscosity = 1,
1440 liquid_renewable = false,
1442 post_effect_color = {a = 103, r = 30, g = 76, b = 90},
1443 groups = {water = 3, liquid = 3, puts_out_fire = 1, cools_lava = 1},
1446 minetest.register_node("default:river_water_flowing", {
1447 description = "Flowing River Water",
1448 drawtype = "flowingliquid",
1449 tiles = {"default_river_water.png"},
1452 name = "default_river_water_flowing_animated.png",
1453 backface_culling = false,
1455 type = "vertical_frames",
1462 name = "default_river_water_flowing_animated.png",
1463 backface_culling = true,
1465 type = "vertical_frames",
1473 paramtype = "light",
1474 paramtype2 = "flowingliquid",
1478 buildable_to = true,
1479 is_ground_content = false,
1482 liquidtype = "flowing",
1483 liquid_alternative_flowing = "default:river_water_flowing",
1484 liquid_alternative_source = "default:river_water_source",
1485 liquid_viscosity = 1,
1486 liquid_renewable = false,
1488 post_effect_color = {a = 103, r = 30, g = 76, b = 90},
1489 groups = {water = 3, liquid = 3, puts_out_fire = 1,
1490 not_in_creative_inventory = 1, cools_lava = 1},
1494 minetest.register_node("default:lava_source", {
1495 description = "Lava Source",
1496 drawtype = "liquid",
1499 name = "default_lava_source_animated.png",
1501 type = "vertical_frames",
1509 -- New-style lava source material (mostly unused)
1511 name = "default_lava_source_animated.png",
1513 type = "vertical_frames",
1518 backface_culling = false,
1521 paramtype = "light",
1522 light_source = default.LIGHT_MAX - 1,
1526 buildable_to = true,
1527 is_ground_content = false,
1530 liquidtype = "source",
1531 liquid_alternative_flowing = "default:lava_flowing",
1532 liquid_alternative_source = "default:lava_source",
1533 liquid_viscosity = 7,
1534 liquid_renewable = false,
1535 damage_per_second = 4 * 2,
1536 post_effect_color = {a = 191, r = 255, g = 64, b = 0},
1537 groups = {lava = 3, liquid = 2, igniter = 1},
1540 minetest.register_node("default:lava_flowing", {
1541 description = "Flowing Lava",
1542 drawtype = "flowingliquid",
1543 tiles = {"default_lava.png"},
1546 name = "default_lava_flowing_animated.png",
1547 backface_culling = false,
1549 type = "vertical_frames",
1556 name = "default_lava_flowing_animated.png",
1557 backface_culling = true,
1559 type = "vertical_frames",
1566 paramtype = "light",
1567 paramtype2 = "flowingliquid",
1568 light_source = default.LIGHT_MAX - 1,
1572 buildable_to = true,
1573 is_ground_content = false,
1576 liquidtype = "flowing",
1577 liquid_alternative_flowing = "default:lava_flowing",
1578 liquid_alternative_source = "default:lava_source",
1579 liquid_viscosity = 7,
1580 liquid_renewable = false,
1581 damage_per_second = 4 * 2,
1582 post_effect_color = {a = 191, r = 255, g = 64, b = 0},
1583 groups = {lava = 3, liquid = 2, igniter = 1,
1584 not_in_creative_inventory = 1},
1588 -- Tools / "Advanced" crafting / Non-"natural"
1591 minetest.register_node("default:torch", {
1592 description = "Torch",
1593 drawtype = "torchlike",
1596 name = "default_torch_on_floor_animated.png",
1598 type = "vertical_frames",
1605 name="default_torch_on_ceiling_animated.png",
1607 type = "vertical_frames",
1614 name="default_torch_animated.png",
1616 type = "vertical_frames",
1623 inventory_image = "default_torch_on_floor.png",
1624 wield_image = "default_torch_on_floor.png",
1625 paramtype = "light",
1626 paramtype2 = "wallmounted",
1627 sunlight_propagates = true,
1628 is_ground_content = false,
1630 light_source = default.LIGHT_MAX - 1,
1632 type = "wallmounted",
1633 wall_top = {-0.1, 0.5 - 0.6, -0.1, 0.1, 0.5, 0.1},
1634 wall_bottom = {-0.1, -0.5, -0.1, 0.1, -0.5 + 0.6, 0.1},
1635 wall_side = {-0.5, -0.3, -0.1, -0.5 + 0.3, 0.3, 0.1},
1637 groups = {choppy = 2, dig_immediate = 3, flammable = 1, attached_node = 1},
1638 legacy_wallmounted = true,
1639 sounds = default.node_sound_defaults(),
1643 local chest_formspec =
1646 default.gui_bg_img ..
1647 default.gui_slots ..
1648 "list[current_name;main;0,0.3;8,4;]" ..
1649 "list[current_player;main;0,4.85;8,1;]" ..
1650 "list[current_player;main;0,6.08;8,3;8]" ..
1651 "listring[current_name;main]" ..
1652 "listring[current_player;main]" ..
1653 default.get_hotbar_bg(0,4.85)
1655 local function get_locked_chest_formspec(pos)
1656 local spos = pos.x .. "," .. pos.y .. "," .. pos.z
1660 default.gui_bg_img ..
1661 default.gui_slots ..
1662 "list[nodemeta:" .. spos .. ";main;0,0.3;8,4;]" ..
1663 "list[current_player;main;0,4.85;8,1;]" ..
1664 "list[current_player;main;0,6.08;8,3;8]" ..
1665 "listring[nodemeta:" .. spos .. ";main]" ..
1666 "listring[current_player;main]" ..
1667 default.get_hotbar_bg(0,4.85)
1671 local function has_locked_chest_privilege(meta, player)
1674 if minetest.check_player_privs(player, "protection_bypass") then
1677 name = player:get_player_name()
1679 if name ~= meta:get_string("owner") then
1685 minetest.register_node("default:chest", {
1686 description = "Chest",
1687 tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
1688 "default_chest_side.png", "default_chest_side.png", "default_chest_front.png"},
1689 paramtype2 = "facedir",
1690 groups = {choppy = 2, oddly_breakable_by_hand = 2},
1691 legacy_facedir_simple = true,
1692 is_ground_content = false,
1693 sounds = default.node_sound_wood_defaults(),
1695 on_construct = function(pos)
1696 local meta = minetest.get_meta(pos)
1697 meta:set_string("formspec", chest_formspec)
1698 local inv = meta:get_inventory()
1699 inv:set_size("main", 8*4)
1701 can_dig = function(pos,player)
1702 local meta = minetest.get_meta(pos);
1703 local inv = meta:get_inventory()
1704 return inv:is_empty("main")
1706 on_metadata_inventory_move = function(pos, from_list, from_index,
1707 to_list, to_index, count, player)
1708 minetest.log("action", player:get_player_name() ..
1709 " moves stuff in chest at " .. minetest.pos_to_string(pos))
1711 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1712 minetest.log("action", player:get_player_name() ..
1713 " moves " .. stack:get_name() ..
1714 " to chest at " .. minetest.pos_to_string(pos))
1716 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1717 minetest.log("action", player:get_player_name() ..
1718 " takes " .. stack:get_name() ..
1719 " from chest at " .. minetest.pos_to_string(pos))
1721 on_blast = function(pos)
1723 default.get_inventory_drops(pos, "main", drops)
1724 drops[#drops+1] = "default:chest"
1725 minetest.remove_node(pos)
1730 minetest.register_node("default:chest_locked", {
1731 description = "Locked Chest",
1732 tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
1733 "default_chest_side.png", "default_chest_side.png", "default_chest_lock.png"},
1734 paramtype2 = "facedir",
1735 groups = {choppy = 2, oddly_breakable_by_hand = 2},
1736 legacy_facedir_simple = true,
1737 is_ground_content = false,
1738 sounds = default.node_sound_wood_defaults(),
1740 after_place_node = function(pos, placer)
1741 local meta = minetest.get_meta(pos)
1742 meta:set_string("owner", placer:get_player_name() or "")
1743 meta:set_string("infotext", "Locked Chest (owned by " ..
1744 meta:get_string("owner") .. ")")
1746 on_construct = function(pos)
1747 local meta = minetest.get_meta(pos)
1748 meta:set_string("owner", "")
1749 local inv = meta:get_inventory()
1750 inv:set_size("main", 8 * 4)
1752 can_dig = function(pos,player)
1753 local meta = minetest.get_meta(pos);
1754 local inv = meta:get_inventory()
1755 return inv:is_empty("main") and has_locked_chest_privilege(meta, player)
1757 allow_metadata_inventory_move = function(pos, from_list, from_index,
1758 to_list, to_index, count, player)
1759 local meta = minetest.get_meta(pos)
1760 if not has_locked_chest_privilege(meta, player) then
1765 allow_metadata_inventory_put = function(pos, listname, index, stack, player)
1766 local meta = minetest.get_meta(pos)
1767 if not has_locked_chest_privilege(meta, player) then
1770 return stack:get_count()
1772 allow_metadata_inventory_take = function(pos, listname, index, stack, player)
1773 local meta = minetest.get_meta(pos)
1774 if not has_locked_chest_privilege(meta, player) then
1777 return stack:get_count()
1779 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1780 minetest.log("action", player:get_player_name() ..
1781 " moves " .. stack:get_name() ..
1782 " to locked chest at " .. minetest.pos_to_string(pos))
1784 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1785 minetest.log("action", player:get_player_name() ..
1786 " takes " .. stack:get_name() ..
1787 " from locked chest at " .. minetest.pos_to_string(pos))
1789 on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
1790 local meta = minetest.get_meta(pos)
1791 if has_locked_chest_privilege(meta, clicker) then
1792 minetest.show_formspec(
1793 clicker:get_player_name(),
1794 "default:chest_locked",
1795 get_locked_chest_formspec(pos)
1800 on_blast = function() end,
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,
2086 minetest.register_node("default:cloud", {
2087 description = "Cloud",
2088 tiles = {"default_cloud.png"},
2089 is_ground_content = false,
2090 sounds = default.node_sound_defaults(),
2091 groups = {not_in_creative_inventory = 1},