mapgen.lua.diff 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440
  1. 46,48d45
  2. < -- Blob ores
  3. < -- These first to avoid other ores in blobs
  4. <
  5. 51c48,51
  6. < function default.register_mgv6_blob_ores()
  7. ---
  8. > function default.register_mgv6_ores()
  9. >
  10. > -- Blob ore
  11. > -- These first to avoid other ores in blobs
  12. 136a137,407
  13. >
  14. > -- Scatter ores
  15. >
  16. > -- Coal
  17. >
  18. > minetest.register_ore({
  19. > ore_type = "scatter",
  20. > ore = "default:stone_with_coal",
  21. > wherein = "default:stone",
  22. > clust_scarcity = 8 * 8 * 8,
  23. > clust_num_ores = 9,
  24. > clust_size = 3,
  25. > y_min = 1025,
  26. > y_max = 31000,
  27. > })
  28. >
  29. > minetest.register_ore({
  30. > ore_type = "scatter",
  31. > ore = "default:stone_with_coal",
  32. > wherein = "default:stone",
  33. > clust_scarcity = 8 * 8 * 8,
  34. > clust_num_ores = 8,
  35. > clust_size = 3,
  36. > y_min = -31000,
  37. > y_max = 64,
  38. > })
  39. >
  40. > minetest.register_ore({
  41. > ore_type = "scatter",
  42. > ore = "default:stone_with_coal",
  43. > wherein = "default:stone",
  44. > clust_scarcity = 24 * 24 * 24,
  45. > clust_num_ores = 27,
  46. > clust_size = 6,
  47. > y_min = -31000,
  48. > y_max = 0,
  49. > })
  50. >
  51. > -- Iron
  52. >
  53. > minetest.register_ore({
  54. > ore_type = "scatter",
  55. > ore = "default:stone_with_iron",
  56. > wherein = "default:stone",
  57. > clust_scarcity = 9 * 9 * 9,
  58. > clust_num_ores = 12,
  59. > clust_size = 3,
  60. > y_min = 1025,
  61. > y_max = 31000,
  62. > })
  63. >
  64. > minetest.register_ore({
  65. > ore_type = "scatter",
  66. > ore = "default:stone_with_iron",
  67. > wherein = "default:stone",
  68. > clust_scarcity = 7 * 7 * 7,
  69. > clust_num_ores = 5,
  70. > clust_size = 3,
  71. > y_min = -31000,
  72. > y_max = 0,
  73. > })
  74. >
  75. > minetest.register_ore({
  76. > ore_type = "scatter",
  77. > ore = "default:stone_with_iron",
  78. > wherein = "default:stone",
  79. > clust_scarcity = 24 * 24 * 24,
  80. > clust_num_ores = 27,
  81. > clust_size = 6,
  82. > y_min = -31000,
  83. > y_max = -64,
  84. > })
  85. >
  86. > -- Copper
  87. >
  88. > minetest.register_ore({
  89. > ore_type = "scatter",
  90. > ore = "default:stone_with_copper",
  91. > wherein = "default:stone",
  92. > clust_scarcity = 9 * 9 * 9,
  93. > clust_num_ores = 5,
  94. > clust_size = 3,
  95. > y_min = 1025,
  96. > y_max = 31000,
  97. > })
  98. >
  99. > minetest.register_ore({
  100. > ore_type = "scatter",
  101. > ore = "default:stone_with_copper",
  102. > wherein = "default:stone",
  103. > clust_scarcity = 12 * 12 * 12,
  104. > clust_num_ores = 4,
  105. > clust_size = 3,
  106. > y_min = -63,
  107. > y_max = -16,
  108. > })
  109. >
  110. > minetest.register_ore({
  111. > ore_type = "scatter",
  112. > ore = "default:stone_with_copper",
  113. > wherein = "default:stone",
  114. > clust_scarcity = 9 * 9 * 9,
  115. > clust_num_ores = 5,
  116. > clust_size = 3,
  117. > y_min = -31000,
  118. > y_max = -64,
  119. > })
  120. >
  121. > -- Tin
  122. >
  123. > minetest.register_ore({
  124. > ore_type = "scatter",
  125. > ore = "default:stone_with_tin",
  126. > wherein = "default:stone",
  127. > clust_scarcity = 10 * 10 * 10,
  128. > clust_num_ores = 5,
  129. > clust_size = 3,
  130. > y_min = 1025,
  131. > y_max = 31000,
  132. > })
  133. >
  134. > minetest.register_ore({
  135. > ore_type = "scatter",
  136. > ore = "default:stone_with_tin",
  137. > wherein = "default:stone",
  138. > clust_scarcity = 13 * 13 * 13,
  139. > clust_num_ores = 4,
  140. > clust_size = 3,
  141. > y_min = -127,
  142. > y_max = -32,
  143. > })
  144. >
  145. > minetest.register_ore({
  146. > ore_type = "scatter",
  147. > ore = "default:stone_with_tin",
  148. > wherein = "default:stone",
  149. > clust_scarcity = 10 * 10 * 10,
  150. > clust_num_ores = 5,
  151. > clust_size = 3,
  152. > y_min = -31000,
  153. > y_max = -128,
  154. > })
  155. >
  156. > -- Gold
  157. >
  158. > minetest.register_ore({
  159. > ore_type = "scatter",
  160. > ore = "default:stone_with_gold",
  161. > wherein = "default:stone",
  162. > clust_scarcity = 13 * 13 * 13,
  163. > clust_num_ores = 5,
  164. > clust_size = 3,
  165. > y_min = 1025,
  166. > y_max = 31000,
  167. > })
  168. >
  169. > minetest.register_ore({
  170. > ore_type = "scatter",
  171. > ore = "default:stone_with_gold",
  172. > wherein = "default:stone",
  173. > clust_scarcity = 15 * 15 * 15,
  174. > clust_num_ores = 3,
  175. > clust_size = 2,
  176. > y_min = -255,
  177. > y_max = -64,
  178. > })
  179. >
  180. > minetest.register_ore({
  181. > ore_type = "scatter",
  182. > ore = "default:stone_with_gold",
  183. > wherein = "default:stone",
  184. > clust_scarcity = 13 * 13 * 13,
  185. > clust_num_ores = 5,
  186. > clust_size = 3,
  187. > y_min = -31000,
  188. > y_max = -256,
  189. > })
  190. >
  191. > -- Mese crystal
  192. >
  193. > minetest.register_ore({
  194. > ore_type = "scatter",
  195. > ore = "default:stone_with_mese",
  196. > wherein = "default:stone",
  197. > clust_scarcity = 14 * 14 * 14,
  198. > clust_num_ores = 5,
  199. > clust_size = 3,
  200. > y_min = 1025,
  201. > y_max = 31000,
  202. > })
  203. >
  204. > minetest.register_ore({
  205. > ore_type = "scatter",
  206. > ore = "default:stone_with_mese",
  207. > wherein = "default:stone",
  208. > clust_scarcity = 18 * 18 * 18,
  209. > clust_num_ores = 3,
  210. > clust_size = 2,
  211. > y_min = -255,
  212. > y_max = -64,
  213. > })
  214. >
  215. > minetest.register_ore({
  216. > ore_type = "scatter",
  217. > ore = "default:stone_with_mese",
  218. > wherein = "default:stone",
  219. > clust_scarcity = 14 * 14 * 14,
  220. > clust_num_ores = 5,
  221. > clust_size = 3,
  222. > y_min = -31000,
  223. > y_max = -256,
  224. > })
  225. >
  226. > -- Diamond
  227. >
  228. > minetest.register_ore({
  229. > ore_type = "scatter",
  230. > ore = "default:stone_with_diamond",
  231. > wherein = "default:stone",
  232. > clust_scarcity = 15 * 15 * 15,
  233. > clust_num_ores = 4,
  234. > clust_size = 3,
  235. > y_min = 1025,
  236. > y_max = 31000,
  237. > })
  238. >
  239. > minetest.register_ore({
  240. > ore_type = "scatter",
  241. > ore = "default:stone_with_diamond",
  242. > wherein = "default:stone",
  243. > clust_scarcity = 17 * 17 * 17,
  244. > clust_num_ores = 4,
  245. > clust_size = 3,
  246. > y_min = -255,
  247. > y_max = -128,
  248. > })
  249. >
  250. > minetest.register_ore({
  251. > ore_type = "scatter",
  252. > ore = "default:stone_with_diamond",
  253. > wherein = "default:stone",
  254. > clust_scarcity = 15 * 15 * 15,
  255. > clust_num_ores = 4,
  256. > clust_size = 3,
  257. > y_min = -31000,
  258. > y_max = -256,
  259. > })
  260. >
  261. > -- Mese block
  262. >
  263. > minetest.register_ore({
  264. > ore_type = "scatter",
  265. > ore = "default:mese",
  266. > wherein = "default:stone",
  267. > clust_scarcity = 36 * 36 * 36,
  268. > clust_num_ores = 3,
  269. > clust_size = 2,
  270. > y_min = 1025,
  271. > y_max = 31000,
  272. > })
  273. >
  274. > minetest.register_ore({
  275. > ore_type = "scatter",
  276. > ore = "default:mese",
  277. > wherein = "default:stone",
  278. > clust_scarcity = 36 * 36 * 36,
  279. > clust_num_ores = 3,
  280. > clust_size = 2,
  281. > y_min = -31000,
  282. > y_max = -1024,
  283. > })
  284. 142c413,416
  285. < function default.register_blob_ores()
  286. ---
  287. > function default.register_ores()
  288. >
  289. > -- Blob ore
  290. > -- These first to avoid other ores in blobs
  291. 144a419
  292. > -- This first to avoid clay in sand blobs
  293. 191c466
  294. < "floatland_ocean", "floatland_grassland", "floatland_coniferous_forest"}
  295. ---
  296. > "floatland_coniferous_forest", "floatland_coniferous_forest_ocean"}
  297. 215,216c490
  298. < "rainforest", "rainforest_swamp", "floatland_grassland",
  299. < "floatland_coniferous_forest"}
  300. ---
  301. > "rainforest", "rainforest_swamp", "floatland_coniferous_forest"}
  302. 245c519
  303. < "floatland_ocean", "floatland_grassland", "floatland_coniferous_forest"}
  304. ---
  305. > "floatland_coniferous_forest", "floatland_coniferous_forest_ocean"}
  306. 247,248d520
  307. < end
  308. <
  309. 250,253c522
  310. < -- Scatter ores
  311. < -- All mapgens
  312. <
  313. < function default.register_ores()
  314. ---
  315. > -- Scatter ores
  316. 1178a1448
  317. > -- Used when mgv7 'biomerepeat' flag is false
  318. 1180,1202c1450
  319. < function default.register_floatland_biomes(floatland_level, shadow_limit)
  320. <
  321. < -- Coniferous forest
  322. <
  323. < minetest.register_biome({
  324. < name = "floatland_coniferous_forest",
  325. < --node_dust = "",
  326. < node_top = "default:dirt_with_grass",
  327. < depth_top = 1,
  328. < node_filler = "default:dirt",
  329. < depth_filler = 3,
  330. < --node_stone = "",
  331. < --node_water_top = "",
  332. < --depth_water_top = ,
  333. < --node_water = "",
  334. < --node_river_water = "",
  335. < --node_riverbed = "",
  336. < --depth_riverbed = ,
  337. < y_min = floatland_level + 2,
  338. < y_max = 31000,
  339. < heat_point = 50,
  340. < humidity_point = 70,
  341. < })
  342. ---
  343. > -- TODO Temporary simple biomes to be replaced by special floatland biomes later.
  344. 1204c1452
  345. < -- Grassland
  346. ---
  347. > function default.register_floatland_biomes(floatland_level, shadow_limit)
  348. 1220c1468
  349. < y_min = floatland_level + 2,
  350. ---
  351. > y_min = floatland_level + 4,
  352. 1223,1245c1471
  353. < humidity_point = 35,
  354. < })
  355. <
  356. < -- Sandstone desert
  357. <
  358. < minetest.register_biome({
  359. < name = "floatland_sandstone_desert",
  360. < --node_dust = "",
  361. < node_top = "default:sand",
  362. < depth_top = 1,
  363. < node_filler = "default:sand",
  364. < depth_filler = 1,
  365. < node_stone = "default:sandstone",
  366. < --node_water_top = "",
  367. < --depth_water_top = ,
  368. < --node_water = "",
  369. < --node_river_water = "",
  370. < --node_riverbed = "",
  371. < --depth_riverbed = ,
  372. < y_min = floatland_level + 2,
  373. < y_max = 31000,
  374. < heat_point = 50,
  375. < humidity_point = 0,
  376. ---
  377. > humidity_point = 50,
  378. 1248,1249d1473
  379. < -- Floatland ocean / underground
  380. <
  381. 1251c1475
  382. < name = "floatland_ocean",
  383. ---
  384. > name = "floatland_grassland_ocean",
  385. 1265c1489
  386. < y_max = floatland_level + 1,
  387. ---
  388. > y_max = floatland_level + 3,
  389. 1383c1607
  390. < "floatland_grassland", "floatland_coniferous_forest"},
  391. ---
  392. > "floatland_grassland"},
  393. 1497c1721
  394. < biomes = {"taiga", "coniferous_forest", "floatland_coniferous_forest"},
  395. ---
  396. > biomes = {"taiga", "coniferous_forest"},
  397. 1797c2021
  398. < "mountains, ridges, nofloatlands"
  399. ---
  400. > "mountains, ridges, nofloatlands, caverns, biomerepeat"
  401. 1799a2024
  402. > local captures_nobiorep = string.match(mgv7_spflags, "nobiomerepeat")
  403. 1801,1802c2026,2031
  404. < local mgv7_floatland_level = minetest.get_mapgen_setting("mgv7_floatland_level") or 1280
  405. < local mgv7_shadow_limit = minetest.get_mapgen_setting("mgv7_shadow_limit") or 1024
  406. ---
  407. > -- Get setting or default
  408. > -- Make global for mods to use to register floatland biomes
  409. > default.mgv7_floatland_level =
  410. > minetest.get_mapgen_setting("mgv7_floatland_level") or 1280
  411. > default.mgv7_shadow_limit =
  412. > minetest.get_mapgen_setting("mgv7_shadow_limit") or 1024
  413. 1808a2038
  414. >
  415. 1810,1811c2040
  416. < default.register_mgv6_blob_ores()
  417. < default.register_ores()
  418. ---
  419. > default.register_mgv6_ores()
  420. 1813,1818c2042,2051
  421. < elseif mg_name == "v7" and captures_float == "floatlands" and
  422. < captures_nofloat ~= "nofloatlands" then
  423. < -- Mgv7 with floatlands
  424. < default.register_biomes(mgv7_shadow_limit - 1)
  425. < default.register_floatland_biomes(mgv7_floatland_level, mgv7_shadow_limit)
  426. < default.register_blob_ores()
  427. ---
  428. > elseif mg_name == "v7" and
  429. > captures_float == "floatlands" and
  430. > -- Need to check for 'nofloatlands' because that contains
  431. > -- 'floatlands' which makes the second condition true.
  432. > captures_nofloat ~= "nofloatlands" and
  433. > captures_nobiorep == "nobiomerepeat" then
  434. > -- Mgv7 with floatlands and floatland biomes
  435. > default.register_biomes(default.mgv7_shadow_limit - 1)
  436. > default.register_floatland_biomes(
  437. > default.mgv7_floatland_level, default.mgv7_shadow_limit)
  438. 1823d2055
  439. < default.register_blob_ores()