biomes.lua 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. -- clear default mapgen biomes, decorations but keep ores
  2. minetest.clear_registered_biomes()
  3. minetest.clear_registered_decorations()
  4. --minetest.clear_registered_ores()
  5. -- helper strings
  6. local tmp, tmp2
  7. -- helper function
  8. local add_biome = function(a, l, m, n, o, p, b, c, d, e, f, g)
  9. -- if not 1 then biome disabled, don't add
  10. if p ~= 1 then return end
  11. minetest.register_biome({
  12. name = a,
  13. node_dust = b,
  14. node_top = c,
  15. depth_top = d,
  16. node_filler = e,
  17. depth_filler = f,
  18. node_stone = g,
  19. -- node_water_top = h,
  20. -- depth_water_top = i,
  21. -- node_water = j,
  22. -- node_river_water = k,
  23. y_min = l,
  24. y_max = m,
  25. heat_point = n,
  26. humidity_point = o
  27. })
  28. end
  29. -- add_biome(name, y_min, y_max, heat, humidity, biome enabled,
  30. -- dust node, top node, depth, filler node, depth, stone node)
  31. -- always registered biomes
  32. add_biome("mountain", 140, 31000, 50, 50, 1,
  33. nil, "default:snow", 1, "default:snowblock", 2)
  34. add_biome("clearing", 3, 71, 45, 65, 1,
  35. nil, "default:dirt_with_grass", 1, "default:dirt", 3)
  36. add_biome("underground", -31000, -192, 50, 50, 1,
  37. nil, nil, nil, nil, nil)
  38. -- biomes with disable setting
  39. tmp = "default:desert_stone"
  40. add_biome("desert", 3, 23, 35, 20, ethereal.desert,
  41. nil, "default:desert_sand", 1, "default:desert_sand", 3, tmp)
  42. add_biome("desert_ocean", -192, 3, 35, 20, ethereal.desert,
  43. nil, "default:sand", 1, "default:sand", 2, tmp)
  44. add_biome("bamboo", 25, 70, 45, 75, ethereal.bamboo,
  45. nil, "ethereal:bamboo_dirt", 1, "default:dirt", 3)
  46. add_biome("sakura", 3, 25, 45, 75, ethereal.sakura,
  47. nil, "ethereal:bamboo_dirt", 1, "default:dirt", 3)
  48. add_biome("sakura_ocean", -192, 2, 45, 75, ethereal.sakura,
  49. nil, "default:sand", 1, "default:sand", 2)
  50. add_biome("mesa", 1, 71, 25, 28, ethereal.mesa,
  51. nil, "default:dirt_with_dry_grass", 1, "bakedclay:orange", 15)
  52. add_biome("mesa_ocean", -192, 1, 25, 28, ethereal.mesa,
  53. nil, "default:sand", 1, "default:sand", 2)
  54. tmp = "default:dirt_with_coniferous_litter"
  55. if not minetest.registered_nodes[tmp] then
  56. tmp = "ethereal:cold_dirt"
  57. end
  58. add_biome("snowy", 4, 40, 10, 40, ethereal.snowy,
  59. nil, tmp, 1, "default:dirt", 2)
  60. add_biome("alpine", 40, 140, 10, 40, ethereal.alpine,
  61. nil, "default:dirt_with_snow", 1, "default:dirt", 2)
  62. add_biome("frost", 1, 71, 10, 40, ethereal.frost,
  63. nil, "ethereal:crystal_dirt", 1, "default:dirt", 3)
  64. add_biome("frost_ocean", -192, 1, 10, 40, ethereal.frost,
  65. nil, "default:sand", 1, "default:sand", 2)
  66. add_biome("grassy", 3, 91, 13, 40, ethereal.grassy,
  67. nil, "default:dirt_with_grass", 1, "default:dirt", 3)
  68. add_biome("grassy_ocean", -31000, 3, 13, 40, ethereal.grassy,
  69. nil, "default:sand", 2, "default:gravel", 1)
  70. add_biome("caves", 4, 41, 15, 25, ethereal.caves,
  71. nil, "default:desert_stone", 3, "air", 8)
  72. tmp = "default:silver_sand"
  73. if not minetest.registered_nodes[tmp] then
  74. tmp = "default:sand"
  75. end
  76. add_biome("grayness", 2, 41, 15, 30, ethereal.grayness,
  77. nil, "ethereal:gray_dirt", 1, "default:dirt", 3)
  78. add_biome("grayness_ocean", -192, 1, 15, 30, ethereal.grayness,
  79. nil, tmp, 2, "default:sand", 2)
  80. add_biome("grassytwo", 1, 91, 15, 40, ethereal.grassytwo,
  81. nil, "default:dirt_with_grass", 1, "default:dirt", 3)
  82. add_biome("grassytwo_ocean", -192, 1, 15, 40, ethereal.grassytwo,
  83. nil, "default:sand", 1, "default:sand", 2)
  84. add_biome("prairie", 3, 26, 20, 40, ethereal.prairie,
  85. nil, "ethereal:prairie_dirt", 1, "default:dirt", 3)
  86. add_biome("prairie_ocean", -192, 1, 20, 40, ethereal.prairie,
  87. nil, "default:sand", 1, "default:sand", 2)
  88. add_biome("jumble", 1, 71, 25, 50, ethereal.jumble,
  89. nil, "default:dirt_with_grass", 1, "default:dirt", 3)
  90. add_biome("jumble_ocean", -192, 1, 25, 50, ethereal.jumble,
  91. nil, "default:sand", 1, "default:sand", 2)
  92. tmp = "default:dirt_with_rainforest_litter"
  93. if not minetest.registered_nodes[tmp] then
  94. tmp = "ethereal:jungle_dirt"
  95. end
  96. add_biome("junglee", 1, 71, 30, 60, ethereal.junglee,
  97. nil, tmp, 1, "default:dirt", 3)
  98. add_biome("junglee_ocean", -192, 1, 30, 60, ethereal.junglee,
  99. nil, "default:sand", 1, "default:sand", 2)
  100. add_biome("grove", 3, 23, 45, 35, ethereal.grove,
  101. nil, "ethereal:grove_dirt", 1, "default:dirt", 3)
  102. add_biome("grove_ocean", -192, 2, 45, 35, ethereal.grove,
  103. nil, "default:sand", 1, "default:sand", 2)
  104. add_biome("mushroom", 3, 50, 45, 55, ethereal.mushroom,
  105. nil, "ethereal:mushroom_dirt", 1, "default:dirt", 3)
  106. add_biome("mushroom_ocean", -192, 2, 45, 55, ethereal.mushroom,
  107. nil, "default:sand", 1, "default:sand", 2)
  108. add_biome("sandstone", 3, 23, 50, 20, ethereal.sandstone,
  109. nil, "default:sandstone", 1, "default:sandstone", 1, "default:sandstone")
  110. add_biome("sandstone_ocean", -192, 2, 50, 20, ethereal.sandstone,
  111. nil, "default:sand", 1, "default:sand", 2)
  112. add_biome("quicksand", 1, 1, 50, 38, ethereal.quicksand,
  113. nil, "ethereal:quicksand2", 3, "default:gravel", 1)
  114. add_biome("plains", 3, 25, 65, 25, ethereal.plains,
  115. nil, "ethereal:dry_dirt", 1, "default:dirt", 3)
  116. add_biome("plains_ocean", -192, 2, 55, 25, ethereal.plains,
  117. nil, "default:sand", 1, "default:sand", 2)
  118. tmp = "default:dry_dirt_with_dry_grass"
  119. tmp2 = "default:dry_dirt"
  120. if not minetest.registered_nodes[tmp] then
  121. tmp = "default:dirt_with_dry_grass"
  122. tmp2 = "default:dirt"
  123. end
  124. add_biome("savanna", 3, 50, 55, 25, ethereal.savanna,
  125. nil, tmp, 1, tmp2, 3)
  126. add_biome("savanna_ocean", -192, 1, 55, 25, ethereal.savanna,
  127. nil, "default:sand", 1, "default:sand", 2)
  128. add_biome("fiery", 5, 20, 75, 10, ethereal.fiery,
  129. nil, "ethereal:fiery_dirt", 1, "default:dirt", 3)
  130. add_biome("fiery_ocean", -192, 4, 75, 10, ethereal.fiery,
  131. nil, "default:sand", 1, "default:sand", 2)
  132. add_biome("sandclay", 1, 11, 65, 2, ethereal.sandclay,
  133. nil, "default:sand", 3, "default:clay", 2)
  134. add_biome("swamp", 1, 7, 80, 90, ethereal.swamp,
  135. nil, "default:dirt_with_grass", 1, "default:dirt", 3)
  136. add_biome("swamp_ocean", -192, 1, 80, 90, ethereal.swamp,
  137. nil, "default:sand", 2, "default:clay", 2)
  138. if ethereal.glacier == 1 then
  139. minetest.register_biome({
  140. name = "glacier",
  141. node_dust = "default:snowblock",
  142. node_top = "default:snowblock",
  143. depth_top = 1,
  144. node_filler = "default:snowblock",
  145. depth_filler = 3,
  146. node_stone = "default:ice",
  147. node_water_top = "default:ice",
  148. depth_water_top = 10,
  149. node_river_water = "default:ice",
  150. node_riverbed = "default:gravel",
  151. depth_riverbed = 2,
  152. y_min = -8,
  153. y_max = 31000,
  154. heat_point = 0,
  155. humidity_point = 50,
  156. })
  157. minetest.register_biome({
  158. name = "glacier_ocean",
  159. node_dust = "default:snowblock",
  160. node_top = "default:sand",
  161. depth_top = 1,
  162. node_filler = "default:sand",
  163. depth_filler = 3,
  164. y_min = -112,
  165. y_max = -9,
  166. heat_point = 0,
  167. humidity_point = 50,
  168. })
  169. end
  170. if ethereal.tundra and minetest.registered_nodes["default:permafrost"] then
  171. minetest.register_biome({
  172. name = "tundra_highland",
  173. node_dust = "default:snow",
  174. node_riverbed = "default:gravel",
  175. depth_riverbed = 2,
  176. y_max = 180,
  177. y_min = 47,
  178. heat_point = 0,
  179. humidity_point = 40,
  180. })
  181. minetest.register_biome({
  182. name = "tundra",
  183. node_top = "default:permafrost_with_stones",
  184. depth_top = 1,
  185. node_filler = "default:permafrost",
  186. depth_filler = 1,
  187. node_riverbed = "default:gravel",
  188. depth_riverbed = 2,
  189. vertical_blend = 4,
  190. y_max = 46,
  191. y_min = 2,
  192. heat_point = 0,
  193. humidity_point = 40,
  194. })
  195. minetest.register_biome({
  196. name = "tundra_beach",
  197. node_top = "default:gravel",
  198. depth_top = 1,
  199. node_filler = "default:gravel",
  200. depth_filler = 2,
  201. node_riverbed = "default:gravel",
  202. depth_riverbed = 2,
  203. vertical_blend = 1,
  204. y_max = 1,
  205. y_min = -3,
  206. heat_point = 0,
  207. humidity_point = 40,
  208. })
  209. minetest.register_biome({
  210. name = "tundra_ocean",
  211. node_top = "default:sand",
  212. depth_top = 1,
  213. node_filler = "default:sand",
  214. depth_filler = 3,
  215. node_riverbed = "default:gravel",
  216. depth_riverbed = 2,
  217. vertical_blend = 1,
  218. y_max = -4,
  219. y_min = -112,
  220. heat_point = 0,
  221. humidity_point = 40,
  222. })
  223. end