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
33 default:desert_sandstone
34 default:desert_sandstone_brick
35 default:desert_sandstone_block
36 default:silver_sandstone
37 default:silver_sandstone_brick
38 default:silver_sandstone_block
42 default:obsidian_block
46 (1. Material 2. Modified forms)
49 default:dirt_with_grass
50 default:dirt_with_grass_footsteps
51 default:dirt_with_dry_grass
52 default:dirt_with_snow
53 default:dirt_with_rainforest_litter
70 (1. Trunk 2. Fabricated trunk 3. Leaves 4. Sapling 5. Fruits)
91 default:acacia_sapling
100 (1. In stone 2. Blocks)
102 default:stone_with_coal
105 default:stone_with_iron
108 default:stone_with_copper
112 default:stone_with_gold
115 default:stone_with_mese
118 default:stone_with_diamond
143 default:acacia_bush_stem
144 default:acacia_bush_leaves
151 default:coral_skeleton
155 (1. Source 2. Flowing)
158 default:water_flowing
160 default:river_water_source
161 default:river_water_flowing
166 Tools / "Advanced" crafting / Non-"natural"
167 -------------------------------------------
174 default:sign_wall_wood
175 default:sign_wall_steel
181 default:fence_acacia_wood
182 default:fence_junglewood
183 default:fence_pine_wood
184 default:fence_aspen_wood
187 default:obsidian_glass
192 default:mese_post_light
205 minetest.register_node("default:stone", {
206 description = "Stone",
207 tiles = {"default_stone.png"},
208 groups = {cracky = 3, stone = 1},
209 drop = 'default:cobble',
210 legacy_mineral = true,
211 sounds = default.node_sound_stone_defaults(),
214 minetest.register_node("default:cobble", {
215 description = "Cobblestone",
216 tiles = {"default_cobble.png"},
217 is_ground_content = false,
218 groups = {cracky = 3, stone = 2},
219 sounds = default.node_sound_stone_defaults(),
222 minetest.register_node("default:stonebrick", {
223 description = "Stone Brick",
224 paramtype2 = "facedir",
226 tiles = {"default_stone_brick.png"},
227 is_ground_content = false,
228 groups = {cracky = 2, stone = 1},
229 sounds = default.node_sound_stone_defaults(),
232 minetest.register_node("default:stone_block", {
233 description = "Stone Block",
234 tiles = {"default_stone_block.png"},
235 is_ground_content = false,
236 groups = {cracky = 2, stone = 1},
237 sounds = default.node_sound_stone_defaults(),
240 minetest.register_node("default:mossycobble", {
241 description = "Mossy Cobblestone",
242 tiles = {"default_mossycobble.png"},
243 is_ground_content = false,
244 groups = {cracky = 3, stone = 1},
245 sounds = default.node_sound_stone_defaults(),
249 minetest.register_node("default:desert_stone", {
250 description = "Desert Stone",
251 tiles = {"default_desert_stone.png"},
252 groups = {cracky = 3, stone = 1},
253 drop = 'default:desert_cobble',
254 legacy_mineral = true,
255 sounds = default.node_sound_stone_defaults(),
258 minetest.register_node("default:desert_cobble", {
259 description = "Desert Cobblestone",
260 tiles = {"default_desert_cobble.png"},
261 is_ground_content = false,
262 groups = {cracky = 3, stone = 2},
263 sounds = default.node_sound_stone_defaults(),
266 minetest.register_node("default:desert_stonebrick", {
267 description = "Desert Stone Brick",
268 paramtype2 = "facedir",
270 tiles = {"default_desert_stone_brick.png"},
271 is_ground_content = false,
272 groups = {cracky = 2, stone = 1},
273 sounds = default.node_sound_stone_defaults(),
276 minetest.register_node("default:desert_stone_block", {
277 description = "Desert Stone Block",
278 tiles = {"default_desert_stone_block.png"},
279 is_ground_content = false,
280 groups = {cracky = 2, stone = 1},
281 sounds = default.node_sound_stone_defaults(),
284 minetest.register_node("default:sandstone", {
285 description = "Sandstone",
286 tiles = {"default_sandstone.png"},
287 groups = {crumbly = 1, cracky = 3},
288 sounds = default.node_sound_stone_defaults(),
291 minetest.register_node("default:sandstonebrick", {
292 description = "Sandstone Brick",
293 paramtype2 = "facedir",
295 tiles = {"default_sandstone_brick.png"},
296 is_ground_content = false,
297 groups = {cracky = 2},
298 sounds = default.node_sound_stone_defaults(),
301 minetest.register_node("default:sandstone_block", {
302 description = "Sandstone Block",
303 tiles = {"default_sandstone_block.png"},
304 is_ground_content = false,
305 groups = {cracky = 2},
306 sounds = default.node_sound_stone_defaults(),
309 minetest.register_node("default:desert_sandstone", {
310 description = "Desert Sandstone",
311 tiles = {"default_desert_sandstone.png"},
312 groups = {crumbly = 1, cracky = 3},
313 sounds = default.node_sound_stone_defaults(),
316 minetest.register_node("default:desert_sandstone_brick", {
317 description = "Desert Sandstone Brick",
318 paramtype2 = "facedir",
320 tiles = {"default_desert_sandstone_brick.png"},
321 is_ground_content = false,
322 groups = {cracky = 2},
323 sounds = default.node_sound_stone_defaults(),
326 minetest.register_node("default:desert_sandstone_block", {
327 description = "Desert Sandstone Block",
328 tiles = {"default_desert_sandstone_block.png"},
329 is_ground_content = false,
330 groups = {cracky = 2},
331 sounds = default.node_sound_stone_defaults(),
334 minetest.register_node("default:silver_sandstone", {
335 description = "Silver Sandstone",
336 tiles = {"default_silver_sandstone.png"},
337 groups = {crumbly = 1, cracky = 3},
338 sounds = default.node_sound_stone_defaults(),
341 minetest.register_node("default:silver_sandstone_brick", {
342 description = "Silver Sandstone Brick",
343 paramtype2 = "facedir",
345 tiles = {"default_silver_sandstone_brick.png"},
346 is_ground_content = false,
347 groups = {cracky = 2},
348 sounds = default.node_sound_stone_defaults(),
351 minetest.register_node("default:silver_sandstone_block", {
352 description = "Silver Sandstone Block",
353 tiles = {"default_silver_sandstone_block.png"},
354 is_ground_content = false,
355 groups = {cracky = 2},
356 sounds = default.node_sound_stone_defaults(),
359 minetest.register_node("default:obsidian", {
360 description = "Obsidian",
361 tiles = {"default_obsidian.png"},
362 sounds = default.node_sound_stone_defaults(),
363 groups = {cracky = 1, level = 2},
366 minetest.register_node("default:obsidianbrick", {
367 description = "Obsidian Brick",
368 paramtype2 = "facedir",
370 tiles = {"default_obsidian_brick.png"},
371 is_ground_content = false,
372 sounds = default.node_sound_stone_defaults(),
373 groups = {cracky = 1, level = 2},
376 minetest.register_node("default:obsidian_block", {
377 description = "Obsidian Block",
378 tiles = {"default_obsidian_block.png"},
379 is_ground_content = false,
380 sounds = default.node_sound_stone_defaults(),
381 groups = {cracky = 1, level = 2},
388 minetest.register_node("default:dirt", {
389 description = "Dirt",
390 tiles = {"default_dirt.png"},
391 groups = {crumbly = 3, soil = 1},
392 sounds = default.node_sound_dirt_defaults(),
395 minetest.register_node("default:dirt_with_grass", {
396 description = "Dirt with Grass",
397 tiles = {"default_grass.png", "default_dirt.png",
398 {name = "default_dirt.png^default_grass_side.png",
399 tileable_vertical = false}},
400 groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
401 drop = 'default:dirt',
402 sounds = default.node_sound_dirt_defaults({
403 footstep = {name = "default_grass_footstep", gain = 0.25},
407 minetest.register_node("default:dirt_with_grass_footsteps", {
408 description = "Dirt with Grass and Footsteps",
409 tiles = {"default_grass.png^default_footprint.png", "default_dirt.png",
410 {name = "default_dirt.png^default_grass_side.png",
411 tileable_vertical = false}},
412 groups = {crumbly = 3, soil = 1, not_in_creative_inventory = 1},
413 drop = 'default:dirt',
414 sounds = default.node_sound_dirt_defaults({
415 footstep = {name = "default_grass_footstep", gain = 0.25},
419 minetest.register_node("default:dirt_with_dry_grass", {
420 description = "Dirt with Dry Grass",
421 tiles = {"default_dry_grass.png",
423 {name = "default_dirt.png^default_dry_grass_side.png",
424 tileable_vertical = false}},
425 groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
426 drop = 'default:dirt',
427 sounds = default.node_sound_dirt_defaults({
428 footstep = {name = "default_grass_footstep", gain = 0.4},
432 minetest.register_node("default:dirt_with_snow", {
433 description = "Dirt with Snow",
434 tiles = {"default_snow.png", "default_dirt.png",
435 {name = "default_dirt.png^default_snow_side.png",
436 tileable_vertical = false}},
437 groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1, snowy = 1},
438 drop = 'default:dirt',
439 sounds = default.node_sound_dirt_defaults({
440 footstep = {name = "default_snow_footstep", gain = 0.15},
444 minetest.register_node("default:dirt_with_rainforest_litter", {
445 description = "Dirt with Rainforest Litter",
447 "default_rainforest_litter.png",
449 {name = "default_dirt.png^default_rainforest_litter_side.png",
450 tileable_vertical = false}
452 groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
453 drop = "default:dirt",
454 sounds = default.node_sound_dirt_defaults({
455 footstep = {name = "default_grass_footstep", gain = 0.4},
459 minetest.register_node("default:sand", {
460 description = "Sand",
461 tiles = {"default_sand.png"},
462 groups = {crumbly = 3, falling_node = 1, sand = 1},
463 sounds = default.node_sound_sand_defaults(),
466 minetest.register_node("default:desert_sand", {
467 description = "Desert Sand",
468 tiles = {"default_desert_sand.png"},
469 groups = {crumbly = 3, falling_node = 1, sand = 1},
470 sounds = default.node_sound_sand_defaults(),
473 minetest.register_node("default:silver_sand", {
474 description = "Silver Sand",
475 tiles = {"default_silver_sand.png"},
476 groups = {crumbly = 3, falling_node = 1, sand = 1},
477 sounds = default.node_sound_sand_defaults(),
481 minetest.register_node("default:gravel", {
482 description = "Gravel",
483 tiles = {"default_gravel.png"},
484 groups = {crumbly = 2, falling_node = 1},
485 sounds = default.node_sound_gravel_defaults(),
489 {items = {'default:flint'}, rarity = 16},
490 {items = {'default:gravel'}}
495 minetest.register_node("default:clay", {
496 description = "Clay",
497 tiles = {"default_clay.png"},
498 groups = {crumbly = 3},
499 drop = 'default:clay_lump 4',
500 sounds = default.node_sound_dirt_defaults(),
504 minetest.register_node("default:snow", {
505 description = "Snow",
506 tiles = {"default_snow.png"},
507 inventory_image = "default_snowball.png",
508 wield_image = "default_snowball.png",
512 drawtype = "nodebox",
516 {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
519 groups = {crumbly = 3, falling_node = 1, puts_out_fire = 1, snowy = 1},
520 sounds = default.node_sound_dirt_defaults({
521 footstep = {name = "default_snow_footstep", gain = 0.15},
522 dug = {name = "default_snow_footstep", gain = 0.2},
523 dig = {name = "default_snow_footstep", gain = 0.2}
526 on_construct = function(pos)
528 if minetest.get_node(pos).name == "default:dirt_with_grass" then
529 minetest.set_node(pos, {name = "default:dirt_with_snow"})
534 minetest.register_node("default:snowblock", {
535 description = "Snow Block",
536 tiles = {"default_snow.png"},
537 groups = {crumbly = 3, puts_out_fire = 1, cools_lava = 1, snowy = 1},
538 sounds = default.node_sound_dirt_defaults({
539 footstep = {name = "default_snow_footstep", gain = 0.15},
540 dug = {name = "default_snow_footstep", gain = 0.2},
541 dig = {name = "default_snow_footstep", gain = 0.2}
544 on_construct = function(pos)
546 if minetest.get_node(pos).name == "default:dirt_with_grass" then
547 minetest.set_node(pos, {name = "default:dirt_with_snow"})
552 minetest.register_node("default:ice", {
554 tiles = {"default_ice.png"},
555 is_ground_content = false,
557 groups = {cracky = 3, puts_out_fire = 1, cools_lava = 1},
558 sounds = default.node_sound_glass_defaults(),
565 minetest.register_node("default:tree", {
566 description = "Tree",
567 tiles = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"},
568 paramtype2 = "facedir",
569 is_ground_content = false,
570 groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
571 sounds = default.node_sound_wood_defaults(),
573 on_place = minetest.rotate_node
576 minetest.register_node("default:wood", {
577 description = "Wooden Planks",
578 paramtype2 = "facedir",
580 tiles = {"default_wood.png"},
581 is_ground_content = false,
582 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
583 sounds = default.node_sound_wood_defaults(),
586 minetest.register_node("default:sapling", {
587 description = "Sapling",
588 drawtype = "plantlike",
589 tiles = {"default_sapling.png"},
590 inventory_image = "default_sapling.png",
591 wield_image = "default_sapling.png",
593 sunlight_propagates = true,
595 on_timer = default.grow_sapling,
598 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
600 groups = {snappy = 2, dig_immediate = 3, flammable = 2,
601 attached_node = 1, sapling = 1},
602 sounds = default.node_sound_leaves_defaults(),
604 on_construct = function(pos)
605 minetest.get_node_timer(pos):start(math.random(2400,4800))
608 on_place = function(itemstack, placer, pointed_thing)
609 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
611 -- minp, maxp to be checked, relative to sapling pos
612 -- minp_relative.y = 1 because sapling pos has been checked
613 {x = -2, y = 1, z = -2},
614 {x = 2, y = 6, z = 2},
615 -- maximum interval of interior volume check
622 minetest.register_node("default:leaves", {
623 description = "Leaves",
624 drawtype = "allfaces_optional",
626 tiles = {"default_leaves.png"},
627 special_tiles = {"default_leaves_simple.png"},
629 is_ground_content = false,
630 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
635 -- player will get sapling with 1/20 chance
636 items = {'default:sapling'},
640 -- player will get leaves only if he get no saplings,
641 -- this is because max_items is 1
642 items = {'default:leaves'},
646 sounds = default.node_sound_leaves_defaults(),
648 after_place_node = default.after_place_leaves,
651 minetest.register_node("default:apple", {
652 description = "Apple",
653 drawtype = "plantlike",
654 tiles = {"default_apple.png"},
655 inventory_image = "default_apple.png",
657 sunlight_propagates = true,
659 is_ground_content = false,
662 fixed = {-3 / 16, -7 / 16, -3 / 16, 3 / 16, 4 / 16, 3 / 16}
664 groups = {fleshy = 3, dig_immediate = 3, flammable = 2,
665 leafdecay = 3, leafdecay_drop = 1},
666 on_use = minetest.item_eat(2),
667 sounds = default.node_sound_leaves_defaults(),
669 after_place_node = function(pos, placer, itemstack)
670 if placer:is_player() then
671 minetest.set_node(pos, {name = "default:apple", param2 = 1})
677 minetest.register_node("default:jungletree", {
678 description = "Jungle Tree",
679 tiles = {"default_jungletree_top.png", "default_jungletree_top.png",
680 "default_jungletree.png"},
681 paramtype2 = "facedir",
682 is_ground_content = false,
683 groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
684 sounds = default.node_sound_wood_defaults(),
686 on_place = minetest.rotate_node
689 minetest.register_node("default:junglewood", {
690 description = "Junglewood Planks",
691 paramtype2 = "facedir",
693 tiles = {"default_junglewood.png"},
694 is_ground_content = false,
695 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
696 sounds = default.node_sound_wood_defaults(),
699 minetest.register_node("default:jungleleaves", {
700 description = "Jungle Leaves",
701 drawtype = "allfaces_optional",
703 tiles = {"default_jungleleaves.png"},
704 special_tiles = {"default_jungleleaves_simple.png"},
706 is_ground_content = false,
707 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
711 {items = {'default:junglesapling'}, rarity = 20},
712 {items = {'default:jungleleaves'}}
715 sounds = default.node_sound_leaves_defaults(),
717 after_place_node = default.after_place_leaves,
720 minetest.register_node("default:junglesapling", {
721 description = "Jungle Sapling",
722 drawtype = "plantlike",
723 tiles = {"default_junglesapling.png"},
724 inventory_image = "default_junglesapling.png",
725 wield_image = "default_junglesapling.png",
727 sunlight_propagates = true,
729 on_timer = default.grow_sapling,
732 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
734 groups = {snappy = 2, dig_immediate = 3, flammable = 2,
735 attached_node = 1, sapling = 1},
736 sounds = default.node_sound_leaves_defaults(),
738 on_construct = function(pos)
739 minetest.get_node_timer(pos):start(math.random(2400,4800))
742 on_place = function(itemstack, placer, pointed_thing)
743 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
744 "default:junglesapling",
745 -- minp, maxp to be checked, relative to sapling pos
746 -- minp_relative.y = 1 because sapling pos has been checked
747 {x = -2, y = 1, z = -2},
748 {x = 2, y = 15, z = 2},
749 -- maximum interval of interior volume check
757 minetest.register_node("default:pine_tree", {
758 description = "Pine Tree",
759 tiles = {"default_pine_tree_top.png", "default_pine_tree_top.png",
760 "default_pine_tree.png"},
761 paramtype2 = "facedir",
762 is_ground_content = false,
763 groups = {tree = 1, choppy = 3, oddly_breakable_by_hand = 1, flammable = 3},
764 sounds = default.node_sound_wood_defaults(),
766 on_place = minetest.rotate_node
769 minetest.register_node("default:pine_wood", {
770 description = "Pine Wood Planks",
771 paramtype2 = "facedir",
773 tiles = {"default_pine_wood.png"},
774 is_ground_content = false,
775 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
776 sounds = default.node_sound_wood_defaults(),
779 minetest.register_node("default:pine_needles",{
780 description = "Pine Needles",
781 drawtype = "allfaces_optional",
782 tiles = {"default_pine_needles.png"},
785 is_ground_content = false,
786 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
790 {items = {"default:pine_sapling"}, rarity = 20},
791 {items = {"default:pine_needles"}}
794 sounds = default.node_sound_leaves_defaults(),
796 after_place_node = default.after_place_leaves,
799 minetest.register_node("default:pine_sapling", {
800 description = "Pine Sapling",
801 drawtype = "plantlike",
802 tiles = {"default_pine_sapling.png"},
803 inventory_image = "default_pine_sapling.png",
804 wield_image = "default_pine_sapling.png",
806 sunlight_propagates = true,
808 on_timer = default.grow_sapling,
811 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
813 groups = {snappy = 2, dig_immediate = 3, flammable = 3,
814 attached_node = 1, sapling = 1},
815 sounds = default.node_sound_leaves_defaults(),
817 on_construct = function(pos)
818 minetest.get_node_timer(pos):start(math.random(2400,4800))
821 on_place = function(itemstack, placer, pointed_thing)
822 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
823 "default:pine_sapling",
824 -- minp, maxp to be checked, relative to sapling pos
825 -- minp_relative.y = 1 because sapling pos has been checked
826 {x = -2, y = 1, z = -2},
827 {x = 2, y = 12, z = 2},
828 -- maximum interval of interior volume check
836 minetest.register_node("default:acacia_tree", {
837 description = "Acacia Tree",
838 tiles = {"default_acacia_tree_top.png", "default_acacia_tree_top.png",
839 "default_acacia_tree.png"},
840 paramtype2 = "facedir",
841 is_ground_content = false,
842 groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
843 sounds = default.node_sound_wood_defaults(),
845 on_place = minetest.rotate_node
848 minetest.register_node("default:acacia_wood", {
849 description = "Acacia Wood Planks",
850 paramtype2 = "facedir",
852 tiles = {"default_acacia_wood.png"},
853 is_ground_content = false,
854 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
855 sounds = default.node_sound_wood_defaults(),
858 minetest.register_node("default:acacia_leaves", {
859 description = "Acacia Leaves",
860 drawtype = "allfaces_optional",
861 tiles = {"default_acacia_leaves.png"},
862 special_tiles = {"default_acacia_leaves_simple.png"},
865 is_ground_content = false,
866 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
870 {items = {"default:acacia_sapling"}, rarity = 20},
871 {items = {"default:acacia_leaves"}}
874 sounds = default.node_sound_leaves_defaults(),
876 after_place_node = default.after_place_leaves,
879 minetest.register_node("default:acacia_sapling", {
880 description = "Acacia Tree Sapling",
881 drawtype = "plantlike",
882 tiles = {"default_acacia_sapling.png"},
883 inventory_image = "default_acacia_sapling.png",
884 wield_image = "default_acacia_sapling.png",
886 sunlight_propagates = true,
888 on_timer = default.grow_sapling,
891 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
893 groups = {snappy = 2, dig_immediate = 3, flammable = 2,
894 attached_node = 1, sapling = 1},
895 sounds = default.node_sound_leaves_defaults(),
897 on_construct = function(pos)
898 minetest.get_node_timer(pos):start(math.random(2400,4800))
901 on_place = function(itemstack, placer, pointed_thing)
902 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
903 "default:acacia_sapling",
904 -- minp, maxp to be checked, relative to sapling pos
905 -- minp_relative.y = 1 because sapling pos has been checked
906 {x = -4, y = 1, z = -4},
907 {x = 4, y = 6, z = 4},
908 -- maximum interval of interior volume check
915 minetest.register_node("default:aspen_tree", {
916 description = "Aspen Tree",
917 tiles = {"default_aspen_tree_top.png", "default_aspen_tree_top.png",
918 "default_aspen_tree.png"},
919 paramtype2 = "facedir",
920 is_ground_content = false,
921 groups = {tree = 1, choppy = 3, oddly_breakable_by_hand = 1, flammable = 3},
922 sounds = default.node_sound_wood_defaults(),
924 on_place = minetest.rotate_node
927 minetest.register_node("default:aspen_wood", {
928 description = "Aspen Wood Planks",
929 paramtype2 = "facedir",
931 tiles = {"default_aspen_wood.png"},
932 is_ground_content = false,
933 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
934 sounds = default.node_sound_wood_defaults(),
937 minetest.register_node("default:aspen_leaves", {
938 description = "Aspen Leaves",
939 drawtype = "allfaces_optional",
940 tiles = {"default_aspen_leaves.png"},
943 is_ground_content = false,
944 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
948 {items = {"default:aspen_sapling"}, rarity = 20},
949 {items = {"default:aspen_leaves"}}
952 sounds = default.node_sound_leaves_defaults(),
954 after_place_node = default.after_place_leaves,
957 minetest.register_node("default:aspen_sapling", {
958 description = "Aspen Tree Sapling",
959 drawtype = "plantlike",
960 tiles = {"default_aspen_sapling.png"},
961 inventory_image = "default_aspen_sapling.png",
962 wield_image = "default_aspen_sapling.png",
964 sunlight_propagates = true,
966 on_timer = default.grow_sapling,
969 fixed = {-3 / 16, -0.5, -3 / 16, 3 / 16, 0.5, 3 / 16}
971 groups = {snappy = 2, dig_immediate = 3, flammable = 3,
972 attached_node = 1, sapling = 1},
973 sounds = default.node_sound_leaves_defaults(),
975 on_construct = function(pos)
976 minetest.get_node_timer(pos):start(math.random(2400,4800))
979 on_place = function(itemstack, placer, pointed_thing)
980 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
981 "default:aspen_sapling",
982 -- minp, maxp to be checked, relative to sapling pos
983 -- minp_relative.y = 1 because sapling pos has been checked
984 {x = -2, y = 1, z = -2},
985 {x = 2, y = 12, z = 2},
986 -- maximum interval of interior volume check
997 minetest.register_node("default:stone_with_coal", {
998 description = "Coal Ore",
999 tiles = {"default_stone.png^default_mineral_coal.png"},
1000 groups = {cracky = 3},
1001 drop = 'default:coal_lump',
1002 sounds = default.node_sound_stone_defaults(),
1005 minetest.register_node("default:coalblock", {
1006 description = "Coal Block",
1007 tiles = {"default_coal_block.png"},
1008 is_ground_content = false,
1009 groups = {cracky = 3},
1010 sounds = default.node_sound_stone_defaults(),
1014 minetest.register_node("default:stone_with_iron", {
1015 description = "Iron Ore",
1016 tiles = {"default_stone.png^default_mineral_iron.png"},
1017 groups = {cracky = 2},
1018 drop = 'default:iron_lump',
1019 sounds = default.node_sound_stone_defaults(),
1022 minetest.register_node("default:steelblock", {
1023 description = "Steel Block",
1024 tiles = {"default_steel_block.png"},
1025 is_ground_content = false,
1026 groups = {cracky = 1, level = 2},
1027 sounds = default.node_sound_metal_defaults(),
1031 minetest.register_node("default:stone_with_copper", {
1032 description = "Copper Ore",
1033 tiles = {"default_stone.png^default_mineral_copper.png"},
1034 groups = {cracky = 2},
1035 drop = 'default:copper_lump',
1036 sounds = default.node_sound_stone_defaults(),
1039 minetest.register_node("default:copperblock", {
1040 description = "Copper Block",
1041 tiles = {"default_copper_block.png"},
1042 is_ground_content = false,
1043 groups = {cracky = 1, level = 2},
1044 sounds = default.node_sound_metal_defaults(),
1047 minetest.register_node("default:bronzeblock", {
1048 description = "Bronze Block",
1049 tiles = {"default_bronze_block.png"},
1050 is_ground_content = false,
1051 groups = {cracky = 1, level = 2},
1052 sounds = default.node_sound_metal_defaults(),
1056 minetest.register_node("default:stone_with_mese", {
1057 description = "Mese Ore",
1058 tiles = {"default_stone.png^default_mineral_mese.png"},
1059 groups = {cracky = 1},
1060 drop = "default:mese_crystal",
1061 sounds = default.node_sound_stone_defaults(),
1064 minetest.register_node("default:mese", {
1065 description = "Mese Block",
1066 tiles = {"default_mese_block.png"},
1067 paramtype = "light",
1068 groups = {cracky = 1, level = 2},
1069 sounds = default.node_sound_stone_defaults(),
1074 minetest.register_node("default:stone_with_gold", {
1075 description = "Gold Ore",
1076 tiles = {"default_stone.png^default_mineral_gold.png"},
1077 groups = {cracky = 2},
1078 drop = "default:gold_lump",
1079 sounds = default.node_sound_stone_defaults(),
1082 minetest.register_node("default:goldblock", {
1083 description = "Gold Block",
1084 tiles = {"default_gold_block.png"},
1085 is_ground_content = false,
1086 groups = {cracky = 1},
1087 sounds = default.node_sound_metal_defaults(),
1091 minetest.register_node("default:stone_with_diamond", {
1092 description = "Diamond Ore",
1093 tiles = {"default_stone.png^default_mineral_diamond.png"},
1094 groups = {cracky = 1},
1095 drop = "default:diamond",
1096 sounds = default.node_sound_stone_defaults(),
1099 minetest.register_node("default:diamondblock", {
1100 description = "Diamond Block",
1101 tiles = {"default_diamond_block.png"},
1102 is_ground_content = false,
1103 groups = {cracky = 1, level = 3},
1104 sounds = default.node_sound_stone_defaults(),
1108 -- Plantlife (non-cubic)
1111 minetest.register_node("default:cactus", {
1112 description = "Cactus",
1113 tiles = {"default_cactus_top.png", "default_cactus_top.png",
1114 "default_cactus_side.png"},
1115 paramtype2 = "facedir",
1116 groups = {choppy = 3},
1117 sounds = default.node_sound_wood_defaults(),
1118 on_place = minetest.rotate_node,
1121 minetest.register_node("default:papyrus", {
1122 description = "Papyrus",
1123 drawtype = "plantlike",
1124 tiles = {"default_papyrus.png"},
1125 inventory_image = "default_papyrus.png",
1126 wield_image = "default_papyrus.png",
1127 paramtype = "light",
1128 sunlight_propagates = true,
1132 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16},
1134 groups = {snappy = 3, flammable = 2},
1135 sounds = default.node_sound_leaves_defaults(),
1137 after_dig_node = function(pos, node, metadata, digger)
1138 default.dig_up(pos, node, digger)
1142 minetest.register_node("default:dry_shrub", {
1143 description = "Dry Shrub",
1144 drawtype = "plantlike",
1146 tiles = {"default_dry_shrub.png"},
1147 inventory_image = "default_dry_shrub.png",
1148 wield_image = "default_dry_shrub.png",
1149 paramtype = "light",
1150 sunlight_propagates = true,
1152 buildable_to = true,
1153 groups = {snappy = 3, flammable = 3, attached_node = 1},
1154 sounds = default.node_sound_leaves_defaults(),
1157 fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 4 / 16, 5 / 16},
1161 minetest.register_node("default:junglegrass", {
1162 description = "Jungle Grass",
1163 drawtype = "plantlike",
1165 visual_scale = 1.69,
1166 tiles = {"default_junglegrass.png"},
1167 inventory_image = "default_junglegrass.png",
1168 wield_image = "default_junglegrass.png",
1169 paramtype = "light",
1170 sunlight_propagates = true,
1172 buildable_to = true,
1173 groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1, flammable = 1},
1174 sounds = default.node_sound_leaves_defaults(),
1177 fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 1.19, 7 / 16},
1182 minetest.register_node("default:grass_1", {
1183 description = "Grass",
1184 drawtype = "plantlike",
1186 tiles = {"default_grass_1.png"},
1187 -- Use texture of a taller grass stage in inventory
1188 inventory_image = "default_grass_3.png",
1189 wield_image = "default_grass_3.png",
1190 paramtype = "light",
1191 sunlight_propagates = true,
1193 buildable_to = true,
1194 groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1, flammable = 1},
1195 sounds = default.node_sound_leaves_defaults(),
1198 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -5 / 16, 6 / 16},
1201 on_place = function(itemstack, placer, pointed_thing)
1202 -- place a random grass node
1203 local stack = ItemStack("default:grass_" .. math.random(1,5))
1204 local ret = minetest.item_place(stack, placer, pointed_thing)
1205 return ItemStack("default:grass_1 " ..
1206 itemstack:get_count() - (1 - ret:get_count()))
1211 minetest.register_node("default:grass_" .. i, {
1212 description = "Grass",
1213 drawtype = "plantlike",
1215 tiles = {"default_grass_" .. i .. ".png"},
1216 inventory_image = "default_grass_" .. i .. ".png",
1217 wield_image = "default_grass_" .. i .. ".png",
1218 paramtype = "light",
1219 sunlight_propagates = true,
1221 buildable_to = true,
1222 drop = "default:grass_1",
1223 groups = {snappy = 3, flora = 1, attached_node = 1,
1224 not_in_creative_inventory = 1, grass = 1, flammable = 1},
1225 sounds = default.node_sound_leaves_defaults(),
1228 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -3 / 16, 6 / 16},
1234 minetest.register_node("default:dry_grass_1", {
1235 description = "Dry Grass",
1236 drawtype = "plantlike",
1238 tiles = {"default_dry_grass_1.png"},
1239 inventory_image = "default_dry_grass_3.png",
1240 wield_image = "default_dry_grass_3.png",
1241 paramtype = "light",
1242 sunlight_propagates = true,
1244 buildable_to = true,
1245 groups = {snappy = 3, flammable = 3, flora = 1,
1246 attached_node = 1, dry_grass = 1},
1247 sounds = default.node_sound_leaves_defaults(),
1250 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -3 / 16, 6 / 16},
1253 on_place = function(itemstack, placer, pointed_thing)
1254 -- place a random dry grass node
1255 local stack = ItemStack("default:dry_grass_" .. math.random(1, 5))
1256 local ret = minetest.item_place(stack, placer, pointed_thing)
1257 return ItemStack("default:dry_grass_1 " ..
1258 itemstack:get_count() - (1 - ret:get_count()))
1263 minetest.register_node("default:dry_grass_" .. i, {
1264 description = "Dry Grass",
1265 drawtype = "plantlike",
1267 tiles = {"default_dry_grass_" .. i .. ".png"},
1268 inventory_image = "default_dry_grass_" .. i .. ".png",
1269 wield_image = "default_dry_grass_" .. i .. ".png",
1270 paramtype = "light",
1271 sunlight_propagates = true,
1273 buildable_to = true,
1274 groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1,
1275 not_in_creative_inventory=1, dry_grass = 1},
1276 drop = "default:dry_grass_1",
1277 sounds = default.node_sound_leaves_defaults(),
1280 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -1 / 16, 6 / 16},
1286 minetest.register_node("default:bush_stem", {
1287 description = "Bush Stem",
1288 drawtype = "plantlike",
1289 visual_scale = 1.41,
1290 tiles = {"default_bush_stem.png"},
1291 inventory_image = "default_bush_stem.png",
1292 wield_image = "default_bush_stem.png",
1293 paramtype = "light",
1294 sunlight_propagates = true,
1295 groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
1296 sounds = default.node_sound_wood_defaults(),
1299 fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.54, 7 / 16},
1303 minetest.register_node("default:bush_leaves", {
1304 description = "Bush Leaves",
1305 drawtype = "allfaces_optional",
1307 tiles = {"default_leaves_simple.png"},
1308 paramtype = "light",
1309 groups = {snappy = 3, flammable = 2, leaves = 1},
1310 sounds = default.node_sound_leaves_defaults(),
1313 minetest.register_node("default:acacia_bush_stem", {
1314 description = "Acacia Bush Stem",
1315 drawtype = "plantlike",
1316 visual_scale = 1.41,
1317 tiles = {"default_acacia_bush_stem.png"},
1318 inventory_image = "default_acacia_bush_stem.png",
1319 wield_image = "default_acacia_bush_stem.png",
1320 paramtype = "light",
1321 sunlight_propagates = true,
1322 groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
1323 sounds = default.node_sound_wood_defaults(),
1326 fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.54, 7 / 16},
1330 minetest.register_node("default:acacia_bush_leaves", {
1331 description = "Acacia Bush Leaves",
1332 drawtype = "allfaces_optional",
1334 tiles = {"default_acacia_leaves_simple.png"},
1335 paramtype = "light",
1336 groups = {snappy = 3, flammable = 2, leaves = 1},
1337 sounds = default.node_sound_leaves_defaults(),
1345 minetest.register_node("default:coral_brown", {
1346 description = "Brown Coral",
1347 tiles = {"default_coral_brown.png"},
1348 groups = {cracky = 3},
1349 drop = "default:coral_skeleton",
1350 sounds = default.node_sound_stone_defaults(),
1353 minetest.register_node("default:coral_orange", {
1354 description = "Orange Coral",
1355 tiles = {"default_coral_orange.png"},
1356 groups = {cracky = 3},
1357 drop = "default:coral_skeleton",
1358 sounds = default.node_sound_stone_defaults(),
1361 minetest.register_node("default:coral_skeleton", {
1362 description = "Coral Skeleton",
1363 tiles = {"default_coral_skeleton.png"},
1364 groups = {cracky = 3},
1365 sounds = default.node_sound_stone_defaults(),
1373 minetest.register_node("default:water_source", {
1374 description = "Water Source",
1375 drawtype = "liquid",
1378 name = "default_water_source_animated.png",
1380 type = "vertical_frames",
1388 -- New-style water source material (mostly unused)
1390 name = "default_water_source_animated.png",
1392 type = "vertical_frames",
1397 backface_culling = false,
1401 paramtype = "light",
1405 buildable_to = true,
1406 is_ground_content = false,
1409 liquidtype = "source",
1410 liquid_alternative_flowing = "default:water_flowing",
1411 liquid_alternative_source = "default:water_source",
1412 liquid_viscosity = 1,
1413 post_effect_color = {a = 103, r = 30, g = 60, b = 90},
1414 groups = {water = 3, liquid = 3, puts_out_fire = 1, cools_lava = 1},
1415 sounds = default.node_sound_water_defaults(),
1418 minetest.register_node("default:water_flowing", {
1419 description = "Flowing Water",
1420 drawtype = "flowingliquid",
1421 tiles = {"default_water.png"},
1424 name = "default_water_flowing_animated.png",
1425 backface_culling = false,
1427 type = "vertical_frames",
1434 name = "default_water_flowing_animated.png",
1435 backface_culling = true,
1437 type = "vertical_frames",
1445 paramtype = "light",
1446 paramtype2 = "flowingliquid",
1450 buildable_to = true,
1451 is_ground_content = false,
1454 liquidtype = "flowing",
1455 liquid_alternative_flowing = "default:water_flowing",
1456 liquid_alternative_source = "default:water_source",
1457 liquid_viscosity = 1,
1458 post_effect_color = {a = 103, r = 30, g = 60, b = 90},
1459 groups = {water = 3, liquid = 3, puts_out_fire = 1,
1460 not_in_creative_inventory = 1, cools_lava = 1},
1461 sounds = default.node_sound_water_defaults(),
1465 minetest.register_node("default:river_water_source", {
1466 description = "River Water Source",
1467 drawtype = "liquid",
1470 name = "default_river_water_source_animated.png",
1472 type = "vertical_frames",
1481 name = "default_river_water_source_animated.png",
1483 type = "vertical_frames",
1488 backface_culling = false,
1492 paramtype = "light",
1496 buildable_to = true,
1497 is_ground_content = false,
1500 liquidtype = "source",
1501 liquid_alternative_flowing = "default:river_water_flowing",
1502 liquid_alternative_source = "default:river_water_source",
1503 liquid_viscosity = 1,
1504 liquid_renewable = false,
1506 post_effect_color = {a = 103, r = 30, g = 76, b = 90},
1507 groups = {water = 3, liquid = 3, puts_out_fire = 1, cools_lava = 1},
1508 sounds = default.node_sound_water_defaults(),
1511 minetest.register_node("default:river_water_flowing", {
1512 description = "Flowing River Water",
1513 drawtype = "flowingliquid",
1514 tiles = {"default_river_water.png"},
1517 name = "default_river_water_flowing_animated.png",
1518 backface_culling = false,
1520 type = "vertical_frames",
1527 name = "default_river_water_flowing_animated.png",
1528 backface_culling = true,
1530 type = "vertical_frames",
1538 paramtype = "light",
1539 paramtype2 = "flowingliquid",
1543 buildable_to = true,
1544 is_ground_content = false,
1547 liquidtype = "flowing",
1548 liquid_alternative_flowing = "default:river_water_flowing",
1549 liquid_alternative_source = "default:river_water_source",
1550 liquid_viscosity = 1,
1551 liquid_renewable = false,
1553 post_effect_color = {a = 103, r = 30, g = 76, b = 90},
1554 groups = {water = 3, liquid = 3, puts_out_fire = 1,
1555 not_in_creative_inventory = 1, cools_lava = 1},
1556 sounds = default.node_sound_water_defaults(),
1560 minetest.register_node("default:lava_source", {
1561 description = "Lava Source",
1562 drawtype = "liquid",
1565 name = "default_lava_source_animated.png",
1567 type = "vertical_frames",
1575 -- New-style lava source material (mostly unused)
1577 name = "default_lava_source_animated.png",
1579 type = "vertical_frames",
1584 backface_culling = false,
1587 paramtype = "light",
1588 light_source = default.LIGHT_MAX - 1,
1592 buildable_to = true,
1593 is_ground_content = false,
1596 liquidtype = "source",
1597 liquid_alternative_flowing = "default:lava_flowing",
1598 liquid_alternative_source = "default:lava_source",
1599 liquid_viscosity = 7,
1600 liquid_renewable = false,
1601 damage_per_second = 4 * 2,
1602 post_effect_color = {a = 191, r = 255, g = 64, b = 0},
1603 groups = {lava = 3, liquid = 2, igniter = 1},
1606 minetest.register_node("default:lava_flowing", {
1607 description = "Flowing Lava",
1608 drawtype = "flowingliquid",
1609 tiles = {"default_lava.png"},
1612 name = "default_lava_flowing_animated.png",
1613 backface_culling = false,
1615 type = "vertical_frames",
1622 name = "default_lava_flowing_animated.png",
1623 backface_culling = true,
1625 type = "vertical_frames",
1632 paramtype = "light",
1633 paramtype2 = "flowingliquid",
1634 light_source = default.LIGHT_MAX - 1,
1638 buildable_to = true,
1639 is_ground_content = false,
1642 liquidtype = "flowing",
1643 liquid_alternative_flowing = "default:lava_flowing",
1644 liquid_alternative_source = "default:lava_source",
1645 liquid_viscosity = 7,
1646 liquid_renewable = false,
1647 damage_per_second = 4 * 2,
1648 post_effect_color = {a = 191, r = 255, g = 64, b = 0},
1649 groups = {lava = 3, liquid = 2, igniter = 1,
1650 not_in_creative_inventory = 1},
1654 -- Tools / "Advanced" crafting / Non-"natural"
1657 local chest_formspec =
1660 default.gui_bg_img ..
1661 default.gui_slots ..
1662 "list[current_name;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[current_name;main]" ..
1666 "listring[current_player;main]" ..
1667 default.get_hotbar_bg(0,4.85)
1669 local function get_locked_chest_formspec(pos)
1670 local spos = pos.x .. "," .. pos.y .. "," .. pos.z
1674 default.gui_bg_img ..
1675 default.gui_slots ..
1676 "list[nodemeta:" .. spos .. ";main;0,0.3;8,4;]" ..
1677 "list[current_player;main;0,4.85;8,1;]" ..
1678 "list[current_player;main;0,6.08;8,3;8]" ..
1679 "listring[nodemeta:" .. spos .. ";main]" ..
1680 "listring[current_player;main]" ..
1681 default.get_hotbar_bg(0,4.85)
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 default.can_interact_with_node(player, pos)
1757 allow_metadata_inventory_move = function(pos, from_list, from_index,
1758 to_list, to_index, count, player)
1759 if not default.can_interact_with_node(player, pos) then
1764 allow_metadata_inventory_put = function(pos, listname, index, stack, player)
1765 if not default.can_interact_with_node(player, pos) then
1768 return stack:get_count()
1770 allow_metadata_inventory_take = function(pos, listname, index, stack, player)
1771 if not default.can_interact_with_node(player, pos) then
1774 return stack:get_count()
1776 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1777 minetest.log("action", player:get_player_name() ..
1778 " moves " .. stack:get_name() ..
1779 " to locked chest at " .. minetest.pos_to_string(pos))
1781 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1782 minetest.log("action", player:get_player_name() ..
1783 " takes " .. stack:get_name() ..
1784 " from locked chest at " .. minetest.pos_to_string(pos))
1786 on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
1787 if default.can_interact_with_node(clicker, pos) then
1788 minetest.show_formspec(
1789 clicker:get_player_name(),
1790 "default:chest_locked",
1791 get_locked_chest_formspec(pos)
1796 on_blast = function() end,
1797 on_key_use = function(pos, player)
1798 local secret = minetest.get_meta(pos):get_string("key_lock_secret")
1799 local itemstack = player:get_wielded_item()
1800 local key_meta = itemstack:get_meta()
1802 if key_meta:get_string("secret") == "" then
1803 key_meta:set_string("secret", minetest.parse_json(itemstack:get_metadata()).secret)
1806 if secret ~= key_meta:get_string("secret") then
1810 minetest.show_formspec(
1811 player:get_player_name(),
1812 "default:chest_locked",
1813 get_locked_chest_formspec(pos)
1816 on_skeleton_key_use = function(pos, player, newsecret)
1817 local meta = minetest.get_meta(pos)
1818 local owner = meta:get_string("owner")
1819 local name = player:get_player_name()
1821 -- verify placer is owner of lockable chest
1822 if owner ~= name then
1823 minetest.record_protection_violation(pos, name)
1824 minetest.chat_send_player(name, "You do not own this chest.")
1828 local secret = meta:get_string("key_lock_secret")
1829 if secret == "" then
1831 meta:set_string("key_lock_secret", secret)
1834 return secret, "a locked chest", owner
1839 local bookshelf_formspec =
1842 default.gui_bg_img ..
1843 default.gui_slots ..
1844 "list[context;books;0,0.3;8,2;]" ..
1845 "list[current_player;main;0,2.85;8,1;]" ..
1846 "list[current_player;main;0,4.08;8,3;8]" ..
1847 "listring[context;books]" ..
1848 "listring[current_player;main]" ..
1849 default.get_hotbar_bg(0,2.85)
1851 local function get_bookshelf_formspec(inv)
1852 local formspec = bookshelf_formspec
1853 local invlist = inv and inv:get_list("books")
1854 -- Inventory slots overlay
1855 local bx, by = 0, 0.3
1861 if not invlist or invlist[i]:is_empty() then
1862 formspec = formspec ..
1863 "image[" .. bx .. "," .. by .. ";1,1;default_bookshelf_slot.png]"
1870 minetest.register_node("default:bookshelf", {
1871 description = "Bookshelf",
1872 tiles = {"default_wood.png", "default_wood.png", "default_wood.png",
1873 "default_wood.png", "default_bookshelf.png", "default_bookshelf.png"},
1874 paramtype2 = "facedir",
1875 is_ground_content = false,
1876 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
1877 sounds = default.node_sound_wood_defaults(),
1879 on_construct = function(pos)
1880 local meta = minetest.get_meta(pos)
1881 meta:set_string("formspec", get_bookshelf_formspec(nil))
1882 local inv = meta:get_inventory()
1883 inv:set_size("books", 8 * 2)
1885 can_dig = function(pos,player)
1886 local inv = minetest.get_meta(pos):get_inventory()
1887 return inv:is_empty("books")
1889 allow_metadata_inventory_put = function(pos, listname, index, stack)
1890 if minetest.get_item_group(stack:get_name(), "book") ~= 0 then
1891 return stack:get_count()
1895 on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
1896 minetest.log("action", player:get_player_name() ..
1897 " moves stuff in bookshelf at " .. minetest.pos_to_string(pos))
1898 local meta = minetest.get_meta(pos)
1899 meta:set_string("formspec", get_bookshelf_formspec(meta:get_inventory()))
1901 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1902 minetest.log("action", player:get_player_name() ..
1903 " moves stuff to bookshelf at " .. minetest.pos_to_string(pos))
1904 local meta = minetest.get_meta(pos)
1905 meta:set_string("formspec", get_bookshelf_formspec(meta:get_inventory()))
1907 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1908 minetest.log("action", player:get_player_name() ..
1909 " takes stuff from bookshelf at " .. minetest.pos_to_string(pos))
1910 local meta = minetest.get_meta(pos)
1911 meta:set_string("formspec", get_bookshelf_formspec(meta:get_inventory()))
1913 on_blast = function(pos)
1915 default.get_inventory_drops(pos, "books", drops)
1916 drops[#drops+1] = "default:bookshelf"
1917 minetest.remove_node(pos)
1922 local function register_sign(material, desc, def)
1923 minetest.register_node("default:sign_wall_" .. material, {
1924 description = desc .. " Sign",
1925 drawtype = "nodebox",
1926 tiles = {"default_sign_wall_" .. material .. ".png"},
1927 inventory_image = "default_sign_" .. material .. ".png",
1928 wield_image = "default_sign_" .. material .. ".png",
1929 paramtype = "light",
1930 paramtype2 = "wallmounted",
1931 sunlight_propagates = true,
1932 is_ground_content = false,
1935 type = "wallmounted",
1936 wall_top = {-0.4375, 0.4375, -0.3125, 0.4375, 0.5, 0.3125},
1937 wall_bottom = {-0.4375, -0.5, -0.3125, 0.4375, -0.4375, 0.3125},
1938 wall_side = {-0.5, -0.3125, -0.4375, -0.4375, 0.3125, 0.4375},
1940 groups = def.groups,
1941 legacy_wallmounted = true,
1942 sounds = def.sounds,
1944 on_construct = function(pos)
1945 --local n = minetest.get_node(pos)
1946 local meta = minetest.get_meta(pos)
1947 meta:set_string("formspec", "field[text;;${text}]")
1949 on_receive_fields = function(pos, formname, fields, sender)
1950 --print("Sign at "..minetest.pos_to_string(pos).." got "..dump(fields))
1951 local player_name = sender:get_player_name()
1952 if minetest.is_protected(pos, player_name) then
1953 minetest.record_protection_violation(pos, player_name)
1956 local meta = minetest.get_meta(pos)
1957 if not fields.text then return end
1958 minetest.log("action", (player_name or "") .. " wrote \"" ..
1959 fields.text .. "\" to sign at " .. minetest.pos_to_string(pos))
1960 meta:set_string("text", fields.text)
1961 meta:set_string("infotext", '"' .. fields.text .. '"')
1966 register_sign("wood", "Wooden", {
1967 sounds = default.node_sound_wood_defaults(),
1968 groups = {choppy = 2, attached_node = 1, flammable = 2, oddly_breakable_by_hand = 3}
1971 register_sign("steel", "Steel", {
1972 sounds = default.node_sound_metal_defaults(),
1973 groups = {cracky = 2, attached_node = 1}
1976 minetest.register_node("default:ladder_wood", {
1977 description = "Wooden Ladder",
1978 drawtype = "signlike",
1979 tiles = {"default_ladder_wood.png"},
1980 inventory_image = "default_ladder_wood.png",
1981 wield_image = "default_ladder_wood.png",
1982 paramtype = "light",
1983 paramtype2 = "wallmounted",
1984 sunlight_propagates = true,
1987 is_ground_content = false,
1989 type = "wallmounted",
1990 --wall_top = = <default>
1991 --wall_bottom = = <default>
1992 --wall_side = = <default>
1994 groups = {choppy = 2, oddly_breakable_by_hand = 3, flammable = 2},
1995 legacy_wallmounted = true,
1996 sounds = default.node_sound_wood_defaults(),
1999 minetest.register_node("default:ladder_steel", {
2000 description = "Steel Ladder",
2001 drawtype = "signlike",
2002 tiles = {"default_ladder_steel.png"},
2003 inventory_image = "default_ladder_steel.png",
2004 wield_image = "default_ladder_steel.png",
2005 paramtype = "light",
2006 paramtype2 = "wallmounted",
2007 sunlight_propagates = true,
2010 is_ground_content = false,
2012 type = "wallmounted",
2013 --wall_top = = <default>
2014 --wall_bottom = = <default>
2015 --wall_side = = <default>
2017 groups = {cracky = 2},
2018 sounds = default.node_sound_metal_defaults(),
2021 default.register_fence("default:fence_wood", {
2022 description = "Wooden Fence",
2023 texture = "default_fence_wood.png",
2024 inventory_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2025 wield_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2026 material = "default:wood",
2027 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
2028 sounds = default.node_sound_wood_defaults()
2031 default.register_fence("default:fence_acacia_wood", {
2032 description = "Acacia Fence",
2033 texture = "default_fence_acacia_wood.png",
2034 inventory_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2035 wield_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2036 material = "default:acacia_wood",
2037 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
2038 sounds = default.node_sound_wood_defaults()
2041 default.register_fence("default:fence_junglewood", {
2042 description = "Junglewood Fence",
2043 texture = "default_fence_junglewood.png",
2044 inventory_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126",
2045 wield_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126",
2046 material = "default:junglewood",
2047 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
2048 sounds = default.node_sound_wood_defaults()
2051 default.register_fence("default:fence_pine_wood", {
2052 description = "Pine Fence",
2053 texture = "default_fence_pine_wood.png",
2054 inventory_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2055 wield_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2056 material = "default:pine_wood",
2057 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
2058 sounds = default.node_sound_wood_defaults()
2061 default.register_fence("default:fence_aspen_wood", {
2062 description = "Aspen Fence",
2063 texture = "default_fence_aspen_wood.png",
2064 inventory_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2065 wield_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2066 material = "default:aspen_wood",
2067 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
2068 sounds = default.node_sound_wood_defaults()
2071 minetest.register_node("default:glass", {
2072 description = "Glass",
2073 drawtype = "glasslike_framed_optional",
2074 tiles = {"default_glass.png", "default_glass_detail.png"},
2075 paramtype = "light",
2076 sunlight_propagates = true,
2077 is_ground_content = false,
2078 groups = {cracky = 3, oddly_breakable_by_hand = 3},
2079 sounds = default.node_sound_glass_defaults(),
2082 minetest.register_node("default:obsidian_glass", {
2083 description = "Obsidian Glass",
2084 drawtype = "glasslike_framed_optional",
2085 tiles = {"default_obsidian_glass.png", "default_obsidian_glass_detail.png"},
2086 paramtype = "light",
2087 is_ground_content = false,
2088 sunlight_propagates = true,
2089 sounds = default.node_sound_glass_defaults(),
2090 groups = {cracky = 3},
2094 minetest.register_node("default:brick", {
2095 description = "Brick Block",
2096 paramtype2 = "facedir",
2098 tiles = {"default_brick.png"},
2099 is_ground_content = false,
2100 groups = {cracky = 3},
2101 sounds = default.node_sound_stone_defaults(),
2105 minetest.register_node("default:meselamp", {
2106 description = "Mese Lamp",
2107 drawtype = "glasslike",
2108 tiles = {"default_meselamp.png"},
2109 paramtype = "light",
2110 sunlight_propagates = true,
2111 is_ground_content = false,
2112 groups = {cracky = 3, oddly_breakable_by_hand = 3},
2113 sounds = default.node_sound_glass_defaults(),
2114 light_source = default.LIGHT_MAX,
2117 minetest.register_node("default:mese_post_light", {
2118 description = "Mese Post Light",
2119 tiles = {"default_mese_post_light_top.png", "default_mese_post_light_top.png",
2120 "default_mese_post_light_side_dark.png", "default_mese_post_light_side_dark.png",
2121 "default_mese_post_light_side.png", "default_mese_post_light_side.png"},
2122 wield_image = "default_mese_post_light_side.png",
2123 drawtype = "nodebox",
2127 {-2 / 16, -8 / 16, -2 / 16, 2 / 16, 8 / 16, 2 / 16},
2130 paramtype = "light",
2131 light_source = default.LIGHT_MAX,
2132 sunlight_propagates = true,
2133 is_ground_content = false,
2134 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
2135 sounds = default.node_sound_wood_defaults(),
2142 minetest.register_node("default:cloud", {
2143 description = "Cloud",
2144 tiles = {"default_cloud.png"},
2145 is_ground_content = false,
2146 sounds = default.node_sound_defaults(),
2147 groups = {not_in_creative_inventory = 1},
2151 -- register trees for leafdecay
2154 if minetest.get_mapgen_setting("mg_name") == "v6" then
2155 default.register_leafdecay({
2156 trunks = {"default:tree"},
2157 leaves = {"default:apple", "default:leaves"},
2161 default.register_leafdecay({
2162 trunks = {"default:jungletree"},
2163 leaves = {"default:jungleleaves"},
2167 default.register_leafdecay({
2168 trunks = {"default:pine_tree"},
2169 leaves = {"default:pine_needles"},
2173 default.register_leafdecay({
2174 trunks = {"default:tree"},
2175 leaves = {"default:apple", "default:leaves"},
2179 default.register_leafdecay({
2180 trunks = {"default:jungletree"},
2181 leaves = {"default:jungleleaves"},
2185 default.register_leafdecay({
2186 trunks = {"default:pine_tree"},
2187 leaves = {"default:pine_needles"},
2192 default.register_leafdecay({
2193 trunks = {"default:acacia_tree"},
2194 leaves = {"default:acacia_leaves"},
2198 default.register_leafdecay({
2199 trunks = {"default:aspen_tree"},
2200 leaves = {"default:aspen_leaves"},