mapgen.lua 51 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273
  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_max = 0,
  51. y_min = -15,
  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_max = 0,
  70. y_min = -31,
  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_max = 31000,
  89. y_min = -31,
  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_max = 31000,
  108. y_min = -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_max = 31000,
  129. y_min = 1025,
  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_max = 64,
  139. y_min = -31000,
  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_max = 0,
  149. y_min = -31000,
  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_max = 31000,
  160. y_min = 1025,
  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_max = 0,
  170. y_min = -31000,
  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_max = -64,
  180. y_min = -31000,
  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_max = 31000,
  191. y_min = 1025,
  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_max = -16,
  201. y_min = -63,
  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_max = -64,
  211. y_min = -31000,
  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_max = 31000,
  222. y_min = 1025,
  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_max = -32,
  232. y_min = -127,
  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_max = -128,
  242. y_min = -31000,
  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_max = 31000,
  253. y_min = 1025,
  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_max = -64,
  263. y_min = -255,
  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_max = -256,
  273. y_min = -31000,
  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_max = 31000,
  284. y_min = 1025,
  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_max = -64,
  294. y_min = -255,
  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_max = -256,
  304. y_min = -31000,
  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_max = 31000,
  315. y_min = 1025,
  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_max = -128,
  325. y_min = -255,
  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_max = -256,
  335. y_min = -31000,
  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_max = 31000,
  346. y_min = 1025,
  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_max = -1024,
  356. y_min = -31000,
  357. })
  358. end
  359. -- All mapgens except mgv6
  360. function default.register_ores()
  361. -- Stratum ores.
  362. -- These obviously first.
  363. -- Silver sandstone
  364. minetest.register_ore({
  365. ore_type = "stratum",
  366. ore = "default:silver_sandstone",
  367. wherein = {"default:stone"},
  368. clust_scarcity = 1,
  369. y_max = 46,
  370. y_min = 10,
  371. noise_params = {
  372. offset = 28,
  373. scale = 16,
  374. spread = {x = 128, y = 128, z = 128},
  375. seed = 90122,
  376. octaves = 1,
  377. },
  378. stratum_thickness = 4,
  379. biomes = {"cold_desert"},
  380. })
  381. minetest.register_ore({
  382. ore_type = "stratum",
  383. ore = "default:silver_sandstone",
  384. wherein = {"default:stone"},
  385. clust_scarcity = 1,
  386. y_max = 42,
  387. y_min = 6,
  388. noise_params = {
  389. offset = 24,
  390. scale = 16,
  391. spread = {x = 128, y = 128, z = 128},
  392. seed = 90122,
  393. octaves = 1,
  394. },
  395. stratum_thickness = 2,
  396. biomes = {"cold_desert"},
  397. })
  398. -- Desert sandstone
  399. minetest.register_ore({
  400. ore_type = "stratum",
  401. ore = "default:desert_sandstone",
  402. wherein = {"default:desert_stone"},
  403. clust_scarcity = 1,
  404. y_max = 46,
  405. y_min = 10,
  406. noise_params = {
  407. offset = 28,
  408. scale = 16,
  409. spread = {x = 128, y = 128, z = 128},
  410. seed = 90122,
  411. octaves = 1,
  412. },
  413. stratum_thickness = 4,
  414. biomes = {"desert"},
  415. })
  416. minetest.register_ore({
  417. ore_type = "stratum",
  418. ore = "default:desert_sandstone",
  419. wherein = {"default:desert_stone"},
  420. clust_scarcity = 1,
  421. y_max = 42,
  422. y_min = 6,
  423. noise_params = {
  424. offset = 24,
  425. scale = 16,
  426. spread = {x = 128, y = 128, z = 128},
  427. seed = 90122,
  428. octaves = 1,
  429. },
  430. stratum_thickness = 2,
  431. biomes = {"desert"},
  432. })
  433. -- Sandstone
  434. minetest.register_ore({
  435. ore_type = "stratum",
  436. ore = "default:sandstone",
  437. wherein = {"default:desert_stone"},
  438. clust_scarcity = 1,
  439. y_max = 39,
  440. y_min = 3,
  441. noise_params = {
  442. offset = 21,
  443. scale = 16,
  444. spread = {x = 128, y = 128, z = 128},
  445. seed = 90122,
  446. octaves = 1,
  447. },
  448. stratum_thickness = 2,
  449. biomes = {"desert"},
  450. })
  451. -- Blob ore.
  452. -- These before scatter ores to avoid other ores in blobs.
  453. -- Clay
  454. minetest.register_ore({
  455. ore_type = "blob",
  456. ore = "default:clay",
  457. wherein = {"default:sand"},
  458. clust_scarcity = 16 * 16 * 16,
  459. clust_size = 5,
  460. y_max = 0,
  461. y_min = -15,
  462. noise_threshold = 0.0,
  463. noise_params = {
  464. offset = 0.5,
  465. scale = 0.2,
  466. spread = {x = 5, y = 5, z = 5},
  467. seed = -316,
  468. octaves = 1,
  469. persist = 0.0
  470. },
  471. })
  472. -- Silver sand
  473. minetest.register_ore({
  474. ore_type = "blob",
  475. ore = "default:silver_sand",
  476. wherein = {"default:stone"},
  477. clust_scarcity = 16 * 16 * 16,
  478. clust_size = 5,
  479. y_max = 31000,
  480. y_min = -31000,
  481. noise_threshold = 0.0,
  482. noise_params = {
  483. offset = 0.5,
  484. scale = 0.2,
  485. spread = {x = 5, y = 5, z = 5},
  486. seed = 2316,
  487. octaves = 1,
  488. persist = 0.0
  489. },
  490. biomes = {"icesheet_ocean", "tundra", "tundra_beach", "tundra_ocean",
  491. "taiga", "taiga_ocean", "snowy_grassland", "snowy_grassland_ocean",
  492. "grassland", "grassland_dunes", "grassland_ocean", "coniferous_forest",
  493. "coniferous_forest_dunes", "coniferous_forest_ocean", "deciduous_forest",
  494. "deciduous_forest_shore", "deciduous_forest_ocean", "cold_desert",
  495. "cold_desert_ocean", "savanna", "savanna_shore", "savanna_ocean",
  496. "rainforest", "rainforest_swamp", "rainforest_ocean", "underground",
  497. "floatland_coniferous_forest", "floatland_coniferous_forest_ocean"}
  498. })
  499. -- Dirt
  500. minetest.register_ore({
  501. ore_type = "blob",
  502. ore = "default:dirt",
  503. wherein = {"default:stone"},
  504. clust_scarcity = 16 * 16 * 16,
  505. clust_size = 5,
  506. y_max = 31000,
  507. y_min = -31,
  508. noise_threshold = 0.0,
  509. noise_params = {
  510. offset = 0.5,
  511. scale = 0.2,
  512. spread = {x = 5, y = 5, z = 5},
  513. seed = 17676,
  514. octaves = 1,
  515. persist = 0.0
  516. },
  517. biomes = {"taiga", "snowy_grassland", "grassland", "coniferous_forest",
  518. "deciduous_forest", "deciduous_forest_shore", "savanna", "savanna_shore",
  519. "rainforest", "rainforest_swamp", "floatland_coniferous_forest"}
  520. })
  521. -- Gravel
  522. minetest.register_ore({
  523. ore_type = "blob",
  524. ore = "default:gravel",
  525. wherein = {"default:stone"},
  526. clust_scarcity = 16 * 16 * 16,
  527. clust_size = 5,
  528. y_max = 31000,
  529. y_min = -31000,
  530. noise_threshold = 0.0,
  531. noise_params = {
  532. offset = 0.5,
  533. scale = 0.2,
  534. spread = {x = 5, y = 5, z = 5},
  535. seed = 766,
  536. octaves = 1,
  537. persist = 0.0
  538. },
  539. biomes = {"icesheet_ocean", "tundra", "tundra_beach", "tundra_ocean",
  540. "taiga", "taiga_ocean", "snowy_grassland", "snowy_grassland_ocean",
  541. "grassland", "grassland_dunes", "grassland_ocean", "coniferous_forest",
  542. "coniferous_forest_dunes", "coniferous_forest_ocean", "deciduous_forest",
  543. "deciduous_forest_shore", "deciduous_forest_ocean", "cold_desert",
  544. "cold_desert_ocean", "savanna", "savanna_shore", "savanna_ocean",
  545. "rainforest", "rainforest_swamp", "rainforest_ocean", "underground",
  546. "floatland_coniferous_forest", "floatland_coniferous_forest_ocean"}
  547. })
  548. -- Scatter ores
  549. -- Coal
  550. minetest.register_ore({
  551. ore_type = "scatter",
  552. ore = "default:stone_with_coal",
  553. wherein = "default:stone",
  554. clust_scarcity = 8 * 8 * 8,
  555. clust_num_ores = 9,
  556. clust_size = 3,
  557. y_max = 31000,
  558. y_min = 1025,
  559. })
  560. minetest.register_ore({
  561. ore_type = "scatter",
  562. ore = "default:stone_with_coal",
  563. wherein = "default:stone",
  564. clust_scarcity = 8 * 8 * 8,
  565. clust_num_ores = 8,
  566. clust_size = 3,
  567. y_max = 64,
  568. y_min = -127,
  569. })
  570. minetest.register_ore({
  571. ore_type = "scatter",
  572. ore = "default:stone_with_coal",
  573. wherein = "default:stone",
  574. clust_scarcity = 12 * 12 * 12,
  575. clust_num_ores = 30,
  576. clust_size = 5,
  577. y_max = -128,
  578. y_min = -31000,
  579. })
  580. -- Tin
  581. minetest.register_ore({
  582. ore_type = "scatter",
  583. ore = "default:stone_with_tin",
  584. wherein = "default:stone",
  585. clust_scarcity = 10 * 10 * 10,
  586. clust_num_ores = 5,
  587. clust_size = 3,
  588. y_max = 31000,
  589. y_min = 1025,
  590. })
  591. minetest.register_ore({
  592. ore_type = "scatter",
  593. ore = "default:stone_with_tin",
  594. wherein = "default:stone",
  595. clust_scarcity = 13 * 13 * 13,
  596. clust_num_ores = 4,
  597. clust_size = 3,
  598. y_max = -64,
  599. y_min = -127,
  600. })
  601. minetest.register_ore({
  602. ore_type = "scatter",
  603. ore = "default:stone_with_tin",
  604. wherein = "default:stone",
  605. clust_scarcity = 10 * 10 * 10,
  606. clust_num_ores = 5,
  607. clust_size = 3,
  608. y_max = -128,
  609. y_min = -31000,
  610. })
  611. -- Copper
  612. minetest.register_ore({
  613. ore_type = "scatter",
  614. ore = "default:stone_with_copper",
  615. wherein = "default:stone",
  616. clust_scarcity = 9 * 9 * 9,
  617. clust_num_ores = 5,
  618. clust_size = 3,
  619. y_max = 31000,
  620. y_min = 1025,
  621. })
  622. minetest.register_ore({
  623. ore_type = "scatter",
  624. ore = "default:stone_with_copper",
  625. wherein = "default:stone",
  626. clust_scarcity = 12 * 12 * 12,
  627. clust_num_ores = 4,
  628. clust_size = 3,
  629. y_max = -64,
  630. y_min = -127,
  631. })
  632. minetest.register_ore({
  633. ore_type = "scatter",
  634. ore = "default:stone_with_copper",
  635. wherein = "default:stone",
  636. clust_scarcity = 9 * 9 * 9,
  637. clust_num_ores = 5,
  638. clust_size = 3,
  639. y_max = -128,
  640. y_min = -31000,
  641. })
  642. -- Iron
  643. minetest.register_ore({
  644. ore_type = "scatter",
  645. ore = "default:stone_with_iron",
  646. wherein = "default:stone",
  647. clust_scarcity = 9 * 9 * 9,
  648. clust_num_ores = 12,
  649. clust_size = 3,
  650. y_max = 31000,
  651. y_min = 1025,
  652. })
  653. minetest.register_ore({
  654. ore_type = "scatter",
  655. ore = "default:stone_with_iron",
  656. wherein = "default:stone",
  657. clust_scarcity = 7 * 7 * 7,
  658. clust_num_ores = 5,
  659. clust_size = 3,
  660. y_max = -128,
  661. y_min = -255,
  662. })
  663. minetest.register_ore({
  664. ore_type = "scatter",
  665. ore = "default:stone_with_iron",
  666. wherein = "default:stone",
  667. clust_scarcity = 12 * 12 * 12,
  668. clust_num_ores = 29,
  669. clust_size = 5,
  670. y_max = -256,
  671. y_min = -31000,
  672. })
  673. -- Gold
  674. minetest.register_ore({
  675. ore_type = "scatter",
  676. ore = "default:stone_with_gold",
  677. wherein = "default:stone",
  678. clust_scarcity = 13 * 13 * 13,
  679. clust_num_ores = 5,
  680. clust_size = 3,
  681. y_max = 31000,
  682. y_min = 1025,
  683. })
  684. minetest.register_ore({
  685. ore_type = "scatter",
  686. ore = "default:stone_with_gold",
  687. wherein = "default:stone",
  688. clust_scarcity = 15 * 15 * 15,
  689. clust_num_ores = 3,
  690. clust_size = 2,
  691. y_max = -256,
  692. y_min = -511,
  693. })
  694. minetest.register_ore({
  695. ore_type = "scatter",
  696. ore = "default:stone_with_gold",
  697. wherein = "default:stone",
  698. clust_scarcity = 13 * 13 * 13,
  699. clust_num_ores = 5,
  700. clust_size = 3,
  701. y_max = -512,
  702. y_min = -31000,
  703. })
  704. -- Mese crystal
  705. minetest.register_ore({
  706. ore_type = "scatter",
  707. ore = "default:stone_with_mese",
  708. wherein = "default:stone",
  709. clust_scarcity = 14 * 14 * 14,
  710. clust_num_ores = 5,
  711. clust_size = 3,
  712. y_max = 31000,
  713. y_min = 1025,
  714. })
  715. minetest.register_ore({
  716. ore_type = "scatter",
  717. ore = "default:stone_with_mese",
  718. wherein = "default:stone",
  719. clust_scarcity = 18 * 18 * 18,
  720. clust_num_ores = 3,
  721. clust_size = 2,
  722. y_max = -512,
  723. y_min = -1023,
  724. })
  725. minetest.register_ore({
  726. ore_type = "scatter",
  727. ore = "default:stone_with_mese",
  728. wherein = "default:stone",
  729. clust_scarcity = 14 * 14 * 14,
  730. clust_num_ores = 5,
  731. clust_size = 3,
  732. y_max = -1024,
  733. y_min = -31000,
  734. })
  735. -- Diamond
  736. minetest.register_ore({
  737. ore_type = "scatter",
  738. ore = "default:stone_with_diamond",
  739. wherein = "default:stone",
  740. clust_scarcity = 15 * 15 * 15,
  741. clust_num_ores = 4,
  742. clust_size = 3,
  743. y_max = 31000,
  744. y_min = 1025,
  745. })
  746. minetest.register_ore({
  747. ore_type = "scatter",
  748. ore = "default:stone_with_diamond",
  749. wherein = "default:stone",
  750. clust_scarcity = 17 * 17 * 17,
  751. clust_num_ores = 4,
  752. clust_size = 3,
  753. y_max = -1024,
  754. y_min = -2047,
  755. })
  756. minetest.register_ore({
  757. ore_type = "scatter",
  758. ore = "default:stone_with_diamond",
  759. wherein = "default:stone",
  760. clust_scarcity = 15 * 15 * 15,
  761. clust_num_ores = 4,
  762. clust_size = 3,
  763. y_max = -2048,
  764. y_min = -31000,
  765. })
  766. -- Mese block
  767. minetest.register_ore({
  768. ore_type = "scatter",
  769. ore = "default:mese",
  770. wherein = "default:stone",
  771. clust_scarcity = 36 * 36 * 36,
  772. clust_num_ores = 3,
  773. clust_size = 2,
  774. y_max = 31000,
  775. y_min = 1025,
  776. })
  777. minetest.register_ore({
  778. ore_type = "scatter",
  779. ore = "default:mese",
  780. wherein = "default:stone",
  781. clust_scarcity = 36 * 36 * 36,
  782. clust_num_ores = 3,
  783. clust_size = 2,
  784. y_max = -2048,
  785. y_min = -4095,
  786. })
  787. minetest.register_ore({
  788. ore_type = "scatter",
  789. ore = "default:mese",
  790. wherein = "default:stone",
  791. clust_scarcity = 28 * 28 * 28,
  792. clust_num_ores = 5,
  793. clust_size = 3,
  794. y_max = -4096,
  795. y_min = -31000,
  796. })
  797. end
  798. --
  799. -- Register biomes
  800. --
  801. -- All mapgens except mgv6
  802. function default.register_biomes(upper_limit)
  803. -- Icesheet
  804. minetest.register_biome({
  805. name = "icesheet",
  806. node_dust = "default:snowblock",
  807. node_top = "default:snowblock",
  808. depth_top = 1,
  809. node_filler = "default:snowblock",
  810. depth_filler = 3,
  811. node_stone = "default:cave_ice",
  812. node_water_top = "default:ice",
  813. depth_water_top = 10,
  814. node_river_water = "default:ice",
  815. node_riverbed = "default:gravel",
  816. depth_riverbed = 2,
  817. y_max = upper_limit,
  818. y_min = -8,
  819. heat_point = 0,
  820. humidity_point = 73,
  821. })
  822. minetest.register_biome({
  823. name = "icesheet_ocean",
  824. node_dust = "default:snowblock",
  825. node_top = "default:sand",
  826. depth_top = 1,
  827. node_filler = "default:sand",
  828. depth_filler = 3,
  829. node_water_top = "default:ice",
  830. depth_water_top = 10,
  831. y_max = -9,
  832. y_min = -112,
  833. heat_point = 0,
  834. humidity_point = 73,
  835. })
  836. -- Tundra
  837. minetest.register_biome({
  838. name = "tundra_highland",
  839. node_dust = "default:snow",
  840. node_riverbed = "default:gravel",
  841. depth_riverbed = 2,
  842. y_max = upper_limit,
  843. y_min = 47,
  844. heat_point = 0,
  845. humidity_point = 40,
  846. })
  847. minetest.register_biome({
  848. name = "tundra",
  849. node_top = "default:permafrost_with_stones",
  850. depth_top = 1,
  851. node_filler = "default:permafrost",
  852. depth_filler = 1,
  853. node_riverbed = "default:gravel",
  854. depth_riverbed = 2,
  855. vertical_blend = 4,
  856. y_max = 46,
  857. y_min = 2,
  858. heat_point = 0,
  859. humidity_point = 40,
  860. })
  861. minetest.register_biome({
  862. name = "tundra_beach",
  863. node_top = "default:gravel",
  864. depth_top = 1,
  865. node_filler = "default:gravel",
  866. depth_filler = 2,
  867. node_riverbed = "default:gravel",
  868. depth_riverbed = 2,
  869. vertical_blend = 1,
  870. y_max = 1,
  871. y_min = -3,
  872. heat_point = 0,
  873. humidity_point = 40,
  874. })
  875. minetest.register_biome({
  876. name = "tundra_ocean",
  877. node_top = "default:sand",
  878. depth_top = 1,
  879. node_filler = "default:sand",
  880. depth_filler = 3,
  881. node_riverbed = "default:gravel",
  882. depth_riverbed = 2,
  883. vertical_blend = 1,
  884. y_max = -4,
  885. y_min = -112,
  886. heat_point = 0,
  887. humidity_point = 40,
  888. })
  889. -- Taiga
  890. minetest.register_biome({
  891. name = "taiga",
  892. node_dust = "default:snow",
  893. node_top = "default:dirt_with_snow",
  894. depth_top = 1,
  895. node_filler = "default:dirt",
  896. depth_filler = 3,
  897. node_riverbed = "default:sand",
  898. depth_riverbed = 2,
  899. y_max = upper_limit,
  900. y_min = 4,
  901. heat_point = 25,
  902. humidity_point = 70,
  903. })
  904. minetest.register_biome({
  905. name = "taiga_ocean",
  906. node_dust = "default:snow",
  907. node_top = "default:sand",
  908. depth_top = 1,
  909. node_filler = "default:sand",
  910. depth_filler = 3,
  911. node_riverbed = "default:sand",
  912. depth_riverbed = 2,
  913. vertical_blend = 1,
  914. y_max = 3,
  915. y_min = -112,
  916. heat_point = 25,
  917. humidity_point = 70,
  918. })
  919. -- Snowy grassland
  920. minetest.register_biome({
  921. name = "snowy_grassland",
  922. node_dust = "default:snow",
  923. node_top = "default:dirt_with_snow",
  924. depth_top = 1,
  925. node_filler = "default:dirt",
  926. depth_filler = 1,
  927. node_riverbed = "default:sand",
  928. depth_riverbed = 2,
  929. y_max = upper_limit,
  930. y_min = 4,
  931. heat_point = 20,
  932. humidity_point = 35,
  933. })
  934. minetest.register_biome({
  935. name = "snowy_grassland_ocean",
  936. node_dust = "default:snow",
  937. node_top = "default:sand",
  938. depth_top = 1,
  939. node_filler = "default:sand",
  940. depth_filler = 3,
  941. node_riverbed = "default:sand",
  942. depth_riverbed = 2,
  943. vertical_blend = 1,
  944. y_max = 3,
  945. y_min = -112,
  946. heat_point = 20,
  947. humidity_point = 35,
  948. })
  949. -- Grassland
  950. minetest.register_biome({
  951. name = "grassland",
  952. node_top = "default:dirt_with_grass",
  953. depth_top = 1,
  954. node_filler = "default:dirt",
  955. depth_filler = 1,
  956. node_riverbed = "default:sand",
  957. depth_riverbed = 2,
  958. y_max = upper_limit,
  959. y_min = 6,
  960. heat_point = 50,
  961. humidity_point = 35,
  962. })
  963. minetest.register_biome({
  964. name = "grassland_dunes",
  965. node_top = "default:sand",
  966. depth_top = 1,
  967. node_filler = "default:sand",
  968. depth_filler = 2,
  969. node_riverbed = "default:sand",
  970. depth_riverbed = 2,
  971. vertical_blend = 1,
  972. y_max = 5,
  973. y_min = 4,
  974. heat_point = 50,
  975. humidity_point = 35,
  976. })
  977. minetest.register_biome({
  978. name = "grassland_ocean",
  979. node_top = "default:sand",
  980. depth_top = 1,
  981. node_filler = "default:sand",
  982. depth_filler = 3,
  983. node_riverbed = "default:sand",
  984. depth_riverbed = 2,
  985. y_max = 3,
  986. y_min = -112,
  987. heat_point = 50,
  988. humidity_point = 35,
  989. })
  990. -- Coniferous forest
  991. minetest.register_biome({
  992. name = "coniferous_forest",
  993. node_top = "default:dirt_with_coniferous_litter",
  994. depth_top = 1,
  995. node_filler = "default:dirt",
  996. depth_filler = 3,
  997. node_riverbed = "default:sand",
  998. depth_riverbed = 2,
  999. y_max = upper_limit,
  1000. y_min = 6,
  1001. heat_point = 45,
  1002. humidity_point = 70,
  1003. })
  1004. minetest.register_biome({
  1005. name = "coniferous_forest_dunes",
  1006. node_top = "default:sand",
  1007. depth_top = 1,
  1008. node_filler = "default:sand",
  1009. depth_filler = 3,
  1010. node_riverbed = "default:sand",
  1011. depth_riverbed = 2,
  1012. vertical_blend = 1,
  1013. y_max = 5,
  1014. y_min = 4,
  1015. heat_point = 45,
  1016. humidity_point = 70,
  1017. })
  1018. minetest.register_biome({
  1019. name = "coniferous_forest_ocean",
  1020. node_top = "default:sand",
  1021. depth_top = 1,
  1022. node_filler = "default:sand",
  1023. depth_filler = 3,
  1024. node_riverbed = "default:sand",
  1025. depth_riverbed = 2,
  1026. y_max = 3,
  1027. y_min = -112,
  1028. heat_point = 45,
  1029. humidity_point = 70,
  1030. })
  1031. -- Deciduous forest
  1032. minetest.register_biome({
  1033. name = "deciduous_forest",
  1034. node_top = "default:dirt_with_grass",
  1035. depth_top = 1,
  1036. node_filler = "default:dirt",
  1037. depth_filler = 3,
  1038. node_riverbed = "default:sand",
  1039. depth_riverbed = 2,
  1040. y_max = upper_limit,
  1041. y_min = 1,
  1042. heat_point = 60,
  1043. humidity_point = 68,
  1044. })
  1045. minetest.register_biome({
  1046. name = "deciduous_forest_shore",
  1047. node_top = "default:dirt",
  1048. depth_top = 1,
  1049. node_filler = "default:dirt",
  1050. depth_filler = 3,
  1051. node_riverbed = "default:sand",
  1052. depth_riverbed = 2,
  1053. y_max = 0,
  1054. y_min = -1,
  1055. heat_point = 60,
  1056. humidity_point = 68,
  1057. })
  1058. minetest.register_biome({
  1059. name = "deciduous_forest_ocean",
  1060. node_top = "default:sand",
  1061. depth_top = 1,
  1062. node_filler = "default:sand",
  1063. depth_filler = 3,
  1064. node_riverbed = "default:sand",
  1065. depth_riverbed = 2,
  1066. vertical_blend = 1,
  1067. y_max = -2,
  1068. y_min = -112,
  1069. heat_point = 60,
  1070. humidity_point = 68,
  1071. })
  1072. -- Desert
  1073. minetest.register_biome({
  1074. name = "desert",
  1075. node_top = "default:desert_sand",
  1076. depth_top = 1,
  1077. node_filler = "default:desert_sand",
  1078. depth_filler = 1,
  1079. node_stone = "default:desert_stone",
  1080. node_riverbed = "default:sand",
  1081. depth_riverbed = 2,
  1082. y_max = upper_limit,
  1083. y_min = 4,
  1084. heat_point = 92,
  1085. humidity_point = 16,
  1086. })
  1087. minetest.register_biome({
  1088. name = "desert_ocean",
  1089. node_top = "default:sand",
  1090. depth_top = 1,
  1091. node_filler = "default:sand",
  1092. depth_filler = 3,
  1093. node_stone = "default:desert_stone",
  1094. node_riverbed = "default:sand",
  1095. depth_riverbed = 2,
  1096. vertical_blend = 1,
  1097. y_max = 3,
  1098. y_min = -112,
  1099. heat_point = 92,
  1100. humidity_point = 16,
  1101. })
  1102. -- Sandstone desert
  1103. minetest.register_biome({
  1104. name = "sandstone_desert",
  1105. node_top = "default:sand",
  1106. depth_top = 1,
  1107. node_filler = "default:sand",
  1108. depth_filler = 1,
  1109. node_stone = "default:sandstone",
  1110. node_riverbed = "default:sand",
  1111. depth_riverbed = 2,
  1112. y_max = upper_limit,
  1113. y_min = 4,
  1114. heat_point = 60,
  1115. humidity_point = 0,
  1116. })
  1117. minetest.register_biome({
  1118. name = "sandstone_desert_ocean",
  1119. node_top = "default:sand",
  1120. depth_top = 1,
  1121. node_filler = "default:sand",
  1122. depth_filler = 3,
  1123. node_stone = "default:sandstone",
  1124. node_riverbed = "default:sand",
  1125. depth_riverbed = 2,
  1126. y_max = 3,
  1127. y_min = -112,
  1128. heat_point = 60,
  1129. humidity_point = 0,
  1130. })
  1131. -- Cold desert
  1132. minetest.register_biome({
  1133. name = "cold_desert",
  1134. node_top = "default:silver_sand",
  1135. depth_top = 1,
  1136. node_filler = "default:silver_sand",
  1137. depth_filler = 1,
  1138. node_riverbed = "default:sand",
  1139. depth_riverbed = 2,
  1140. y_max = upper_limit,
  1141. y_min = 4,
  1142. heat_point = 40,
  1143. humidity_point = 0,
  1144. })
  1145. minetest.register_biome({
  1146. name = "cold_desert_ocean",
  1147. node_top = "default:sand",
  1148. depth_top = 1,
  1149. node_filler = "default:sand",
  1150. depth_filler = 3,
  1151. node_riverbed = "default:sand",
  1152. depth_riverbed = 2,
  1153. vertical_blend = 1,
  1154. y_max = 3,
  1155. y_min = -112,
  1156. heat_point = 40,
  1157. humidity_point = 0,
  1158. })
  1159. -- Savanna
  1160. minetest.register_biome({
  1161. name = "savanna",
  1162. node_top = "default:dirt_with_dry_grass",
  1163. depth_top = 1,
  1164. node_filler = "default:dirt",
  1165. depth_filler = 1,
  1166. node_riverbed = "default:sand",
  1167. depth_riverbed = 2,
  1168. y_max = upper_limit,
  1169. y_min = 1,
  1170. heat_point = 89,
  1171. humidity_point = 42,
  1172. })
  1173. minetest.register_biome({
  1174. name = "savanna_shore",
  1175. node_top = "default:dirt",
  1176. depth_top = 1,
  1177. node_filler = "default:dirt",
  1178. depth_filler = 3,
  1179. node_riverbed = "default:sand",
  1180. depth_riverbed = 2,
  1181. y_max = 0,
  1182. y_min = -1,
  1183. heat_point = 89,
  1184. humidity_point = 42,
  1185. })
  1186. minetest.register_biome({
  1187. name = "savanna_ocean",
  1188. node_top = "default:sand",
  1189. depth_top = 1,
  1190. node_filler = "default:sand",
  1191. depth_filler = 3,
  1192. node_riverbed = "default:sand",
  1193. depth_riverbed = 2,
  1194. vertical_blend = 1,
  1195. y_max = -2,
  1196. y_min = -112,
  1197. heat_point = 89,
  1198. humidity_point = 42,
  1199. })
  1200. -- Rainforest
  1201. minetest.register_biome({
  1202. name = "rainforest",
  1203. node_top = "default:dirt_with_rainforest_litter",
  1204. depth_top = 1,
  1205. node_filler = "default:dirt",
  1206. depth_filler = 3,
  1207. node_riverbed = "default:sand",
  1208. depth_riverbed = 2,
  1209. y_max = upper_limit,
  1210. y_min = 1,
  1211. heat_point = 86,
  1212. humidity_point = 65,
  1213. })
  1214. minetest.register_biome({
  1215. name = "rainforest_swamp",
  1216. node_top = "default:dirt",
  1217. depth_top = 1,
  1218. node_filler = "default:dirt",
  1219. depth_filler = 3,
  1220. node_riverbed = "default:sand",
  1221. depth_riverbed = 2,
  1222. y_max = 0,
  1223. y_min = -1,
  1224. heat_point = 86,
  1225. humidity_point = 65,
  1226. })
  1227. minetest.register_biome({
  1228. name = "rainforest_ocean",
  1229. node_top = "default:sand",
  1230. depth_top = 1,
  1231. node_filler = "default:sand",
  1232. depth_filler = 3,
  1233. node_riverbed = "default:sand",
  1234. depth_riverbed = 2,
  1235. vertical_blend = 1,
  1236. y_max = -2,
  1237. y_min = -112,
  1238. heat_point = 86,
  1239. humidity_point = 65,
  1240. })
  1241. -- Underground
  1242. minetest.register_biome({
  1243. name = "underground",
  1244. y_max = -113,
  1245. y_min = -31000,
  1246. heat_point = 50,
  1247. humidity_point = 50,
  1248. })
  1249. end
  1250. -- Biomes for floatlands
  1251. -- TODO Temporary simple biomes to be replaced by special floatland biomes later.
  1252. function default.register_floatland_biomes(floatland_level, shadow_limit)
  1253. minetest.register_biome({
  1254. name = "floatland_grassland",
  1255. node_top = "default:dirt_with_grass",
  1256. depth_top = 1,
  1257. node_filler = "default:dirt",
  1258. depth_filler = 1,
  1259. y_max = 31000,
  1260. y_min = floatland_level + 2,
  1261. heat_point = 50,
  1262. humidity_point = 25,
  1263. })
  1264. minetest.register_biome({
  1265. name = "floatland_coniferous_forest",
  1266. node_top = "default:dirt_with_coniferous_litter",
  1267. depth_top = 1,
  1268. node_filler = "default:dirt",
  1269. depth_filler = 3,
  1270. y_max = 31000,
  1271. y_min = floatland_level + 2,
  1272. heat_point = 50,
  1273. humidity_point = 75,
  1274. })
  1275. minetest.register_biome({
  1276. name = "floatland_ocean",
  1277. node_top = "default:sand",
  1278. depth_top = 1,
  1279. node_filler = "default:sand",
  1280. depth_filler = 3,
  1281. y_max = floatland_level + 1,
  1282. y_min = shadow_limit,
  1283. heat_point = 50,
  1284. humidity_point = 50,
  1285. })
  1286. end
  1287. --
  1288. -- Register decorations
  1289. --
  1290. -- Mgv6
  1291. function default.register_mgv6_decorations()
  1292. -- Papyrus
  1293. minetest.register_decoration({
  1294. name = "default:papyrus",
  1295. deco_type = "simple",
  1296. place_on = {"default:dirt_with_grass"},
  1297. sidelen = 16,
  1298. noise_params = {
  1299. offset = -0.3,
  1300. scale = 0.7,
  1301. spread = {x = 100, y = 100, z = 100},
  1302. seed = 354,
  1303. octaves = 3,
  1304. persist = 0.7
  1305. },
  1306. y_max = 1,
  1307. y_min = 1,
  1308. decoration = "default:papyrus",
  1309. height = 2,
  1310. height_max = 4,
  1311. spawn_by = "default:water_source",
  1312. num_spawn_by = 1,
  1313. })
  1314. -- Cacti
  1315. minetest.register_decoration({
  1316. name = "default:cactus",
  1317. deco_type = "simple",
  1318. place_on = {"default:desert_sand"},
  1319. sidelen = 16,
  1320. noise_params = {
  1321. offset = -0.012,
  1322. scale = 0.024,
  1323. spread = {x = 100, y = 100, z = 100},
  1324. seed = 230,
  1325. octaves = 3,
  1326. persist = 0.6
  1327. },
  1328. y_max = 30,
  1329. y_min = 1,
  1330. decoration = "default:cactus",
  1331. height = 3,
  1332. height_max = 4,
  1333. })
  1334. -- Long grasses
  1335. for length = 1, 5 do
  1336. minetest.register_decoration({
  1337. name = "default:grass_"..length,
  1338. deco_type = "simple",
  1339. place_on = {"default:dirt_with_grass"},
  1340. sidelen = 16,
  1341. noise_params = {
  1342. offset = 0,
  1343. scale = 0.007,
  1344. spread = {x = 100, y = 100, z = 100},
  1345. seed = 329,
  1346. octaves = 3,
  1347. persist = 0.6
  1348. },
  1349. y_max = 30,
  1350. y_min = 1,
  1351. decoration = "default:grass_"..length,
  1352. })
  1353. end
  1354. -- Dry shrubs
  1355. minetest.register_decoration({
  1356. name = "default:dry_shrub",
  1357. deco_type = "simple",
  1358. place_on = {"default:desert_sand", "default:dirt_with_snow"},
  1359. sidelen = 16,
  1360. noise_params = {
  1361. offset = 0,
  1362. scale = 0.035,
  1363. spread = {x = 100, y = 100, z = 100},
  1364. seed = 329,
  1365. octaves = 3,
  1366. persist = 0.6
  1367. },
  1368. y_max = 30,
  1369. y_min = 1,
  1370. decoration = "default:dry_shrub",
  1371. param2 = 4,
  1372. })
  1373. end
  1374. -- All mapgens except mgv6
  1375. local function register_grass_decoration(offset, scale, length)
  1376. minetest.register_decoration({
  1377. name = "default:grass_" .. length,
  1378. deco_type = "simple",
  1379. place_on = {"default:dirt_with_grass"},
  1380. sidelen = 16,
  1381. noise_params = {
  1382. offset = offset,
  1383. scale = scale,
  1384. spread = {x = 200, y = 200, z = 200},
  1385. seed = 329,
  1386. octaves = 3,
  1387. persist = 0.6
  1388. },
  1389. biomes = {"grassland", "deciduous_forest", "floatland_grassland"},
  1390. y_max = 31000,
  1391. y_min = 1,
  1392. decoration = "default:grass_" .. length,
  1393. })
  1394. end
  1395. local function register_dry_grass_decoration(offset, scale, length)
  1396. minetest.register_decoration({
  1397. name = "default:dry_grass_" .. length,
  1398. deco_type = "simple",
  1399. place_on = {"default:dirt_with_dry_grass"},
  1400. sidelen = 16,
  1401. noise_params = {
  1402. offset = offset,
  1403. scale = scale,
  1404. spread = {x = 200, y = 200, z = 200},
  1405. seed = 329,
  1406. octaves = 3,
  1407. persist = 0.6
  1408. },
  1409. biomes = {"savanna"},
  1410. y_max = 31000,
  1411. y_min = 1,
  1412. decoration = "default:dry_grass_" .. length,
  1413. })
  1414. end
  1415. local function register_fern_decoration(seed, length)
  1416. minetest.register_decoration({
  1417. name = "default:fern_" .. length,
  1418. deco_type = "simple",
  1419. place_on = {"default:dirt_with_coniferous_litter"},
  1420. sidelen = 16,
  1421. noise_params = {
  1422. offset = 0,
  1423. scale = 0.2,
  1424. spread = {x = 100, y = 100, z = 100},
  1425. seed = seed,
  1426. octaves = 3,
  1427. persist = 0.7
  1428. },
  1429. biomes = {"coniferous_forest", "floatland_coniferous_forest"},
  1430. y_max = 31000,
  1431. y_min = 6,
  1432. decoration = "default:fern_" .. length,
  1433. })
  1434. end
  1435. function default.register_decorations()
  1436. -- Apple tree and log
  1437. minetest.register_decoration({
  1438. name = "default:apple_tree",
  1439. deco_type = "schematic",
  1440. place_on = {"default:dirt_with_grass"},
  1441. sidelen = 16,
  1442. noise_params = {
  1443. offset = 0.024,
  1444. scale = 0.015,
  1445. spread = {x = 250, y = 250, z = 250},
  1446. seed = 2,
  1447. octaves = 3,
  1448. persist = 0.66
  1449. },
  1450. biomes = {"deciduous_forest"},
  1451. y_max = 31000,
  1452. y_min = 1,
  1453. schematic = minetest.get_modpath("default") .. "/schematics/apple_tree.mts",
  1454. flags = "place_center_x, place_center_z",
  1455. rotation = "random",
  1456. })
  1457. minetest.register_decoration({
  1458. name = "default:apple_log",
  1459. deco_type = "schematic",
  1460. place_on = {"default:dirt_with_grass"},
  1461. place_offset_y = 1,
  1462. sidelen = 16,
  1463. noise_params = {
  1464. offset = 0.0012,
  1465. scale = 0.0007,
  1466. spread = {x = 250, y = 250, z = 250},
  1467. seed = 2,
  1468. octaves = 3,
  1469. persist = 0.66
  1470. },
  1471. biomes = {"deciduous_forest"},
  1472. y_max = 31000,
  1473. y_min = 1,
  1474. schematic = minetest.get_modpath("default") .. "/schematics/apple_log.mts",
  1475. flags = "place_center_x",
  1476. rotation = "random",
  1477. spawn_by = "default:dirt_with_grass",
  1478. num_spawn_by = 8,
  1479. })
  1480. -- Emergent jungle tree
  1481. -- Due to 32 node height, altitude is limited and prescence depends on chunksize
  1482. local chunksize = tonumber(minetest.get_mapgen_setting("chunksize"))
  1483. if chunksize >= 5 then
  1484. minetest.register_decoration({
  1485. name = "default:emergent_jungle_tree",
  1486. deco_type = "schematic",
  1487. place_on = {"default:dirt_with_rainforest_litter"},
  1488. sidelen = 80,
  1489. noise_params = {
  1490. offset = 0.0,
  1491. scale = 0.0025,
  1492. spread = {x = 250, y = 250, z = 250},
  1493. seed = 2685,
  1494. octaves = 3,
  1495. persist = 0.7
  1496. },
  1497. biomes = {"rainforest"},
  1498. y_max = 32,
  1499. y_min = 1,
  1500. schematic = minetest.get_modpath("default") ..
  1501. "/schematics/emergent_jungle_tree.mts",
  1502. flags = "place_center_x, place_center_z",
  1503. rotation = "random",
  1504. place_offset_y = -4,
  1505. })
  1506. end
  1507. -- Jungle tree and log
  1508. minetest.register_decoration({
  1509. name = "default:jungle_tree",
  1510. deco_type = "schematic",
  1511. place_on = {"default:dirt_with_rainforest_litter", "default:dirt"},
  1512. sidelen = 80,
  1513. fill_ratio = 0.1,
  1514. biomes = {"rainforest", "rainforest_swamp"},
  1515. y_max = 31000,
  1516. y_min = -1,
  1517. schematic = minetest.get_modpath("default") .. "/schematics/jungle_tree.mts",
  1518. flags = "place_center_x, place_center_z",
  1519. rotation = "random",
  1520. })
  1521. minetest.register_decoration({
  1522. name = "default:jungle_log",
  1523. deco_type = "schematic",
  1524. place_on = {"default:dirt_with_rainforest_litter"},
  1525. place_offset_y = 1,
  1526. sidelen = 80,
  1527. fill_ratio = 0.005,
  1528. biomes = {"rainforest", "rainforest_swamp"},
  1529. y_max = 31000,
  1530. y_min = 1,
  1531. schematic = minetest.get_modpath("default") .. "/schematics/jungle_log.mts",
  1532. flags = "place_center_x",
  1533. rotation = "random",
  1534. spawn_by = "default:dirt_with_rainforest_litter",
  1535. num_spawn_by = 8,
  1536. })
  1537. -- Taiga and temperate coniferous forest pine tree, small pine tree and log
  1538. minetest.register_decoration({
  1539. name = "default:pine_tree",
  1540. deco_type = "schematic",
  1541. place_on = {"default:dirt_with_snow", "default:dirt_with_coniferous_litter"},
  1542. sidelen = 16,
  1543. noise_params = {
  1544. offset = 0.010,
  1545. scale = 0.048,
  1546. spread = {x = 250, y = 250, z = 250},
  1547. seed = 2,
  1548. octaves = 3,
  1549. persist = 0.66
  1550. },
  1551. biomes = {"taiga", "coniferous_forest", "floatland_coniferous_forest"},
  1552. y_max = 31000,
  1553. y_min = 4,
  1554. schematic = minetest.get_modpath("default") .. "/schematics/pine_tree.mts",
  1555. flags = "place_center_x, place_center_z",
  1556. })
  1557. minetest.register_decoration({
  1558. name = "default:small_pine_tree",
  1559. deco_type = "schematic",
  1560. place_on = {"default:dirt_with_snow", "default:dirt_with_coniferous_litter"},
  1561. sidelen = 16,
  1562. noise_params = {
  1563. offset = 0.010,
  1564. scale = -0.048,
  1565. spread = {x = 250, y = 250, z = 250},
  1566. seed = 2,
  1567. octaves = 3,
  1568. persist = 0.66
  1569. },
  1570. biomes = {"taiga", "coniferous_forest", "floatland_coniferous_forest"},
  1571. y_max = 31000,
  1572. y_min = 4,
  1573. schematic = minetest.get_modpath("default") .. "/schematics/small_pine_tree.mts",
  1574. flags = "place_center_x, place_center_z",
  1575. })
  1576. minetest.register_decoration({
  1577. name = "default:pine_log",
  1578. deco_type = "schematic",
  1579. place_on = {"default:dirt_with_snow", "default:dirt_with_coniferous_litter"},
  1580. place_offset_y = 1,
  1581. sidelen = 80,
  1582. fill_ratio = 0.0018,
  1583. biomes = {"taiga", "coniferous_forest", "floatland_coniferous_forest"},
  1584. y_max = 31000,
  1585. y_min = 4,
  1586. schematic = minetest.get_modpath("default") .. "/schematics/pine_log.mts",
  1587. flags = "place_center_x",
  1588. rotation = "random",
  1589. spawn_by = {"default:dirt_with_snow", "default:dirt_with_coniferous_litter"},
  1590. num_spawn_by = 8,
  1591. })
  1592. -- Acacia tree and log
  1593. minetest.register_decoration({
  1594. name = "default:acacia_tree",
  1595. deco_type = "schematic",
  1596. place_on = {"default:dirt_with_dry_grass"},
  1597. sidelen = 16,
  1598. noise_params = {
  1599. offset = 0,
  1600. scale = 0.002,
  1601. spread = {x = 250, y = 250, z = 250},
  1602. seed = 2,
  1603. octaves = 3,
  1604. persist = 0.66
  1605. },
  1606. biomes = {"savanna"},
  1607. y_max = 31000,
  1608. y_min = 1,
  1609. schematic = minetest.get_modpath("default") .. "/schematics/acacia_tree.mts",
  1610. flags = "place_center_x, place_center_z",
  1611. rotation = "random",
  1612. })
  1613. minetest.register_decoration({
  1614. name = "default:acacia_log",
  1615. deco_type = "schematic",
  1616. place_on = {"default:dirt_with_dry_grass"},
  1617. place_offset_y = 1,
  1618. sidelen = 16,
  1619. noise_params = {
  1620. offset = 0,
  1621. scale = 0.001,
  1622. spread = {x = 250, y = 250, z = 250},
  1623. seed = 2,
  1624. octaves = 3,
  1625. persist = 0.66
  1626. },
  1627. biomes = {"savanna"},
  1628. y_max = 31000,
  1629. y_min = 1,
  1630. schematic = minetest.get_modpath("default") .. "/schematics/acacia_log.mts",
  1631. flags = "place_center_x",
  1632. rotation = "random",
  1633. spawn_by = "default:dirt_with_dry_grass",
  1634. num_spawn_by = 8,
  1635. })
  1636. -- Aspen tree and log
  1637. minetest.register_decoration({
  1638. name = "default:aspen_tree",
  1639. deco_type = "schematic",
  1640. place_on = {"default:dirt_with_grass"},
  1641. sidelen = 16,
  1642. noise_params = {
  1643. offset = 0.0,
  1644. scale = -0.015,
  1645. spread = {x = 250, y = 250, z = 250},
  1646. seed = 2,
  1647. octaves = 3,
  1648. persist = 0.66
  1649. },
  1650. biomes = {"deciduous_forest"},
  1651. y_max = 31000,
  1652. y_min = 1,
  1653. schematic = minetest.get_modpath("default") .. "/schematics/aspen_tree.mts",
  1654. flags = "place_center_x, place_center_z",
  1655. })
  1656. minetest.register_decoration({
  1657. name = "default:aspen_log",
  1658. deco_type = "schematic",
  1659. place_on = {"default:dirt_with_grass"},
  1660. place_offset_y = 1,
  1661. sidelen = 16,
  1662. noise_params = {
  1663. offset = 0.0,
  1664. scale = -0.0008,
  1665. spread = {x = 250, y = 250, z = 250},
  1666. seed = 2,
  1667. octaves = 3,
  1668. persist = 0.66
  1669. },
  1670. biomes = {"deciduous_forest"},
  1671. y_max = 31000,
  1672. y_min = 1,
  1673. schematic = minetest.get_modpath("default") .. "/schematics/aspen_log.mts",
  1674. flags = "place_center_x",
  1675. rotation = "random",
  1676. spawn_by = "default:dirt_with_grass",
  1677. num_spawn_by = 8,
  1678. })
  1679. -- Large cactus
  1680. minetest.register_decoration({
  1681. name = "default:large_cactus",
  1682. deco_type = "schematic",
  1683. place_on = {"default:desert_sand"},
  1684. sidelen = 16,
  1685. noise_params = {
  1686. offset = -0.0003,
  1687. scale = 0.0009,
  1688. spread = {x = 200, y = 200, z = 200},
  1689. seed = 230,
  1690. octaves = 3,
  1691. persist = 0.6
  1692. },
  1693. biomes = {"desert"},
  1694. y_max = 31000,
  1695. y_min = 4,
  1696. schematic = minetest.get_modpath("default") .. "/schematics/large_cactus.mts",
  1697. flags = "place_center_x, place_center_z",
  1698. rotation = "random",
  1699. })
  1700. -- Cactus
  1701. minetest.register_decoration({
  1702. name = "default:cactus",
  1703. deco_type = "simple",
  1704. place_on = {"default:desert_sand"},
  1705. sidelen = 16,
  1706. noise_params = {
  1707. offset = -0.0003,
  1708. scale = 0.0009,
  1709. spread = {x = 200, y = 200, z = 200},
  1710. seed = 230,
  1711. octaves = 3,
  1712. persist = 0.6
  1713. },
  1714. biomes = {"desert"},
  1715. y_max = 31000,
  1716. y_min = 4,
  1717. decoration = "default:cactus",
  1718. height = 2,
  1719. height_max = 5,
  1720. })
  1721. -- Papyrus
  1722. minetest.register_decoration({
  1723. name = "default:papyrus",
  1724. deco_type = "schematic",
  1725. place_on = {"default:dirt"},
  1726. sidelen = 16,
  1727. noise_params = {
  1728. offset = -0.3,
  1729. scale = 0.7,
  1730. spread = {x = 200, y = 200, z = 200},
  1731. seed = 354,
  1732. octaves = 3,
  1733. persist = 0.7
  1734. },
  1735. biomes = {"savanna_shore"},
  1736. y_max = 0,
  1737. y_min = 0,
  1738. schematic = minetest.get_modpath("default") .. "/schematics/papyrus.mts",
  1739. })
  1740. -- Bush
  1741. minetest.register_decoration({
  1742. name = "default:bush",
  1743. deco_type = "schematic",
  1744. place_on = {"default:dirt_with_grass"},
  1745. sidelen = 16,
  1746. noise_params = {
  1747. offset = -0.004,
  1748. scale = 0.01,
  1749. spread = {x = 100, y = 100, z = 100},
  1750. seed = 137,
  1751. octaves = 3,
  1752. persist = 0.7,
  1753. },
  1754. biomes = {"grassland", "deciduous_forest",
  1755. "floatland_grassland"},
  1756. y_max = 31000,
  1757. y_min = 1,
  1758. schematic = minetest.get_modpath("default") .. "/schematics/bush.mts",
  1759. flags = "place_center_x, place_center_z",
  1760. })
  1761. -- Blueberry bush
  1762. minetest.register_decoration({
  1763. name = "default:blueberry_bush",
  1764. deco_type = "schematic",
  1765. place_on = {"default:dirt_with_grass", "default:dirt_with_snow"},
  1766. sidelen = 16,
  1767. noise_params = {
  1768. offset = -0.004,
  1769. scale = 0.01,
  1770. spread = {x = 100, y = 100, z = 100},
  1771. seed = 697,
  1772. octaves = 3,
  1773. persist = 0.7,
  1774. },
  1775. biomes = {"grassland", "snowy_grassland"},
  1776. y_max = 31000,
  1777. y_min = 1,
  1778. place_offset_y = 1,
  1779. schematic = minetest.get_modpath("default") .. "/schematics/blueberry_bush.mts",
  1780. flags = "place_center_x, place_center_z",
  1781. })
  1782. -- Acacia bush
  1783. minetest.register_decoration({
  1784. name = "default:acacia_bush",
  1785. deco_type = "schematic",
  1786. place_on = {"default:dirt_with_dry_grass"},
  1787. sidelen = 16,
  1788. noise_params = {
  1789. offset = -0.004,
  1790. scale = 0.01,
  1791. spread = {x = 100, y = 100, z = 100},
  1792. seed = 90155,
  1793. octaves = 3,
  1794. persist = 0.7,
  1795. },
  1796. biomes = {"savanna"},
  1797. y_max = 31000,
  1798. y_min = 1,
  1799. schematic = minetest.get_modpath("default") .. "/schematics/acacia_bush.mts",
  1800. flags = "place_center_x, place_center_z",
  1801. })
  1802. -- Pine bush
  1803. minetest.register_decoration({
  1804. name = "default:pine_bush",
  1805. deco_type = "schematic",
  1806. place_on = {"default:dirt_with_snow"},
  1807. sidelen = 16,
  1808. noise_params = {
  1809. offset = -0.004,
  1810. scale = 0.01,
  1811. spread = {x = 100, y = 100, z = 100},
  1812. seed = 137,
  1813. octaves = 3,
  1814. persist = 0.7,
  1815. },
  1816. biomes = {"taiga", "snowy_grassland"},
  1817. y_max = 31000,
  1818. y_min = 4,
  1819. schematic = minetest.get_modpath("default") .. "/schematics/pine_bush.mts",
  1820. flags = "place_center_x, place_center_z",
  1821. })
  1822. -- Grasses
  1823. register_grass_decoration(-0.03, 0.09, 5)
  1824. register_grass_decoration(-0.015, 0.075, 4)
  1825. register_grass_decoration(0, 0.06, 3)
  1826. register_grass_decoration(0.015, 0.045, 2)
  1827. register_grass_decoration(0.03, 0.03, 1)
  1828. -- Dry grasses
  1829. register_dry_grass_decoration(0.01, 0.05, 5)
  1830. register_dry_grass_decoration(0.03, 0.03, 4)
  1831. register_dry_grass_decoration(0.05, 0.01, 3)
  1832. register_dry_grass_decoration(0.07, -0.01, 2)
  1833. register_dry_grass_decoration(0.09, -0.03, 1)
  1834. -- Ferns
  1835. register_fern_decoration(14936, 3)
  1836. register_fern_decoration(801, 2)
  1837. register_fern_decoration(5, 1)
  1838. -- Junglegrass
  1839. minetest.register_decoration({
  1840. name = "default:junglegrass",
  1841. deco_type = "simple",
  1842. place_on = {"default:dirt_with_rainforest_litter"},
  1843. sidelen = 80,
  1844. fill_ratio = 0.1,
  1845. biomes = {"rainforest"},
  1846. y_max = 31000,
  1847. y_min = 1,
  1848. decoration = "default:junglegrass",
  1849. })
  1850. -- Dry shrub
  1851. minetest.register_decoration({
  1852. name = "default:dry_shrub",
  1853. deco_type = "simple",
  1854. place_on = {"default:desert_sand",
  1855. "default:sand", "default:silver_sand"},
  1856. sidelen = 16,
  1857. noise_params = {
  1858. offset = 0,
  1859. scale = 0.02,
  1860. spread = {x = 200, y = 200, z = 200},
  1861. seed = 329,
  1862. octaves = 3,
  1863. persist = 0.6
  1864. },
  1865. biomes = {"desert", "sandstone_desert", "cold_desert"},
  1866. y_max = 31000,
  1867. y_min = 2,
  1868. decoration = "default:dry_shrub",
  1869. param2 = 4,
  1870. })
  1871. -- Marram grass
  1872. minetest.register_decoration({
  1873. name = "default:marram_grass",
  1874. deco_type = "simple",
  1875. place_on = {"default:sand"},
  1876. sidelen = 4,
  1877. noise_params = {
  1878. offset = -0.4,
  1879. scale = 3.0,
  1880. spread = {x = 16, y = 16, z = 16},
  1881. seed = 513337,
  1882. octaves = 1,
  1883. persist = 0.5,
  1884. flags = "absvalue"
  1885. },
  1886. biomes = {"coniferous_forest_dunes", "grassland_dunes"},
  1887. y_max = 6,
  1888. y_min = 4,
  1889. decoration = {
  1890. "default:marram_grass_1",
  1891. "default:marram_grass_2",
  1892. "default:marram_grass_3",
  1893. },
  1894. })
  1895. -- Tundra moss
  1896. minetest.register_decoration({
  1897. deco_type = "simple",
  1898. place_on = {"default:permafrost_with_stones"},
  1899. sidelen = 4,
  1900. noise_params = {
  1901. offset = -0.8,
  1902. scale = 2.0,
  1903. spread = {x = 100, y = 100, z = 100},
  1904. seed = 53995,
  1905. octaves = 3,
  1906. persist = 1.0
  1907. },
  1908. biomes = {"tundra"},
  1909. y_max = 50,
  1910. y_min = 2,
  1911. decoration = "default:permafrost_with_moss",
  1912. place_offset_y = -1,
  1913. flags = "force_placement",
  1914. })
  1915. -- Tundra patchy snow
  1916. minetest.register_decoration({
  1917. deco_type = "simple",
  1918. place_on = {
  1919. "default:permafrost_with_moss",
  1920. "default:permafrost_with_stones",
  1921. "default:stone",
  1922. "default:gravel"
  1923. },
  1924. sidelen = 4,
  1925. noise_params = {
  1926. offset = 0,
  1927. scale = 1.0,
  1928. spread = {x = 100, y = 100, z = 100},
  1929. seed = 172555,
  1930. octaves = 3,
  1931. persist = 1.0
  1932. },
  1933. biomes = {"tundra", "tundra_beach"},
  1934. y_max = 50,
  1935. y_min = 1,
  1936. decoration = "default:snow",
  1937. })
  1938. -- Coral reef
  1939. minetest.register_decoration({
  1940. name = "default:corals",
  1941. deco_type = "simple",
  1942. place_on = {"default:sand"},
  1943. place_offset_y = -1,
  1944. sidelen = 4,
  1945. noise_params = {
  1946. offset = -4,
  1947. scale = 4,
  1948. spread = {x = 50, y = 50, z = 50},
  1949. seed = 7013,
  1950. octaves = 3,
  1951. persist = 0.7,
  1952. },
  1953. biomes = {
  1954. "desert_ocean",
  1955. "savanna_ocean",
  1956. "rainforest_ocean",
  1957. },
  1958. y_max = -2,
  1959. y_min = -8,
  1960. flags = "force_placement",
  1961. decoration = {
  1962. "default:coral_green", "default:coral_pink",
  1963. "default:coral_cyan", "default:coral_brown",
  1964. "default:coral_orange", "default:coral_skeleton",
  1965. },
  1966. })
  1967. -- Kelp
  1968. minetest.register_decoration({
  1969. name = "default:kelp",
  1970. deco_type = "simple",
  1971. place_on = {"default:sand"},
  1972. place_offset_y = -1,
  1973. sidelen = 16,
  1974. noise_params = {
  1975. offset = -0.04,
  1976. scale = 0.1,
  1977. spread = {x = 200, y = 200, z = 200},
  1978. seed = 87112,
  1979. octaves = 3,
  1980. persist = 0.7
  1981. },
  1982. biomes = {
  1983. "taiga_ocean",
  1984. "snowy_grassland_ocean",
  1985. "grassland_ocean",
  1986. "coniferous_forest_ocean",
  1987. "deciduous_forest_ocean",
  1988. "sandstone_desert_ocean",
  1989. "cold_desert_ocean"},
  1990. y_max = -5,
  1991. y_min = -10,
  1992. flags = "force_placement",
  1993. decoration = "default:sand_with_kelp",
  1994. param2 = 48,
  1995. param2_max = 96,
  1996. })
  1997. end
  1998. --
  1999. -- Detect mapgen, flags and parameters to select functions
  2000. --
  2001. -- Get setting or default
  2002. local mgv7_spflags = minetest.get_mapgen_setting("mgv7_spflags") or
  2003. "mountains, ridges, nofloatlands, caverns"
  2004. local captures_float = string.match(mgv7_spflags, "floatlands")
  2005. local captures_nofloat = string.match(mgv7_spflags, "nofloatlands")
  2006. -- Get setting or default
  2007. -- Make global for mods to use to register floatland biomes
  2008. default.mgv7_floatland_level =
  2009. minetest.get_mapgen_setting("mgv7_floatland_level") or 1280
  2010. default.mgv7_shadow_limit =
  2011. minetest.get_mapgen_setting("mgv7_shadow_limit") or 1024
  2012. minetest.clear_registered_biomes()
  2013. minetest.clear_registered_ores()
  2014. minetest.clear_registered_decorations()
  2015. local mg_name = minetest.get_mapgen_setting("mg_name")
  2016. if mg_name == "v6" then
  2017. default.register_mgv6_ores()
  2018. default.register_mgv6_decorations()
  2019. -- Need to check for 'nofloatlands' because that contains
  2020. -- 'floatlands' which makes the second condition true.
  2021. elseif mg_name == "v7" and
  2022. captures_float == "floatlands" and
  2023. captures_nofloat ~= "nofloatlands" then
  2024. -- Mgv7 with floatlands and floatland biomes
  2025. default.register_biomes(default.mgv7_shadow_limit - 1)
  2026. default.register_floatland_biomes(
  2027. default.mgv7_floatland_level, default.mgv7_shadow_limit)
  2028. default.register_ores()
  2029. default.register_decorations()
  2030. else
  2031. default.register_biomes(31000)
  2032. default.register_ores()
  2033. default.register_decorations()
  2034. end