2
0

init.lua 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. --
  2. -- Aliases for map generator outputs
  3. --
  4. -- ESSENTIAL node aliases
  5. -- Basic nodes
  6. minetest.register_alias("mapgen_stone", "basenodes:stone")
  7. minetest.register_alias("mapgen_water_source", "basenodes:water_source")
  8. minetest.register_alias("mapgen_river_water_source", "basenodes:river_water_source")
  9. -- Additional essential aliases for v6
  10. minetest.register_alias("mapgen_lava_source", "basenodes:lava_source")
  11. minetest.register_alias("mapgen_dirt", "basenodes:dirt")
  12. minetest.register_alias("mapgen_dirt_with_grass", "basenodes:dirt_with_grass")
  13. minetest.register_alias("mapgen_sand", "basenodes:sand")
  14. minetest.register_alias("mapgen_tree", "basenodes:tree")
  15. minetest.register_alias("mapgen_leaves", "basenodes:leaves")
  16. minetest.register_alias("mapgen_apple", "basenodes:apple")
  17. -- Essential alias for dungeons
  18. minetest.register_alias("mapgen_cobble", "basenodes:cobble")
  19. -- Optional aliases for v6 (they all have fallback values in the engine)
  20. if minetest.settings:get_bool("devtest_v6_mapgen_aliases", false) then
  21. minetest.register_alias("mapgen_gravel", "basenodes:gravel")
  22. minetest.register_alias("mapgen_desert_stone", "basenodes:desert_stone")
  23. minetest.register_alias("mapgen_desert_sand", "basenodes:desert_sand")
  24. minetest.register_alias("mapgen_dirt_with_snow", "basenodes:dirt_with_snow")
  25. minetest.register_alias("mapgen_snowblock", "basenodes:snowblock")
  26. minetest.register_alias("mapgen_snow", "basenodes:snow")
  27. minetest.register_alias("mapgen_ice", "basenodes:ice")
  28. minetest.register_alias("mapgen_junglegrass", "basenodes:junglegrass")
  29. minetest.register_alias("mapgen_jungletree", "basenodes:jungletree")
  30. minetest.register_alias("mapgen_jungleleaves", "basenodes:jungleleaves")
  31. minetest.register_alias("mapgen_pine_tree", "basenodes:pine_tree")
  32. minetest.register_alias("mapgen_pine_needles", "basenodes:pine_needles")
  33. end
  34. -- Optional alias for mossycobble (should fall back to cobble)
  35. if minetest.settings:get_bool("devtest_dungeon_mossycobble", false) then
  36. minetest.register_alias("mapgen_mossycobble", "basenodes:mossycobble")
  37. end
  38. -- Optional aliases for dungeon stairs (should fall back to full nodes)
  39. if minetest.settings:get_bool("devtest_dungeon_stairs", false) then
  40. minetest.register_alias("mapgen_stair_cobble", "stairs:stair_cobble")
  41. if minetest.settings:get_bool("devtest_v6_mapgen_aliases", false) then
  42. minetest.register_alias("mapgen_stair_desert_stone", "stairs:stair_desert_stone")
  43. end
  44. end
  45. --
  46. -- Register biomes for biome API
  47. --
  48. minetest.clear_registered_biomes()
  49. minetest.clear_registered_decorations()
  50. if minetest.settings:get_bool("devtest_register_biomes", true) then
  51. minetest.register_biome({
  52. name = "mapgen:grassland",
  53. node_top = "basenodes:dirt_with_grass",
  54. depth_top = 1,
  55. node_filler = "basenodes:dirt",
  56. depth_filler = 1,
  57. node_riverbed = "basenodes:sand",
  58. depth_riverbed = 2,
  59. node_dungeon = "basenodes:cobble",
  60. node_dungeon_alt = "basenodes:mossycobble",
  61. node_dungeon_stair = "stairs:stair_cobble",
  62. y_max = 31000,
  63. y_min = 4,
  64. heat_point = 50,
  65. humidity_point = 50,
  66. })
  67. minetest.register_biome({
  68. name = "mapgen:grassland_ocean",
  69. node_top = "basenodes:sand",
  70. depth_top = 1,
  71. node_filler = "basenodes:sand",
  72. depth_filler = 3,
  73. node_riverbed = "basenodes:sand",
  74. depth_riverbed = 2,
  75. node_cave_liquid = "basenodes:water_source",
  76. node_dungeon = "basenodes:cobble",
  77. node_dungeon_alt = "basenodes:mossycobble",
  78. node_dungeon_stair = "stairs:stair_cobble",
  79. y_max = 3,
  80. y_min = -255,
  81. heat_point = 50,
  82. humidity_point = 50,
  83. })
  84. minetest.register_biome({
  85. name = "mapgen:grassland_under",
  86. node_cave_liquid = {"basenodes:water_source", "basenodes:lava_source"},
  87. node_dungeon = "basenodes:cobble",
  88. node_dungeon_alt = "basenodes:mossycobble",
  89. node_dungeon_stair = "stairs:stair_cobble",
  90. y_max = -256,
  91. y_min = -31000,
  92. heat_point = 50,
  93. humidity_point = 50,
  94. })
  95. end