mapgen.lua 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059
  1. --
  2. -- Aliases for map generators
  3. --
  4. minetest.register_alias("mapgen_stone", "default:stone")
  5. minetest.register_alias("mapgen_dirt", "default:dirt")
  6. minetest.register_alias("mapgen_dirt_with_grass", "default:dirt_with_grass")
  7. minetest.register_alias("mapgen_sand", "default:sand")
  8. minetest.register_alias("mapgen_water_source", "default:water_source")
  9. minetest.register_alias("mapgen_river_water_source", "default:river_water_source")
  10. minetest.register_alias("mapgen_lava_source", "default:lava_source")
  11. minetest.register_alias("mapgen_gravel", "default:gravel")
  12. minetest.register_alias("mapgen_desert_stone", "default:desert_stone")
  13. minetest.register_alias("mapgen_desert_sand", "default:desert_sand")
  14. minetest.register_alias("mapgen_dirt_with_snow", "default:dirt_with_snow")
  15. minetest.register_alias("mapgen_snowblock", "default:snowblock")
  16. minetest.register_alias("mapgen_snow", "default:snow")
  17. minetest.register_alias("mapgen_ice", "default:ice")
  18. minetest.register_alias("mapgen_sandstone", "default:sandstone")
  19. -- Flora
  20. minetest.register_alias("mapgen_tree", "default:tree")
  21. minetest.register_alias("mapgen_leaves", "default:leaves")
  22. minetest.register_alias("mapgen_apple", "default:apple")
  23. minetest.register_alias("mapgen_jungletree", "default:jungletree")
  24. minetest.register_alias("mapgen_jungleleaves", "default:jungleleaves")
  25. minetest.register_alias("mapgen_junglegrass", "default:junglegrass")
  26. minetest.register_alias("mapgen_pine_tree", "default:pine_tree")
  27. minetest.register_alias("mapgen_pine_needles", "default:pine_needles")
  28. -- Dungeons
  29. minetest.register_alias("mapgen_cobble", "default:cobble")
  30. minetest.register_alias("mapgen_stair_cobble", "stairs:stair_cobble")
  31. minetest.register_alias("mapgen_mossycobble", "default:mossycobble")
  32. minetest.register_alias("mapgen_stair_desert_stone", "stairs:stair_desert_stone")
  33. minetest.register_alias("mapgen_sandstonebrick", "default:sandstonebrick")
  34. minetest.register_alias("mapgen_stair_sandstone_block", "stairs:stair_sandstone_block")
  35. --
  36. -- Register ores
  37. --
  38. -- Mgv6
  39. function default.register_mgv6_ores()
  40. -- Blob ore
  41. -- These first to avoid other ores in blobs
  42. -- Clay
  43. -- This first to avoid clay in sand blobs
  44. minetest.register_ore({
  45. ore_type = "blob",
  46. ore = "default:clay",
  47. wherein = {"default:sand"},
  48. clust_scarcity = 16 * 16 * 16,
  49. clust_size = 5,
  50. y_min = -15,
  51. y_max = 0,
  52. noise_threshold = 0.0,
  53. noise_params = {
  54. offset = 0.5,
  55. scale = 0.2,
  56. spread = {x = 5, y = 5, z = 5},
  57. seed = -316,
  58. octaves = 1,
  59. persist = 0.0
  60. },
  61. })
  62. -- Sand
  63. minetest.register_ore({
  64. ore_type = "blob",
  65. ore = "default:sand",
  66. wherein = {"default:stone", "default:desert_stone"},
  67. clust_scarcity = 16 * 16 * 16,
  68. clust_size = 5,
  69. y_min = -31,
  70. y_max = 0,
  71. noise_threshold = 0.0,
  72. noise_params = {
  73. offset = 0.5,
  74. scale = 0.2,
  75. spread = {x = 5, y = 5, z = 5},
  76. seed = 2316,
  77. octaves = 1,
  78. persist = 0.0
  79. },
  80. })
  81. -- Dirt
  82. minetest.register_ore({
  83. ore_type = "blob",
  84. ore = "default:dirt",
  85. wherein = {"default:stone"},
  86. clust_scarcity = 16 * 16 * 16,
  87. clust_size = 5,
  88. y_min = -31,
  89. y_max = 31000,
  90. noise_threshold = 0.0,
  91. noise_params = {
  92. offset = 0.5,
  93. scale = 0.2,
  94. spread = {x = 5, y = 5, z = 5},
  95. seed = 17676,
  96. octaves = 1,
  97. persist = 0.0
  98. },
  99. })
  100. -- Gravel
  101. minetest.register_ore({
  102. ore_type = "blob",
  103. ore = "default:gravel",
  104. wherein = {"default:stone"},
  105. clust_scarcity = 16 * 16 * 16,
  106. clust_size = 5,
  107. y_min = -31000,
  108. y_max = 31000,
  109. noise_threshold = 0.0,
  110. noise_params = {
  111. offset = 0.5,
  112. scale = 0.2,
  113. spread = {x = 5, y = 5, z = 5},
  114. seed = 766,
  115. octaves = 1,
  116. persist = 0.0
  117. },
  118. })
  119. -- Scatter ores
  120. -- Coal
  121. minetest.register_ore({
  122. ore_type = "scatter",
  123. ore = "default:stone_with_coal",
  124. wherein = "default:stone",
  125. clust_scarcity = 8 * 8 * 8,
  126. clust_num_ores = 9,
  127. clust_size = 3,
  128. y_min = 1025,
  129. y_max = 31000,
  130. })
  131. minetest.register_ore({
  132. ore_type = "scatter",
  133. ore = "default:stone_with_coal",
  134. wherein = "default:stone",
  135. clust_scarcity = 8 * 8 * 8,
  136. clust_num_ores = 8,
  137. clust_size = 3,
  138. y_min = -31000,
  139. y_max = 64,
  140. })
  141. minetest.register_ore({
  142. ore_type = "scatter",
  143. ore = "default:stone_with_coal",
  144. wherein = "default:stone",
  145. clust_scarcity = 24 * 24 * 24,
  146. clust_num_ores = 27,
  147. clust_size = 6,
  148. y_min = -31000,
  149. y_max = 0,
  150. })
  151. -- Iron
  152. minetest.register_ore({
  153. ore_type = "scatter",
  154. ore = "default:stone_with_iron",
  155. wherein = "default:stone",
  156. clust_scarcity = 9 * 9 * 9,
  157. clust_num_ores = 12,
  158. clust_size = 3,
  159. y_min = 1025,
  160. y_max = 31000,
  161. })
  162. minetest.register_ore({
  163. ore_type = "scatter",
  164. ore = "default:stone_with_iron",
  165. wherein = "default:stone",
  166. clust_scarcity = 7 * 7 * 7,
  167. clust_num_ores = 5,
  168. clust_size = 3,
  169. y_min = -31000,
  170. y_max = 0,
  171. })
  172. minetest.register_ore({
  173. ore_type = "scatter",
  174. ore = "default:stone_with_iron",
  175. wherein = "default:stone",
  176. clust_scarcity = 24 * 24 * 24,
  177. clust_num_ores = 27,
  178. clust_size = 6,
  179. y_min = -31000,
  180. y_max = -64,
  181. })
  182. -- Copper
  183. minetest.register_ore({
  184. ore_type = "scatter",
  185. ore = "default:stone_with_copper",
  186. wherein = "default:stone",
  187. clust_scarcity = 9 * 9 * 9,
  188. clust_num_ores = 5,
  189. clust_size = 3,
  190. y_min = 1025,
  191. y_max = 31000,
  192. })
  193. minetest.register_ore({
  194. ore_type = "scatter",
  195. ore = "default:stone_with_copper",
  196. wherein = "default:stone",
  197. clust_scarcity = 12 * 12 * 12,
  198. clust_num_ores = 4,
  199. clust_size = 3,
  200. y_min = -63,
  201. y_max = -16,
  202. })
  203. minetest.register_ore({
  204. ore_type = "scatter",
  205. ore = "default:stone_with_copper",
  206. wherein = "default:stone",
  207. clust_scarcity = 9 * 9 * 9,
  208. clust_num_ores = 5,
  209. clust_size = 3,
  210. y_min = -31000,
  211. y_max = -64,
  212. })
  213. -- Tin
  214. minetest.register_ore({
  215. ore_type = "scatter",
  216. ore = "default:stone_with_tin",
  217. wherein = "default:stone",
  218. clust_scarcity = 10 * 10 * 10,
  219. clust_num_ores = 5,
  220. clust_size = 3,
  221. y_min = 1025,
  222. y_max = 31000,
  223. })
  224. minetest.register_ore({
  225. ore_type = "scatter",
  226. ore = "default:stone_with_tin",
  227. wherein = "default:stone",
  228. clust_scarcity = 13 * 13 * 13,
  229. clust_num_ores = 4,
  230. clust_size = 3,
  231. y_min = -127,
  232. y_max = -32,
  233. })
  234. minetest.register_ore({
  235. ore_type = "scatter",
  236. ore = "default:stone_with_tin",
  237. wherein = "default:stone",
  238. clust_scarcity = 10 * 10 * 10,
  239. clust_num_ores = 5,
  240. clust_size = 3,
  241. y_min = -31000,
  242. y_max = -128,
  243. })
  244. -- Gold
  245. minetest.register_ore({
  246. ore_type = "scatter",
  247. ore = "default:stone_with_gold",
  248. wherein = "default:stone",
  249. clust_scarcity = 13 * 13 * 13,
  250. clust_num_ores = 5,
  251. clust_size = 3,
  252. y_min = 1025,
  253. y_max = 31000,
  254. })
  255. minetest.register_ore({
  256. ore_type = "scatter",
  257. ore = "default:stone_with_gold",
  258. wherein = "default:stone",
  259. clust_scarcity = 15 * 15 * 15,
  260. clust_num_ores = 3,
  261. clust_size = 2,
  262. y_min = -255,
  263. y_max = -64,
  264. })
  265. minetest.register_ore({
  266. ore_type = "scatter",
  267. ore = "default:stone_with_gold",
  268. wherein = "default:stone",
  269. clust_scarcity = 13 * 13 * 13,
  270. clust_num_ores = 5,
  271. clust_size = 3,
  272. y_min = -31000,
  273. y_max = -256,
  274. })
  275. -- Mese crystal
  276. minetest.register_ore({
  277. ore_type = "scatter",
  278. ore = "default:stone_with_mese",
  279. wherein = "default:stone",
  280. clust_scarcity = 14 * 14 * 14,
  281. clust_num_ores = 5,
  282. clust_size = 3,
  283. y_min = 1025,
  284. y_max = 31000,
  285. })
  286. minetest.register_ore({
  287. ore_type = "scatter",
  288. ore = "default:stone_with_mese",
  289. wherein = "default:stone",
  290. clust_scarcity = 18 * 18 * 18,
  291. clust_num_ores = 3,
  292. clust_size = 2,
  293. y_min = -255,
  294. y_max = -64,
  295. })
  296. minetest.register_ore({
  297. ore_type = "scatter",
  298. ore = "default:stone_with_mese",
  299. wherein = "default:stone",
  300. clust_scarcity = 14 * 14 * 14,
  301. clust_num_ores = 5,
  302. clust_size = 3,
  303. y_min = -31000,
  304. y_max = -256,
  305. })
  306. -- Diamond
  307. minetest.register_ore({
  308. ore_type = "scatter",
  309. ore = "default:stone_with_diamond",
  310. wherein = "default:stone",
  311. clust_scarcity = 15 * 15 * 15,
  312. clust_num_ores = 4,
  313. clust_size = 3,
  314. y_min = 1025,
  315. y_max = 31000,
  316. })
  317. minetest.register_ore({
  318. ore_type = "scatter",
  319. ore = "default:stone_with_diamond",
  320. wherein = "default:stone",
  321. clust_scarcity = 17 * 17 * 17,
  322. clust_num_ores = 4,
  323. clust_size = 3,
  324. y_min = -255,
  325. y_max = -128,
  326. })
  327. minetest.register_ore({
  328. ore_type = "scatter",
  329. ore = "default:stone_with_diamond",
  330. wherein = "default:stone",
  331. clust_scarcity = 15 * 15 * 15,
  332. clust_num_ores = 4,
  333. clust_size = 3,
  334. y_min = -31000,
  335. y_max = -256,
  336. })
  337. -- Mese block
  338. minetest.register_ore({
  339. ore_type = "scatter",
  340. ore = "default:mese",
  341. wherein = "default:stone",
  342. clust_scarcity = 36 * 36 * 36,
  343. clust_num_ores = 3,
  344. clust_size = 2,
  345. y_min = 1025,
  346. y_max = 31000,
  347. })
  348. minetest.register_ore({
  349. ore_type = "scatter",
  350. ore = "default:mese",
  351. wherein = "default:stone",
  352. clust_scarcity = 36 * 36 * 36,
  353. clust_num_ores = 3,
  354. clust_size = 2,
  355. y_min = -31000,
  356. y_max = -1024,
  357. })
  358. end
  359. -- All mapgens except mgv6
  360. function default.register_ores()
  361. -- Blob ore
  362. -- These first to avoid other ores in blobs
  363. -- Clay
  364. -- This first to avoid clay in sand blobs
  365. minetest.register_ore({
  366. ore_type = "blob",
  367. ore = "default:clay",
  368. wherein = {"default:sand"},
  369. clust_scarcity = 16 * 16 * 16,
  370. clust_size = 5,
  371. y_min = -15,
  372. y_max = 0,
  373. noise_threshold = 0.0,
  374. noise_params = {
  375. offset = 0.5,
  376. scale = 0.2,
  377. spread = {x = 5, y = 5, z = 5},
  378. seed = -316,
  379. octaves = 1,
  380. persist = 0.0
  381. },
  382. })
  383. -- Silver sand
  384. minetest.register_ore({
  385. ore_type = "blob",
  386. ore = "default:silver_sand",
  387. wherein = {"default:stone"},
  388. clust_scarcity = 16 * 16 * 16,
  389. clust_size = 5,
  390. y_min = -31000,
  391. y_max = 31000,
  392. noise_threshold = 0.0,
  393. noise_params = {
  394. offset = 0.5,
  395. scale = 0.2,
  396. spread = {x = 5, y = 5, z = 5},
  397. seed = 2316,
  398. octaves = 1,
  399. persist = 0.0
  400. },
  401. biomes = {"icesheet_ocean", "tundra", "tundra_beach", "tundra_ocean",
  402. "taiga", "taiga_ocean", "snowy_grassland", "snowy_grassland_ocean",
  403. "grassland", "grassland_dunes", "grassland_ocean", "coniferous_forest",
  404. "coniferous_forest_dunes", "coniferous_forest_ocean", "deciduous_forest",
  405. "deciduous_forest_shore", "deciduous_forest_ocean", "cold_desert",
  406. "cold_desert_ocean", "savanna", "savanna_shore", "savanna_ocean",
  407. "rainforest", "rainforest_swamp", "rainforest_ocean", "underground",
  408. "floatland_coniferous_forest", "floatland_coniferous_forest_ocean"}
  409. })
  410. -- Dirt
  411. minetest.register_ore({
  412. ore_type = "blob",
  413. ore = "default:dirt",
  414. wherein = {"default:stone"},
  415. clust_scarcity = 16 * 16 * 16,
  416. clust_size = 5,
  417. y_min = -31,
  418. y_max = 31000,
  419. noise_threshold = 0.0,
  420. noise_params = {
  421. offset = 0.5,
  422. scale = 0.2,
  423. spread = {x = 5, y = 5, z = 5},
  424. seed = 17676,
  425. octaves = 1,
  426. persist = 0.0
  427. },
  428. biomes = {"taiga", "snowy_grassland", "grassland", "coniferous_forest",
  429. "deciduous_forest", "deciduous_forest_shore", "savanna", "savanna_shore",
  430. "rainforest", "rainforest_swamp", "floatland_coniferous_forest"}
  431. })
  432. -- Gravel
  433. minetest.register_ore({
  434. ore_type = "blob",
  435. ore = "default:gravel",
  436. wherein = {"default:stone"},
  437. clust_scarcity = 16 * 16 * 16,
  438. clust_size = 5,
  439. y_min = -31000,
  440. y_max = 31000,
  441. noise_threshold = 0.0,
  442. noise_params = {
  443. offset = 0.5,
  444. scale = 0.2,
  445. spread = {x = 5, y = 5, z = 5},
  446. seed = 766,
  447. octaves = 1,
  448. persist = 0.0
  449. },
  450. biomes = {"icesheet_ocean", "tundra", "tundra_beach", "tundra_ocean",
  451. "taiga", "taiga_ocean", "snowy_grassland", "snowy_grassland_ocean",
  452. "grassland", "grassland_dunes", "grassland_ocean", "coniferous_forest",
  453. "coniferous_forest_dunes", "coniferous_forest_ocean", "deciduous_forest",
  454. "deciduous_forest_shore", "deciduous_forest_ocean", "cold_desert",
  455. "cold_desert_ocean", "savanna", "savanna_shore", "savanna_ocean",
  456. "rainforest", "rainforest_swamp", "rainforest_ocean", "underground",
  457. "floatland_coniferous_forest", "floatland_coniferous_forest_ocean"}
  458. })
  459. -- Scatter ores
  460. -- Coal
  461. minetest.register_ore({
  462. ore_type = "scatter",
  463. ore = "default:stone_with_coal",
  464. wherein = "default:stone",
  465. clust_scarcity = 8 * 8 * 8,
  466. clust_num_ores = 9,
  467. clust_size = 3,
  468. y_min = 1025,
  469. y_max = 31000,
  470. })
  471. minetest.register_ore({
  472. ore_type = "scatter",
  473. ore = "default:stone_with_coal",
  474. wherein = "default:stone",
  475. clust_scarcity = 8 * 8 * 8,
  476. clust_num_ores = 8,
  477. clust_size = 3,
  478. y_min = -31000,
  479. y_max = 64,
  480. })
  481. minetest.register_ore({
  482. ore_type = "scatter",
  483. ore = "default:stone_with_coal",
  484. wherein = "default:stone",
  485. clust_scarcity = 24 * 24 * 24,
  486. clust_num_ores = 27,
  487. clust_size = 6,
  488. y_min = -31000,
  489. y_max = 0,
  490. })
  491. -- Iron
  492. minetest.register_ore({
  493. ore_type = "scatter",
  494. ore = "default:stone_with_iron",
  495. wherein = "default:stone",
  496. clust_scarcity = 9 * 9 * 9,
  497. clust_num_ores = 12,
  498. clust_size = 3,
  499. y_min = 1025,
  500. y_max = 31000,
  501. })
  502. minetest.register_ore({
  503. ore_type = "scatter",
  504. ore = "default:stone_with_iron",
  505. wherein = "default:stone",
  506. clust_scarcity = 7 * 7 * 7,
  507. clust_num_ores = 5,
  508. clust_size = 3,
  509. y_min = -31000,
  510. y_max = 0,
  511. })
  512. minetest.register_ore({
  513. ore_type = "scatter",
  514. ore = "default:stone_with_iron",
  515. wherein = "default:stone",
  516. clust_scarcity = 24 * 24 * 24,
  517. clust_num_ores = 27,
  518. clust_size = 6,
  519. y_min = -31000,
  520. y_max = -64,
  521. })
  522. -- Copper
  523. minetest.register_ore({
  524. ore_type = "scatter",
  525. ore = "default:stone_with_copper",
  526. wherein = "default:stone",
  527. clust_scarcity = 9 * 9 * 9,
  528. clust_num_ores = 5,
  529. clust_size = 3,
  530. y_min = 1025,
  531. y_max = 31000,
  532. })
  533. minetest.register_ore({
  534. ore_type = "scatter",
  535. ore = "default:stone_with_copper",
  536. wherein = "default:stone",
  537. clust_scarcity = 12 * 12 * 12,
  538. clust_num_ores = 4,
  539. clust_size = 3,
  540. y_min = -63,
  541. y_max = -16,
  542. })
  543. minetest.register_ore({
  544. ore_type = "scatter",
  545. ore = "default:stone_with_copper",
  546. wherein = "default:stone",
  547. clust_scarcity = 9 * 9 * 9,
  548. clust_num_ores = 5,
  549. clust_size = 3,
  550. y_min = -31000,
  551. y_max = -64,
  552. })
  553. -- Tin
  554. minetest.register_ore({
  555. ore_type = "scatter",
  556. ore = "default:stone_with_tin",
  557. wherein = "default:stone",
  558. clust_scarcity = 10 * 10 * 10,
  559. clust_num_ores = 5,
  560. clust_size = 3,
  561. y_min = 1025,
  562. y_max = 31000,
  563. })
  564. minetest.register_ore({
  565. ore_type = "scatter",
  566. ore = "default:stone_with_tin",
  567. wherein = "default:stone",
  568. clust_scarcity = 13 * 13 * 13,
  569. clust_num_ores = 4,
  570. clust_size = 3,
  571. y_min = -127,
  572. y_max = -32,
  573. })
  574. minetest.register_ore({
  575. ore_type = "scatter",
  576. ore = "default:stone_with_tin",
  577. wherein = "default:stone",
  578. clust_scarcity = 10 * 10 * 10,
  579. clust_num_ores = 5,
  580. clust_size = 3,
  581. y_min = -31000,
  582. y_max = -128,
  583. })
  584. -- Gold
  585. minetest.register_ore({
  586. ore_type = "scatter",
  587. ore = "default:stone_with_gold",
  588. wherein = "default:stone",
  589. clust_scarcity = 13 * 13 * 13,
  590. clust_num_ores = 5,
  591. clust_size = 3,
  592. y_min = 1025,
  593. y_max = 31000,
  594. })
  595. minetest.register_ore({
  596. ore_type = "scatter",
  597. ore = "default:stone_with_gold",
  598. wherein = "default:stone",
  599. clust_scarcity = 15 * 15 * 15,
  600. clust_num_ores = 3,
  601. clust_size = 2,
  602. y_min = -255,
  603. y_max = -64,
  604. })
  605. minetest.register_ore({
  606. ore_type = "scatter",
  607. ore = "default:stone_with_gold",
  608. wherein = "default:stone",
  609. clust_scarcity = 13 * 13 * 13,
  610. clust_num_ores = 5,
  611. clust_size = 3,
  612. y_min = -31000,
  613. y_max = -256,
  614. })
  615. -- Mese crystal
  616. minetest.register_ore({
  617. ore_type = "scatter",
  618. ore = "default:stone_with_mese",
  619. wherein = "default:stone",
  620. clust_scarcity = 14 * 14 * 14,
  621. clust_num_ores = 5,
  622. clust_size = 3,
  623. y_min = 1025,
  624. y_max = 31000,
  625. })
  626. minetest.register_ore({
  627. ore_type = "scatter",
  628. ore = "default:stone_with_mese",
  629. wherein = "default:stone",
  630. clust_scarcity = 18 * 18 * 18,
  631. clust_num_ores = 3,
  632. clust_size = 2,
  633. y_min = -255,
  634. y_max = -64,
  635. })
  636. minetest.register_ore({
  637. ore_type = "scatter",
  638. ore = "default:stone_with_mese",
  639. wherein = "default:stone",
  640. clust_scarcity = 14 * 14 * 14,
  641. clust_num_ores = 5,
  642. clust_size = 3,
  643. y_min = -31000,
  644. y_max = -256,
  645. })
  646. -- Diamond
  647. minetest.register_ore({
  648. ore_type = "scatter",
  649. ore = "default:stone_with_diamond",
  650. wherein = "default:stone",
  651. clust_scarcity = 15 * 15 * 15,
  652. clust_num_ores = 4,
  653. clust_size = 3,
  654. y_min = 1025,
  655. y_max = 31000,
  656. })
  657. minetest.register_ore({
  658. ore_type = "scatter",
  659. ore = "default:stone_with_diamond",
  660. wherein = "default:stone",
  661. clust_scarcity = 17 * 17 * 17,
  662. clust_num_ores = 4,
  663. clust_size = 3,
  664. y_min = -255,
  665. y_max = -128,
  666. })
  667. minetest.register_ore({
  668. ore_type = "scatter",
  669. ore = "default:stone_with_diamond",
  670. wherein = "default:stone",
  671. clust_scarcity = 15 * 15 * 15,
  672. clust_num_ores = 4,
  673. clust_size = 3,
  674. y_min = -31000,
  675. y_max = -256,
  676. })
  677. -- Mese block
  678. minetest.register_ore({
  679. ore_type = "scatter",
  680. ore = "default:mese",
  681. wherein = "default:stone",
  682. clust_scarcity = 36 * 36 * 36,
  683. clust_num_ores = 3,
  684. clust_size = 2,
  685. y_min = 1025,
  686. y_max = 31000,
  687. })
  688. minetest.register_ore({
  689. ore_type = "scatter",
  690. ore = "default:mese",
  691. wherein = "default:stone",
  692. clust_scarcity = 36 * 36 * 36,
  693. clust_num_ores = 3,
  694. clust_size = 2,
  695. y_min = -31000,
  696. y_max = -1024,
  697. })
  698. end
  699. --
  700. -- Register biomes
  701. --
  702. -- All mapgens except mgv6
  703. function default.register_biomes(upper_limit)
  704. -- Icesheet
  705. minetest.register_biome({
  706. name = "icesheet",
  707. node_dust = "default:snowblock",
  708. node_top = "default:snowblock",
  709. depth_top = 1,
  710. node_filler = "default:snowblock",
  711. depth_filler = 3,
  712. node_stone = "default:ice",
  713. node_water_top = "default:ice",
  714. depth_water_top = 10,
  715. --node_water = "",
  716. node_river_water = "default:ice",
  717. node_riverbed = "default:gravel",
  718. depth_riverbed = 2,
  719. y_min = -8,
  720. y_max = upper_limit,
  721. heat_point = 0,
  722. humidity_point = 73,
  723. })
  724. minetest.register_biome({
  725. name = "icesheet_ocean",
  726. node_dust = "default:snowblock",
  727. node_top = "default:sand",
  728. depth_top = 1,
  729. node_filler = "default:sand",
  730. depth_filler = 3,
  731. --node_stone = "",
  732. node_water_top = "default:ice",
  733. depth_water_top = 10,
  734. --node_water = "",
  735. --node_river_water = "",
  736. y_min = -112,
  737. y_max = -9,
  738. heat_point = 0,
  739. humidity_point = 73,
  740. })
  741. -- Tundra
  742. minetest.register_biome({
  743. name = "tundra",
  744. node_dust = "default:snowblock",
  745. --node_top = ,
  746. --depth_top = ,
  747. --node_filler = ,
  748. --depth_filler = ,
  749. --node_stone = "",
  750. --node_water_top = "",
  751. --depth_water_top = ,
  752. --node_water = "",
  753. --node_river_water = "",
  754. node_riverbed = "default:gravel",
  755. depth_riverbed = 2,
  756. y_min = 2,
  757. y_max = upper_limit,
  758. heat_point = 0,
  759. humidity_point = 40,
  760. })
  761. minetest.register_biome({
  762. name = "tundra_beach",
  763. --node_dust = "",
  764. node_top = "default:gravel",
  765. depth_top = 1,
  766. node_filler = "default:gravel",
  767. depth_filler = 2,
  768. --node_stone = "",
  769. --node_water_top = "",
  770. --depth_water_top = ,
  771. --node_water = "",
  772. --node_river_water = "",
  773. node_riverbed = "default:gravel",
  774. depth_riverbed = 2,
  775. y_min = -3,
  776. y_max = 1,
  777. heat_point = 0,
  778. humidity_point = 40,
  779. })
  780. minetest.register_biome({
  781. name = "tundra_ocean",
  782. --node_dust = "",
  783. node_top = "default:sand",
  784. depth_top = 1,
  785. node_filler = "default:sand",
  786. depth_filler = 3,
  787. --node_stone = "",
  788. --node_water_top = "",
  789. --depth_water_top = ,
  790. --node_water = "",
  791. --node_river_water = "",
  792. node_riverbed = "default:gravel",
  793. depth_riverbed = 2,
  794. y_min = -112,
  795. y_max = -4,
  796. heat_point = 0,
  797. humidity_point = 40,
  798. })
  799. -- Taiga
  800. minetest.register_biome({
  801. name = "taiga",
  802. node_dust = "default:snow",
  803. node_top = "default:dirt_with_snow",
  804. depth_top = 1,
  805. node_filler = "default:dirt",
  806. depth_filler = 3,
  807. --node_stone = "",
  808. --node_water_top = "",
  809. --depth_water_top = ,
  810. --node_water = "",
  811. --node_river_water = "",
  812. node_riverbed = "default:sand",
  813. depth_riverbed = 2,
  814. y_min = 2,
  815. y_max = upper_limit,
  816. heat_point = 25,
  817. humidity_point = 70,
  818. })
  819. minetest.register_biome({
  820. name = "taiga_ocean",
  821. --node_dust = "",
  822. node_top = "default:sand",
  823. depth_top = 1,
  824. node_filler = "default:sand",
  825. depth_filler = 3,
  826. --node_stone = "",
  827. --node_water_top = "",
  828. --depth_water_top = ,
  829. --node_water = "",
  830. --node_river_water = "",
  831. node_riverbed = "default:sand",
  832. depth_riverbed = 2,
  833. y_min = -112,
  834. y_max = 1,
  835. heat_point = 25,
  836. humidity_point = 70,
  837. })
  838. -- Snowy grassland
  839. minetest.register_biome({
  840. name = "snowy_grassland",
  841. node_dust = "default:snow",
  842. node_top = "default:dirt_with_snow",
  843. depth_top = 1,
  844. node_filler = "default:dirt",
  845. depth_filler = 1,
  846. --node_stone = "",
  847. --node_water_top = "",
  848. --depth_water_top = ,
  849. --node_water = "",
  850. --node_river_water = "",
  851. node_riverbed = "default:sand",
  852. depth_riverbed = 2,
  853. y_min = 5,
  854. y_max = upper_limit,
  855. heat_point = 20,
  856. humidity_point = 35,
  857. })
  858. minetest.register_biome({
  859. name = "snowy_grassland_ocean",
  860. --node_dust = "",
  861. node_top = "default:sand",
  862. depth_top = 1,
  863. node_filler = "default:sand",
  864. depth_filler = 3,
  865. --node_stone = "",
  866. --node_water_top = "",
  867. --depth_water_top = ,
  868. --node_water = "",
  869. --node_river_water = "",
  870. node_riverbed = "default:sand",
  871. depth_riverbed = 2,
  872. y_min = -112,
  873. y_max = 4,
  874. heat_point = 20,
  875. humidity_point = 35,
  876. })
  877. -- Grassland
  878. minetest.register_biome({
  879. name = "grassland",
  880. --node_dust = "",
  881. node_top = "default:dirt_with_grass",
  882. depth_top = 1,
  883. node_filler = "default:dirt",
  884. depth_filler = 1,
  885. --node_stone = "",
  886. --node_water_top = "",
  887. --depth_water_top = ,
  888. --node_water = "",
  889. --node_river_water = "",
  890. node_riverbed = "default:sand",
  891. depth_riverbed = 2,
  892. y_min = 6,
  893. y_max = upper_limit,
  894. heat_point = 50,
  895. humidity_point = 35,
  896. })
  897. minetest.register_biome({
  898. name = "grassland_dunes",
  899. --node_dust = "",
  900. node_top = "default:sand",
  901. depth_top = 1,
  902. node_filler = "default:sand",
  903. depth_filler = 2,
  904. --node_stone = "",
  905. --node_water_top = "",
  906. --depth_water_top = ,
  907. --node_water = "",
  908. --node_river_water = "",
  909. node_riverbed = "default:sand",
  910. depth_riverbed = 2,
  911. y_min = 5,
  912. y_max = 5,
  913. heat_point = 50,
  914. humidity_point = 35,
  915. })
  916. minetest.register_biome({
  917. name = "grassland_ocean",
  918. --node_dust = "",
  919. node_top = "default:sand",
  920. depth_top = 1,
  921. node_filler = "default:sand",
  922. depth_filler = 3,
  923. --node_stone = "",
  924. --node_water_top = "",
  925. --depth_water_top = ,
  926. --node_water = "",
  927. --node_river_water = "",
  928. node_riverbed = "default:sand",
  929. depth_riverbed = 2,
  930. y_min = -112,
  931. y_max = 4,
  932. heat_point = 50,
  933. humidity_point = 35,
  934. })
  935. -- Coniferous forest
  936. minetest.register_biome({
  937. name = "coniferous_forest",
  938. --node_dust = "",
  939. node_top = "default:dirt_with_grass",
  940. depth_top = 1,
  941. node_filler = "default:dirt",
  942. depth_filler = 3,
  943. --node_stone = "",
  944. --node_water_top = "",
  945. --depth_water_top = ,
  946. --node_water = "",
  947. --node_river_water = "",
  948. node_riverbed = "default:sand",
  949. depth_riverbed = 2,
  950. y_min = 6,
  951. y_max = upper_limit,
  952. heat_point = 45,
  953. humidity_point = 70,
  954. })
  955. minetest.register_biome({
  956. name = "coniferous_forest_dunes",
  957. --node_dust = "",
  958. node_top = "default:sand",
  959. depth_top = 1,
  960. node_filler = "default:sand",
  961. depth_filler = 3,
  962. --node_stone = "",
  963. --node_water_top = "",
  964. --depth_water_top = ,
  965. --node_water = "",
  966. --node_river_water = "",
  967. node_riverbed = "default:sand",
  968. depth_riverbed = 2,
  969. y_min = 5,
  970. y_max = 5,
  971. heat_point = 45,
  972. humidity_point = 70,
  973. })
  974. minetest.register_biome({
  975. name = "coniferous_forest_ocean",
  976. --node_dust = "",
  977. node_top = "default:sand",
  978. depth_top = 1,
  979. node_filler = "default:sand",
  980. depth_filler = 3,
  981. --node_stone = "",
  982. --node_water_top = "",
  983. --depth_water_top = ,
  984. --node_water = "",
  985. --node_river_water = "",
  986. node_riverbed = "default:sand",
  987. depth_riverbed = 2,
  988. y_min = -112,
  989. y_max = 4,
  990. heat_point = 45,
  991. humidity_point = 70,
  992. })
  993. -- Deciduous forest
  994. minetest.register_biome({
  995. name = "deciduous_forest",
  996. --node_dust = "",
  997. node_top = "default:dirt_with_grass",
  998. depth_top = 1,
  999. node_filler = "default:dirt",
  1000. depth_filler = 3,
  1001. --node_stone = "",
  1002. --node_water_top = "",
  1003. --depth_water_top = ,
  1004. --node_water = "",
  1005. --node_river_water = "",
  1006. node_riverbed = "default:sand",
  1007. depth_riverbed = 2,
  1008. y_min = 1,
  1009. y_max = upper_limit,
  1010. heat_point = 60,
  1011. humidity_point = 68,
  1012. })
  1013. minetest.register_biome({
  1014. name = "deciduous_forest_shore",
  1015. --node_dust = "",
  1016. node_top = "default:dirt",
  1017. depth_top = 1,
  1018. node_filler = "default:dirt",
  1019. depth_filler = 3,
  1020. --node_stone = "",
  1021. --node_water_top = "",
  1022. --depth_water_top = ,
  1023. --node_water = "",
  1024. --node_river_water = "",
  1025. node_riverbed = "default:sand",
  1026. depth_riverbed = 2,
  1027. y_min = -1,
  1028. y_max = 0,
  1029. heat_point = 60,
  1030. humidity_point = 68,
  1031. })
  1032. minetest.register_biome({
  1033. name = "deciduous_forest_ocean",
  1034. --node_dust = "",
  1035. node_top = "default:sand",
  1036. depth_top = 1,
  1037. node_filler = "default:sand",
  1038. depth_filler = 3,
  1039. --node_stone = "",
  1040. --node_water_top = "",
  1041. --depth_water_top = ,
  1042. --node_water = "",
  1043. --node_river_water = "",
  1044. node_riverbed = "default:sand",
  1045. depth_riverbed = 2,
  1046. y_min = -112,
  1047. y_max = -2,
  1048. heat_point = 60,
  1049. humidity_point = 68,
  1050. })
  1051. -- Desert
  1052. minetest.register_biome({
  1053. name = "desert",
  1054. --node_dust = "",
  1055. node_top = "default:desert_sand",
  1056. depth_top = 1,
  1057. node_filler = "default:desert_sand",
  1058. depth_filler = 1,
  1059. node_stone = "default:desert_stone",
  1060. --node_water_top = "",
  1061. --depth_water_top = ,
  1062. --node_water = "",
  1063. --node_river_water = "",
  1064. node_riverbed = "default:sand",
  1065. depth_riverbed = 2,
  1066. y_min = 5,
  1067. y_max = upper_limit,
  1068. heat_point = 92,
  1069. humidity_point = 16,
  1070. })
  1071. minetest.register_biome({
  1072. name = "desert_ocean",
  1073. --node_dust = "",
  1074. node_top = "default:sand",
  1075. depth_top = 1,
  1076. node_filler = "default:sand",
  1077. depth_filler = 3,
  1078. node_stone = "default:desert_stone",
  1079. --node_water_top = "",
  1080. --depth_water_top = ,
  1081. --node_water = "",
  1082. --node_river_water = "",
  1083. node_riverbed = "default:sand",
  1084. depth_riverbed = 2,
  1085. y_min = -112,
  1086. y_max = 4,
  1087. heat_point = 92,
  1088. humidity_point = 16,
  1089. })
  1090. -- Sandstone desert
  1091. minetest.register_biome({
  1092. name = "sandstone_desert",
  1093. --node_dust = "",
  1094. node_top = "default:sand",
  1095. depth_top = 1,
  1096. node_filler = "default:sand",
  1097. depth_filler = 1,
  1098. node_stone = "default:sandstone",
  1099. --node_water_top = "",
  1100. --depth_water_top = ,
  1101. --node_water = "",
  1102. --node_river_water = "",
  1103. node_riverbed = "default:sand",
  1104. depth_riverbed = 2,
  1105. y_min = 5,
  1106. y_max = upper_limit,
  1107. heat_point = 60,
  1108. humidity_point = 0,
  1109. })
  1110. minetest.register_biome({
  1111. name = "sandstone_desert_ocean",
  1112. --node_dust = "",
  1113. node_top = "default:sand",
  1114. depth_top = 1,
  1115. node_filler = "default:sand",
  1116. depth_filler = 3,
  1117. node_stone = "default:sandstone",
  1118. --node_water_top = "",
  1119. --depth_water_top = ,
  1120. --node_water = "",
  1121. --node_river_water = "",
  1122. node_riverbed = "default:sand",
  1123. depth_riverbed = 2,
  1124. y_min = -112,
  1125. y_max = 4,
  1126. heat_point = 60,
  1127. humidity_point = 0,
  1128. })
  1129. -- Cold desert
  1130. minetest.register_biome({
  1131. name = "cold_desert",
  1132. --node_dust = "",
  1133. node_top = "default:silver_sand",
  1134. depth_top = 1,
  1135. node_filler = "default:silver_sand",
  1136. depth_filler = 1,
  1137. --node_stone = "",
  1138. --node_water_top = "",
  1139. --depth_water_top = ,
  1140. --node_water = "",
  1141. --node_river_water = "",
  1142. node_riverbed = "default:sand",
  1143. depth_riverbed = 2,
  1144. y_min = 5,
  1145. y_max = upper_limit,
  1146. heat_point = 40,
  1147. humidity_point = 0,
  1148. })
  1149. minetest.register_biome({
  1150. name = "cold_desert_ocean",
  1151. --node_dust = "",
  1152. node_top = "default:sand",
  1153. depth_top = 1,
  1154. node_filler = "default:sand",
  1155. depth_filler = 3,
  1156. --node_stone = "",
  1157. --node_water_top = "",
  1158. --depth_water_top = ,
  1159. --node_water = "",
  1160. --node_river_water = "",
  1161. node_riverbed = "default:sand",
  1162. depth_riverbed = 2,
  1163. y_min = -112,
  1164. y_max = 4,
  1165. heat_point = 40,
  1166. humidity_point = 0,
  1167. })
  1168. -- Savanna
  1169. minetest.register_biome({
  1170. name = "savanna",
  1171. --node_dust = "",
  1172. node_top = "default:dirt_with_dry_grass",
  1173. depth_top = 1,
  1174. node_filler = "default:dirt",
  1175. depth_filler = 1,
  1176. --node_stone = "",
  1177. --node_water_top = "",
  1178. --depth_water_top = ,
  1179. --node_water = "",
  1180. --node_river_water = "",
  1181. node_riverbed = "default:sand",
  1182. depth_riverbed = 2,
  1183. y_min = 1,
  1184. y_max = upper_limit,
  1185. heat_point = 89,
  1186. humidity_point = 42,
  1187. })
  1188. minetest.register_biome({
  1189. name = "savanna_shore",
  1190. --node_dust = "",
  1191. node_top = "default:dirt",
  1192. depth_top = 1,
  1193. node_filler = "default:dirt",
  1194. depth_filler = 3,
  1195. --node_stone = "",
  1196. --node_water_top = "",
  1197. --depth_water_top = ,
  1198. --node_water = "",
  1199. --node_river_water = "",
  1200. node_riverbed = "default:sand",
  1201. depth_riverbed = 2,
  1202. y_min = -1,
  1203. y_max = 0,
  1204. heat_point = 89,
  1205. humidity_point = 42,
  1206. })
  1207. minetest.register_biome({
  1208. name = "savanna_ocean",
  1209. --node_dust = "",
  1210. node_top = "default:sand",
  1211. depth_top = 1,
  1212. node_filler = "default:sand",
  1213. depth_filler = 3,
  1214. --node_stone = "",
  1215. --node_water_top = "",
  1216. --depth_water_top = ,
  1217. --node_water = "",
  1218. --node_river_water = "",
  1219. node_riverbed = "default:sand",
  1220. depth_riverbed = 2,
  1221. y_min = -112,
  1222. y_max = -2,
  1223. heat_point = 89,
  1224. humidity_point = 42,
  1225. })
  1226. -- Rainforest
  1227. minetest.register_biome({
  1228. name = "rainforest",
  1229. --node_dust = "",
  1230. node_top = "default:dirt_with_rainforest_litter",
  1231. depth_top = 1,
  1232. node_filler = "default:dirt",
  1233. depth_filler = 3,
  1234. --node_stone = "",
  1235. --node_water_top = "",
  1236. --depth_water_top = ,
  1237. --node_water = "",
  1238. --node_river_water = "",
  1239. node_riverbed = "default:sand",
  1240. depth_riverbed = 2,
  1241. y_min = 1,
  1242. y_max = upper_limit,
  1243. heat_point = 86,
  1244. humidity_point = 65,
  1245. })
  1246. minetest.register_biome({
  1247. name = "rainforest_swamp",
  1248. --node_dust = "",
  1249. node_top = "default:dirt",
  1250. depth_top = 1,
  1251. node_filler = "default:dirt",
  1252. depth_filler = 3,
  1253. --node_stone = "",
  1254. --node_water_top = "",
  1255. --depth_water_top = ,
  1256. --node_water = "",
  1257. --node_river_water = "",
  1258. node_riverbed = "default:sand",
  1259. depth_riverbed = 2,
  1260. y_min = -1,
  1261. y_max = 0,
  1262. heat_point = 86,
  1263. humidity_point = 65,
  1264. })
  1265. minetest.register_biome({
  1266. name = "rainforest_ocean",
  1267. --node_dust = "",
  1268. node_top = "default:sand",
  1269. depth_top = 1,
  1270. node_filler = "default:sand",
  1271. depth_filler = 3,
  1272. --node_stone = "",
  1273. --node_water_top = "",
  1274. --depth_water_top = ,
  1275. --node_water = "",
  1276. --node_river_water = "",
  1277. node_riverbed = "default:sand",
  1278. depth_riverbed = 2,
  1279. y_min = -112,
  1280. y_max = -2,
  1281. heat_point = 86,
  1282. humidity_point = 65,
  1283. })
  1284. -- Underground
  1285. minetest.register_biome({
  1286. name = "underground",
  1287. --node_dust = "",
  1288. --node_top = "",
  1289. --depth_top = ,
  1290. --node_filler = "",
  1291. --depth_filler = ,
  1292. --node_stone = "",
  1293. --node_water_top = "",
  1294. --depth_water_top = ,
  1295. --node_water = "",
  1296. --node_river_water = "",
  1297. y_min = -31000,
  1298. y_max = -113,
  1299. heat_point = 50,
  1300. humidity_point = 50,
  1301. })
  1302. end
  1303. -- Biomes for floatlands
  1304. -- Used when mgv7 'biomerepeat' flag is false
  1305. -- TODO Temporary simple biomes to be replaced by special floatland biomes later.
  1306. function default.register_floatland_biomes(floatland_level, shadow_limit)
  1307. minetest.register_biome({
  1308. name = "floatland_grassland",
  1309. --node_dust = "",
  1310. node_top = "default:dirt_with_grass",
  1311. depth_top = 1,
  1312. node_filler = "default:dirt",
  1313. depth_filler = 1,
  1314. --node_stone = "",
  1315. --node_water_top = "",
  1316. --depth_water_top = ,
  1317. --node_water = "",
  1318. --node_river_water = "",
  1319. --node_riverbed = "",
  1320. --depth_riverbed = ,
  1321. y_min = floatland_level + 4,
  1322. y_max = 31000,
  1323. heat_point = 50,
  1324. humidity_point = 50,
  1325. })
  1326. minetest.register_biome({
  1327. name = "floatland_grassland_ocean",
  1328. --node_dust = "",
  1329. node_top = "default:sand",
  1330. depth_top = 1,
  1331. node_filler = "default:sand",
  1332. depth_filler = 3,
  1333. --node_stone = "",
  1334. --node_water_top = "",
  1335. --depth_water_top = ,
  1336. --node_water = "",
  1337. --node_river_water = "",
  1338. --node_riverbed = "",
  1339. --depth_riverbed = ,
  1340. y_min = shadow_limit,
  1341. y_max = floatland_level + 3,
  1342. heat_point = 50,
  1343. humidity_point = 50,
  1344. })
  1345. end
  1346. --
  1347. -- Register decorations
  1348. --
  1349. -- Mgv6
  1350. function default.register_mgv6_decorations()
  1351. -- Papyrus
  1352. minetest.register_decoration({
  1353. deco_type = "simple",
  1354. place_on = {"default:dirt_with_grass"},
  1355. sidelen = 16,
  1356. noise_params = {
  1357. offset = -0.3,
  1358. scale = 0.7,
  1359. spread = {x = 100, y = 100, z = 100},
  1360. seed = 354,
  1361. octaves = 3,
  1362. persist = 0.7
  1363. },
  1364. y_min = 1,
  1365. y_max = 1,
  1366. decoration = "default:papyrus",
  1367. height = 2,
  1368. height_max = 4,
  1369. spawn_by = "default:water_source",
  1370. num_spawn_by = 1,
  1371. })
  1372. -- Cacti
  1373. minetest.register_decoration({
  1374. deco_type = "simple",
  1375. place_on = {"default:desert_sand"},
  1376. sidelen = 16,
  1377. noise_params = {
  1378. offset = -0.012,
  1379. scale = 0.024,
  1380. spread = {x = 100, y = 100, z = 100},
  1381. seed = 230,
  1382. octaves = 3,
  1383. persist = 0.6
  1384. },
  1385. y_min = 1,
  1386. y_max = 30,
  1387. decoration = "default:cactus",
  1388. height = 3,
  1389. height_max = 4,
  1390. })
  1391. -- Long grasses
  1392. for length = 1, 5 do
  1393. minetest.register_decoration({
  1394. deco_type = "simple",
  1395. place_on = {"default:dirt_with_grass"},
  1396. sidelen = 16,
  1397. noise_params = {
  1398. offset = 0,
  1399. scale = 0.007,
  1400. spread = {x = 100, y = 100, z = 100},
  1401. seed = 329,
  1402. octaves = 3,
  1403. persist = 0.6
  1404. },
  1405. y_min = 1,
  1406. y_max = 30,
  1407. decoration = "default:grass_"..length,
  1408. })
  1409. end
  1410. -- Dry shrubs
  1411. minetest.register_decoration({
  1412. deco_type = "simple",
  1413. place_on = {"default:desert_sand", "default:dirt_with_snow"},
  1414. sidelen = 16,
  1415. noise_params = {
  1416. offset = 0,
  1417. scale = 0.035,
  1418. spread = {x = 100, y = 100, z = 100},
  1419. seed = 329,
  1420. octaves = 3,
  1421. persist = 0.6
  1422. },
  1423. y_min = 1,
  1424. y_max = 30,
  1425. decoration = "default:dry_shrub",
  1426. })
  1427. end
  1428. -- All mapgens except mgv6
  1429. local function register_grass_decoration(offset, scale, length)
  1430. minetest.register_decoration({
  1431. deco_type = "simple",
  1432. place_on = {"default:dirt_with_grass", "default:sand"},
  1433. sidelen = 16,
  1434. noise_params = {
  1435. offset = offset,
  1436. scale = scale,
  1437. spread = {x = 200, y = 200, z = 200},
  1438. seed = 329,
  1439. octaves = 3,
  1440. persist = 0.6
  1441. },
  1442. biomes = {"grassland", "grassland_dunes", "deciduous_forest",
  1443. "coniferous_forest", "coniferous_forest_dunes",
  1444. "floatland_grassland"},
  1445. y_min = 1,
  1446. y_max = 31000,
  1447. decoration = "default:grass_" .. length,
  1448. })
  1449. end
  1450. local function register_dry_grass_decoration(offset, scale, length)
  1451. minetest.register_decoration({
  1452. deco_type = "simple",
  1453. place_on = {"default:dirt_with_dry_grass"},
  1454. sidelen = 16,
  1455. noise_params = {
  1456. offset = offset,
  1457. scale = scale,
  1458. spread = {x = 200, y = 200, z = 200},
  1459. seed = 329,
  1460. octaves = 3,
  1461. persist = 0.6
  1462. },
  1463. biomes = {"savanna"},
  1464. y_min = 1,
  1465. y_max = 31000,
  1466. decoration = "default:dry_grass_" .. length,
  1467. })
  1468. end
  1469. function default.register_decorations()
  1470. -- Apple tree and log
  1471. minetest.register_decoration({
  1472. deco_type = "schematic",
  1473. place_on = {"default:dirt_with_grass"},
  1474. sidelen = 16,
  1475. noise_params = {
  1476. offset = 0.036,
  1477. scale = 0.022,
  1478. spread = {x = 250, y = 250, z = 250},
  1479. seed = 2,
  1480. octaves = 3,
  1481. persist = 0.66
  1482. },
  1483. biomes = {"deciduous_forest"},
  1484. y_min = 1,
  1485. y_max = 31000,
  1486. schematic = minetest.get_modpath("default") .. "/schematics/apple_tree.mts",
  1487. flags = "place_center_x, place_center_z",
  1488. rotation = "random",
  1489. })
  1490. minetest.register_decoration({
  1491. deco_type = "schematic",
  1492. place_on = {"default:dirt_with_grass"},
  1493. sidelen = 16,
  1494. noise_params = {
  1495. offset = 0.0018,
  1496. scale = 0.0011,
  1497. spread = {x = 250, y = 250, z = 250},
  1498. seed = 2,
  1499. octaves = 3,
  1500. persist = 0.66
  1501. },
  1502. biomes = {"deciduous_forest"},
  1503. y_min = 1,
  1504. y_max = 31000,
  1505. schematic = minetest.get_modpath("default") .. "/schematics/apple_log.mts",
  1506. flags = "place_center_x",
  1507. rotation = "random",
  1508. })
  1509. -- Jungle tree and log
  1510. minetest.register_decoration({
  1511. deco_type = "schematic",
  1512. place_on = {"default:dirt_with_rainforest_litter", "default:dirt"},
  1513. sidelen = 16,
  1514. fill_ratio = 0.1,
  1515. biomes = {"rainforest", "rainforest_swamp"},
  1516. y_min = -1,
  1517. y_max = 31000,
  1518. schematic = minetest.get_modpath("default") .. "/schematics/jungle_tree.mts",
  1519. flags = "place_center_x, place_center_z",
  1520. rotation = "random",
  1521. })
  1522. minetest.register_decoration({
  1523. deco_type = "schematic",
  1524. place_on = {"default:dirt_with_rainforest_litter", "default:dirt"},
  1525. sidelen = 16,
  1526. fill_ratio = 0.005,
  1527. biomes = {"rainforest", "rainforest_swamp"},
  1528. y_min = 1,
  1529. y_max = 31000,
  1530. schematic = minetest.get_modpath("default") .. "/schematics/jungle_log.mts",
  1531. flags = "place_center_x",
  1532. rotation = "random",
  1533. })
  1534. -- Taiga and temperate coniferous forest pine tree and log
  1535. minetest.register_decoration({
  1536. deco_type = "schematic",
  1537. place_on = {"default:dirt_with_snow", "default:dirt_with_grass"},
  1538. sidelen = 16,
  1539. noise_params = {
  1540. offset = 0.036,
  1541. scale = 0.022,
  1542. spread = {x = 250, y = 250, z = 250},
  1543. seed = 2,
  1544. octaves = 3,
  1545. persist = 0.66
  1546. },
  1547. biomes = {"taiga", "coniferous_forest"},
  1548. y_min = 2,
  1549. y_max = 31000,
  1550. schematic = minetest.get_modpath("default") .. "/schematics/pine_tree.mts",
  1551. flags = "place_center_x, place_center_z",
  1552. })
  1553. minetest.register_decoration({
  1554. deco_type = "schematic",
  1555. place_on = {"default:dirt_with_snow", "default:dirt_with_grass"},
  1556. sidelen = 80,
  1557. noise_params = {
  1558. offset = 0.0018,
  1559. scale = 0.0011,
  1560. spread = {x = 250, y = 250, z = 250},
  1561. seed = 2,
  1562. octaves = 3,
  1563. persist = 0.66
  1564. },
  1565. biomes = {"taiga", "coniferous_forest"},
  1566. y_min = 1,
  1567. y_max = 31000,
  1568. schematic = minetest.get_modpath("default") .. "/schematics/pine_log.mts",
  1569. flags = "place_center_x",
  1570. rotation = "random",
  1571. })
  1572. -- Acacia tree and log
  1573. minetest.register_decoration({
  1574. deco_type = "schematic",
  1575. place_on = {"default:dirt_with_dry_grass"},
  1576. sidelen = 16,
  1577. noise_params = {
  1578. offset = 0,
  1579. scale = 0.002,
  1580. spread = {x = 250, y = 250, z = 250},
  1581. seed = 2,
  1582. octaves = 3,
  1583. persist = 0.66
  1584. },
  1585. biomes = {"savanna"},
  1586. y_min = 1,
  1587. y_max = 31000,
  1588. schematic = minetest.get_modpath("default") .. "/schematics/acacia_tree.mts",
  1589. flags = "place_center_x, place_center_z",
  1590. rotation = "random",
  1591. })
  1592. minetest.register_decoration({
  1593. deco_type = "schematic",
  1594. place_on = {"default:dirt_with_dry_grass"},
  1595. sidelen = 16,
  1596. noise_params = {
  1597. offset = 0,
  1598. scale = 0.001,
  1599. spread = {x = 250, y = 250, z = 250},
  1600. seed = 2,
  1601. octaves = 3,
  1602. persist = 0.66
  1603. },
  1604. biomes = {"savanna"},
  1605. y_min = 1,
  1606. y_max = 31000,
  1607. schematic = minetest.get_modpath("default") .. "/schematics/acacia_log.mts",
  1608. flags = "place_center_x",
  1609. rotation = "random",
  1610. })
  1611. -- Aspen tree and log
  1612. minetest.register_decoration({
  1613. deco_type = "schematic",
  1614. place_on = {"default:dirt_with_grass"},
  1615. sidelen = 16,
  1616. noise_params = {
  1617. offset = 0.0,
  1618. scale = -0.015,
  1619. spread = {x = 250, y = 250, z = 250},
  1620. seed = 2,
  1621. octaves = 3,
  1622. persist = 0.66
  1623. },
  1624. biomes = {"deciduous_forest"},
  1625. y_min = 1,
  1626. y_max = 31000,
  1627. schematic = minetest.get_modpath("default") .. "/schematics/aspen_tree.mts",
  1628. flags = "place_center_x, place_center_z",
  1629. })
  1630. minetest.register_decoration({
  1631. deco_type = "schematic",
  1632. place_on = {"default:dirt_with_grass"},
  1633. sidelen = 16,
  1634. noise_params = {
  1635. offset = 0.0,
  1636. scale = -0.0008,
  1637. spread = {x = 250, y = 250, z = 250},
  1638. seed = 2,
  1639. octaves = 3,
  1640. persist = 0.66
  1641. },
  1642. biomes = {"deciduous_forest"},
  1643. y_min = 1,
  1644. y_max = 31000,
  1645. schematic = minetest.get_modpath("default") .. "/schematics/aspen_log.mts",
  1646. flags = "place_center_x",
  1647. rotation = "random",
  1648. })
  1649. -- Large cactus
  1650. minetest.register_decoration({
  1651. deco_type = "schematic",
  1652. place_on = {"default:desert_sand"},
  1653. sidelen = 16,
  1654. noise_params = {
  1655. offset = -0.0003,
  1656. scale = 0.0009,
  1657. spread = {x = 200, y = 200, z = 200},
  1658. seed = 230,
  1659. octaves = 3,
  1660. persist = 0.6
  1661. },
  1662. biomes = {"desert"},
  1663. y_min = 5,
  1664. y_max = 31000,
  1665. schematic = minetest.get_modpath("default") .. "/schematics/large_cactus.mts",
  1666. flags = "place_center_x",
  1667. rotation = "random",
  1668. })
  1669. -- Cactus
  1670. minetest.register_decoration({
  1671. deco_type = "simple",
  1672. place_on = {"default:desert_sand"},
  1673. sidelen = 16,
  1674. noise_params = {
  1675. offset = -0.0003,
  1676. scale = 0.0009,
  1677. spread = {x = 200, y = 200, z = 200},
  1678. seed = 230,
  1679. octaves = 3,
  1680. persist = 0.6
  1681. },
  1682. biomes = {"desert"},
  1683. y_min = 5,
  1684. y_max = 31000,
  1685. decoration = "default:cactus",
  1686. height = 2,
  1687. height_max = 5,
  1688. })
  1689. -- Papyrus
  1690. minetest.register_decoration({
  1691. deco_type = "schematic",
  1692. place_on = {"default:dirt"},
  1693. sidelen = 16,
  1694. noise_params = {
  1695. offset = -0.3,
  1696. scale = 0.7,
  1697. spread = {x = 200, y = 200, z = 200},
  1698. seed = 354,
  1699. octaves = 3,
  1700. persist = 0.7
  1701. },
  1702. biomes = {"savanna_shore"},
  1703. y_min = 0,
  1704. y_max = 0,
  1705. schematic = minetest.get_modpath("default") .. "/schematics/papyrus.mts",
  1706. })
  1707. -- Bush
  1708. minetest.register_decoration({
  1709. deco_type = "schematic",
  1710. place_on = {"default:dirt_with_grass", "default:dirt_with_snow"},
  1711. sidelen = 16,
  1712. noise_params = {
  1713. offset = -0.004,
  1714. scale = 0.01,
  1715. spread = {x = 100, y = 100, z = 100},
  1716. seed = 137,
  1717. octaves = 3,
  1718. persist = 0.7,
  1719. },
  1720. biomes = {"snowy_grassland", "grassland", "deciduous_forest",
  1721. "floatland_grassland"},
  1722. y_min = 1,
  1723. y_max = 31000,
  1724. schematic = minetest.get_modpath("default") .. "/schematics/bush.mts",
  1725. flags = "place_center_x, place_center_z",
  1726. })
  1727. -- Acacia bush
  1728. minetest.register_decoration({
  1729. deco_type = "schematic",
  1730. place_on = {"default:dirt_with_dry_grass"},
  1731. sidelen = 16,
  1732. noise_params = {
  1733. offset = -0.004,
  1734. scale = 0.01,
  1735. spread = {x = 100, y = 100, z = 100},
  1736. seed = 90155,
  1737. octaves = 3,
  1738. persist = 0.7,
  1739. },
  1740. biomes = {"savanna"},
  1741. y_min = 1,
  1742. y_max = 31000,
  1743. schematic = minetest.get_modpath("default") .. "/schematics/acacia_bush.mts",
  1744. flags = "place_center_x, place_center_z",
  1745. })
  1746. -- Grasses
  1747. register_grass_decoration(-0.03, 0.09, 5)
  1748. register_grass_decoration(-0.015, 0.075, 4)
  1749. register_grass_decoration(0, 0.06, 3)
  1750. register_grass_decoration(0.015, 0.045, 2)
  1751. register_grass_decoration(0.03, 0.03, 1)
  1752. -- Dry grasses
  1753. register_dry_grass_decoration(0.01, 0.05, 5)
  1754. register_dry_grass_decoration(0.03, 0.03, 4)
  1755. register_dry_grass_decoration(0.05, 0.01, 3)
  1756. register_dry_grass_decoration(0.07, -0.01, 2)
  1757. register_dry_grass_decoration(0.09, -0.03, 1)
  1758. -- Junglegrass
  1759. minetest.register_decoration({
  1760. deco_type = "simple",
  1761. place_on = {"default:dirt_with_rainforest_litter"},
  1762. sidelen = 16,
  1763. fill_ratio = 0.1,
  1764. biomes = {"rainforest"},
  1765. y_min = 1,
  1766. y_max = 31000,
  1767. decoration = "default:junglegrass",
  1768. })
  1769. -- Dry shrub
  1770. minetest.register_decoration({
  1771. deco_type = "simple",
  1772. place_on = {"default:desert_sand",
  1773. "default:sand", "default:silver_sand"},
  1774. sidelen = 16,
  1775. noise_params = {
  1776. offset = 0,
  1777. scale = 0.02,
  1778. spread = {x = 200, y = 200, z = 200},
  1779. seed = 329,
  1780. octaves = 3,
  1781. persist = 0.6
  1782. },
  1783. biomes = {"desert", "sandstone_desert", "cold_desert"},
  1784. y_min = 2,
  1785. y_max = 31000,
  1786. decoration = "default:dry_shrub",
  1787. })
  1788. -- Coral reef
  1789. minetest.register_decoration({
  1790. deco_type = "schematic",
  1791. place_on = {"default:sand"},
  1792. noise_params = {
  1793. offset = -0.15,
  1794. scale = 0.1,
  1795. spread = {x = 100, y = 100, z = 100},
  1796. seed = 7013,
  1797. octaves = 3,
  1798. persist = 1,
  1799. },
  1800. biomes = {
  1801. "desert_ocean",
  1802. "savanna_ocean",
  1803. "rainforest_ocean",
  1804. },
  1805. y_min = -8,
  1806. y_max = -2,
  1807. schematic = minetest.get_modpath("default") .. "/schematics/corals.mts",
  1808. flags = "place_center_x, place_center_z",
  1809. rotation = "random",
  1810. })
  1811. end
  1812. --
  1813. -- Detect mapgen, flags and parameters to select functions
  1814. --
  1815. -- Get setting or default
  1816. local mgv7_spflags = minetest.get_mapgen_setting("mgv7_spflags") or
  1817. "mountains, ridges, nofloatlands, caverns, biomerepeat"
  1818. local captures_float = string.match(mgv7_spflags, "floatlands")
  1819. local captures_nofloat = string.match(mgv7_spflags, "nofloatlands")
  1820. local captures_nobiorep = string.match(mgv7_spflags, "nobiomerepeat")
  1821. -- Get setting or default
  1822. -- Make global for mods to use to register floatland biomes
  1823. default.mgv7_floatland_level =
  1824. minetest.get_mapgen_setting("mgv7_floatland_level") or 1280
  1825. default.mgv7_shadow_limit =
  1826. minetest.get_mapgen_setting("mgv7_shadow_limit") or 1024
  1827. minetest.clear_registered_biomes()
  1828. minetest.clear_registered_ores()
  1829. minetest.clear_registered_decorations()
  1830. local mg_name = minetest.get_mapgen_setting("mg_name")
  1831. if mg_name == "v6" then
  1832. default.register_mgv6_ores()
  1833. default.register_mgv6_decorations()
  1834. elseif mg_name == "v7" and
  1835. captures_float == "floatlands" and
  1836. -- Need to check for 'nofloatlands' because that contains
  1837. -- 'floatlands' which makes the second condition true.
  1838. captures_nofloat ~= "nofloatlands" and
  1839. captures_nobiorep == "nobiomerepeat" then
  1840. -- Mgv7 with floatlands and floatland biomes
  1841. default.register_biomes(default.mgv7_shadow_limit - 1)
  1842. default.register_floatland_biomes(
  1843. default.mgv7_floatland_level, default.mgv7_shadow_limit)
  1844. default.register_ores()
  1845. default.register_decorations()
  1846. else
  1847. default.register_biomes(31000)
  1848. default.register_ores()
  1849. default.register_decorations()
  1850. end