2
0

mapgen.lua 57 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489
  1. --
  2. -- Aliases for map generators
  3. --
  4. -- All mapgens
  5. minetest.register_alias("mapgen_stone", "default:stone")
  6. minetest.register_alias("mapgen_water_source", "default:water_source")
  7. minetest.register_alias("mapgen_river_water_source", "default:river_water_source")
  8. -- Additional aliases needed for mapgen v6
  9. minetest.register_alias("mapgen_lava_source", "default:lava_source")
  10. minetest.register_alias("mapgen_dirt", "default:dirt")
  11. minetest.register_alias("mapgen_dirt_with_grass", "default:dirt_with_grass")
  12. minetest.register_alias("mapgen_sand", "default:sand")
  13. minetest.register_alias("mapgen_gravel", "default:gravel")
  14. minetest.register_alias("mapgen_desert_stone", "default:desert_stone")
  15. minetest.register_alias("mapgen_desert_sand", "default:desert_sand")
  16. minetest.register_alias("mapgen_dirt_with_snow", "default:dirt_with_snow")
  17. minetest.register_alias("mapgen_snowblock", "default:snowblock")
  18. minetest.register_alias("mapgen_snow", "default:snow")
  19. minetest.register_alias("mapgen_ice", "default:ice")
  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. minetest.register_alias("mapgen_cobble", "default:cobble")
  29. minetest.register_alias("mapgen_stair_cobble", "stairs:stair_cobble")
  30. minetest.register_alias("mapgen_mossycobble", "default:mossycobble")
  31. minetest.register_alias("mapgen_stair_desert_stone", "stairs:stair_desert_stone")
  32. --
  33. -- Register ores
  34. --
  35. -- Mgv6
  36. function default.register_mgv6_ores()
  37. -- Blob ore
  38. -- These first to avoid other ores in blobs
  39. -- Clay
  40. -- This first to avoid clay in sand blobs
  41. minetest.register_ore({
  42. ore_type = "blob",
  43. ore = "default:clay",
  44. wherein = {"default:sand"},
  45. clust_scarcity = 16 * 16 * 16,
  46. clust_size = 5,
  47. y_max = 0,
  48. y_min = -15,
  49. noise_threshold = 0.0,
  50. noise_params = {
  51. offset = 0.5,
  52. scale = 0.2,
  53. spread = {x = 5, y = 5, z = 5},
  54. seed = -316,
  55. octaves = 1,
  56. persist = 0.0
  57. },
  58. })
  59. -- Sand
  60. minetest.register_ore({
  61. ore_type = "blob",
  62. ore = "default:sand",
  63. wherein = {"default:stone", "default:desert_stone"},
  64. clust_scarcity = 16 * 16 * 16,
  65. clust_size = 5,
  66. y_max = 0,
  67. y_min = -31,
  68. noise_threshold = 0.0,
  69. noise_params = {
  70. offset = 0.5,
  71. scale = 0.2,
  72. spread = {x = 5, y = 5, z = 5},
  73. seed = 2316,
  74. octaves = 1,
  75. persist = 0.0
  76. },
  77. })
  78. -- Dirt
  79. minetest.register_ore({
  80. ore_type = "blob",
  81. ore = "default:dirt",
  82. wherein = {"default:stone"},
  83. clust_scarcity = 16 * 16 * 16,
  84. clust_size = 5,
  85. y_max = 31000,
  86. y_min = -31,
  87. noise_threshold = 0.0,
  88. noise_params = {
  89. offset = 0.5,
  90. scale = 0.2,
  91. spread = {x = 5, y = 5, z = 5},
  92. seed = 17676,
  93. octaves = 1,
  94. persist = 0.0
  95. },
  96. })
  97. -- Gravel
  98. minetest.register_ore({
  99. ore_type = "blob",
  100. ore = "default:gravel",
  101. wherein = {"default:stone"},
  102. clust_scarcity = 16 * 16 * 16,
  103. clust_size = 5,
  104. y_max = 31000,
  105. y_min = -31000,
  106. noise_threshold = 0.0,
  107. noise_params = {
  108. offset = 0.5,
  109. scale = 0.2,
  110. spread = {x = 5, y = 5, z = 5},
  111. seed = 766,
  112. octaves = 1,
  113. persist = 0.0
  114. },
  115. })
  116. -- Scatter ores
  117. -- Coal
  118. minetest.register_ore({
  119. ore_type = "scatter",
  120. ore = "default:stone_with_coal",
  121. wherein = "default:stone",
  122. clust_scarcity = 8 * 8 * 8,
  123. clust_num_ores = 9,
  124. clust_size = 3,
  125. y_max = 31000,
  126. y_min = 1025,
  127. })
  128. minetest.register_ore({
  129. ore_type = "scatter",
  130. ore = "default:stone_with_coal",
  131. wherein = "default:stone",
  132. clust_scarcity = 8 * 8 * 8,
  133. clust_num_ores = 8,
  134. clust_size = 3,
  135. y_max = 64,
  136. y_min = -31000,
  137. })
  138. minetest.register_ore({
  139. ore_type = "scatter",
  140. ore = "default:stone_with_coal",
  141. wherein = "default:stone",
  142. clust_scarcity = 24 * 24 * 24,
  143. clust_num_ores = 27,
  144. clust_size = 6,
  145. y_max = 0,
  146. y_min = -31000,
  147. })
  148. -- Iron
  149. minetest.register_ore({
  150. ore_type = "scatter",
  151. ore = "default:stone_with_iron",
  152. wherein = "default:stone",
  153. clust_scarcity = 9 * 9 * 9,
  154. clust_num_ores = 12,
  155. clust_size = 3,
  156. y_max = 31000,
  157. y_min = 1025,
  158. })
  159. minetest.register_ore({
  160. ore_type = "scatter",
  161. ore = "default:stone_with_iron",
  162. wherein = "default:stone",
  163. clust_scarcity = 7 * 7 * 7,
  164. clust_num_ores = 5,
  165. clust_size = 3,
  166. y_max = 0,
  167. y_min = -31000,
  168. })
  169. minetest.register_ore({
  170. ore_type = "scatter",
  171. ore = "default:stone_with_iron",
  172. wherein = "default:stone",
  173. clust_scarcity = 24 * 24 * 24,
  174. clust_num_ores = 27,
  175. clust_size = 6,
  176. y_max = -64,
  177. y_min = -31000,
  178. })
  179. -- Copper
  180. minetest.register_ore({
  181. ore_type = "scatter",
  182. ore = "default:stone_with_copper",
  183. wherein = "default:stone",
  184. clust_scarcity = 9 * 9 * 9,
  185. clust_num_ores = 5,
  186. clust_size = 3,
  187. y_max = 31000,
  188. y_min = 1025,
  189. })
  190. minetest.register_ore({
  191. ore_type = "scatter",
  192. ore = "default:stone_with_copper",
  193. wherein = "default:stone",
  194. clust_scarcity = 12 * 12 * 12,
  195. clust_num_ores = 4,
  196. clust_size = 3,
  197. y_max = -16,
  198. y_min = -63,
  199. })
  200. minetest.register_ore({
  201. ore_type = "scatter",
  202. ore = "default:stone_with_copper",
  203. wherein = "default:stone",
  204. clust_scarcity = 9 * 9 * 9,
  205. clust_num_ores = 5,
  206. clust_size = 3,
  207. y_max = -64,
  208. y_min = -31000,
  209. })
  210. -- Tin
  211. minetest.register_ore({
  212. ore_type = "scatter",
  213. ore = "default:stone_with_tin",
  214. wherein = "default:stone",
  215. clust_scarcity = 10 * 10 * 10,
  216. clust_num_ores = 5,
  217. clust_size = 3,
  218. y_max = 31000,
  219. y_min = 1025,
  220. })
  221. minetest.register_ore({
  222. ore_type = "scatter",
  223. ore = "default:stone_with_tin",
  224. wherein = "default:stone",
  225. clust_scarcity = 13 * 13 * 13,
  226. clust_num_ores = 4,
  227. clust_size = 3,
  228. y_max = -32,
  229. y_min = -127,
  230. })
  231. minetest.register_ore({
  232. ore_type = "scatter",
  233. ore = "default:stone_with_tin",
  234. wherein = "default:stone",
  235. clust_scarcity = 10 * 10 * 10,
  236. clust_num_ores = 5,
  237. clust_size = 3,
  238. y_max = -128,
  239. y_min = -31000,
  240. })
  241. -- Gold
  242. minetest.register_ore({
  243. ore_type = "scatter",
  244. ore = "default:stone_with_gold",
  245. wherein = "default:stone",
  246. clust_scarcity = 13 * 13 * 13,
  247. clust_num_ores = 5,
  248. clust_size = 3,
  249. y_max = 31000,
  250. y_min = 1025,
  251. })
  252. minetest.register_ore({
  253. ore_type = "scatter",
  254. ore = "default:stone_with_gold",
  255. wherein = "default:stone",
  256. clust_scarcity = 15 * 15 * 15,
  257. clust_num_ores = 3,
  258. clust_size = 2,
  259. y_max = -64,
  260. y_min = -255,
  261. })
  262. minetest.register_ore({
  263. ore_type = "scatter",
  264. ore = "default:stone_with_gold",
  265. wherein = "default:stone",
  266. clust_scarcity = 13 * 13 * 13,
  267. clust_num_ores = 5,
  268. clust_size = 3,
  269. y_max = -256,
  270. y_min = -31000,
  271. })
  272. -- Mese crystal
  273. minetest.register_ore({
  274. ore_type = "scatter",
  275. ore = "default:stone_with_mese",
  276. wherein = "default:stone",
  277. clust_scarcity = 14 * 14 * 14,
  278. clust_num_ores = 5,
  279. clust_size = 3,
  280. y_max = 31000,
  281. y_min = 1025,
  282. })
  283. minetest.register_ore({
  284. ore_type = "scatter",
  285. ore = "default:stone_with_mese",
  286. wherein = "default:stone",
  287. clust_scarcity = 18 * 18 * 18,
  288. clust_num_ores = 3,
  289. clust_size = 2,
  290. y_max = -64,
  291. y_min = -255,
  292. })
  293. minetest.register_ore({
  294. ore_type = "scatter",
  295. ore = "default:stone_with_mese",
  296. wherein = "default:stone",
  297. clust_scarcity = 14 * 14 * 14,
  298. clust_num_ores = 5,
  299. clust_size = 3,
  300. y_max = -256,
  301. y_min = -31000,
  302. })
  303. -- Diamond
  304. minetest.register_ore({
  305. ore_type = "scatter",
  306. ore = "default:stone_with_diamond",
  307. wherein = "default:stone",
  308. clust_scarcity = 15 * 15 * 15,
  309. clust_num_ores = 4,
  310. clust_size = 3,
  311. y_max = 31000,
  312. y_min = 1025,
  313. })
  314. minetest.register_ore({
  315. ore_type = "scatter",
  316. ore = "default:stone_with_diamond",
  317. wherein = "default:stone",
  318. clust_scarcity = 17 * 17 * 17,
  319. clust_num_ores = 4,
  320. clust_size = 3,
  321. y_max = -128,
  322. y_min = -255,
  323. })
  324. minetest.register_ore({
  325. ore_type = "scatter",
  326. ore = "default:stone_with_diamond",
  327. wherein = "default:stone",
  328. clust_scarcity = 15 * 15 * 15,
  329. clust_num_ores = 4,
  330. clust_size = 3,
  331. y_max = -256,
  332. y_min = -31000,
  333. })
  334. -- Mese block
  335. minetest.register_ore({
  336. ore_type = "scatter",
  337. ore = "default:mese",
  338. wherein = "default:stone",
  339. clust_scarcity = 36 * 36 * 36,
  340. clust_num_ores = 3,
  341. clust_size = 2,
  342. y_max = 31000,
  343. y_min = 1025,
  344. })
  345. minetest.register_ore({
  346. ore_type = "scatter",
  347. ore = "default:mese",
  348. wherein = "default:stone",
  349. clust_scarcity = 36 * 36 * 36,
  350. clust_num_ores = 3,
  351. clust_size = 2,
  352. y_max = -1024,
  353. y_min = -31000,
  354. })
  355. end
  356. -- All mapgens except mgv6
  357. function default.register_ores()
  358. -- Stratum ores.
  359. -- These obviously first.
  360. -- Silver sandstone
  361. minetest.register_ore({
  362. ore_type = "stratum",
  363. ore = "default:silver_sandstone",
  364. wherein = {"default:stone"},
  365. clust_scarcity = 1,
  366. y_max = 46,
  367. y_min = 10,
  368. noise_params = {
  369. offset = 28,
  370. scale = 16,
  371. spread = {x = 128, y = 128, z = 128},
  372. seed = 90122,
  373. octaves = 1,
  374. },
  375. stratum_thickness = 4,
  376. biomes = {"cold_desert"},
  377. })
  378. minetest.register_ore({
  379. ore_type = "stratum",
  380. ore = "default:silver_sandstone",
  381. wherein = {"default:stone"},
  382. clust_scarcity = 1,
  383. y_max = 42,
  384. y_min = 6,
  385. noise_params = {
  386. offset = 24,
  387. scale = 16,
  388. spread = {x = 128, y = 128, z = 128},
  389. seed = 90122,
  390. octaves = 1,
  391. },
  392. stratum_thickness = 2,
  393. biomes = {"cold_desert"},
  394. })
  395. -- Desert sandstone
  396. minetest.register_ore({
  397. ore_type = "stratum",
  398. ore = "default:desert_sandstone",
  399. wherein = {"default:desert_stone"},
  400. clust_scarcity = 1,
  401. y_max = 46,
  402. y_min = 10,
  403. noise_params = {
  404. offset = 28,
  405. scale = 16,
  406. spread = {x = 128, y = 128, z = 128},
  407. seed = 90122,
  408. octaves = 1,
  409. },
  410. stratum_thickness = 4,
  411. biomes = {"desert"},
  412. })
  413. minetest.register_ore({
  414. ore_type = "stratum",
  415. ore = "default:desert_sandstone",
  416. wherein = {"default:desert_stone"},
  417. clust_scarcity = 1,
  418. y_max = 42,
  419. y_min = 6,
  420. noise_params = {
  421. offset = 24,
  422. scale = 16,
  423. spread = {x = 128, y = 128, z = 128},
  424. seed = 90122,
  425. octaves = 1,
  426. },
  427. stratum_thickness = 2,
  428. biomes = {"desert"},
  429. })
  430. -- Sandstone
  431. minetest.register_ore({
  432. ore_type = "stratum",
  433. ore = "default:sandstone",
  434. wherein = {"default:desert_stone"},
  435. clust_scarcity = 1,
  436. y_max = 39,
  437. y_min = 3,
  438. noise_params = {
  439. offset = 21,
  440. scale = 16,
  441. spread = {x = 128, y = 128, z = 128},
  442. seed = 90122,
  443. octaves = 1,
  444. },
  445. stratum_thickness = 2,
  446. biomes = {"desert"},
  447. })
  448. -- Blob ore.
  449. -- These before scatter ores to avoid other ores in blobs.
  450. -- Clay
  451. minetest.register_ore({
  452. ore_type = "blob",
  453. ore = "default:clay",
  454. wherein = {"default:sand"},
  455. clust_scarcity = 16 * 16 * 16,
  456. clust_size = 5,
  457. y_max = 0,
  458. y_min = -15,
  459. noise_threshold = 0.0,
  460. noise_params = {
  461. offset = 0.5,
  462. scale = 0.2,
  463. spread = {x = 5, y = 5, z = 5},
  464. seed = -316,
  465. octaves = 1,
  466. persist = 0.0
  467. },
  468. })
  469. -- Silver sand
  470. minetest.register_ore({
  471. ore_type = "blob",
  472. ore = "default:silver_sand",
  473. wherein = {"default:stone"},
  474. clust_scarcity = 16 * 16 * 16,
  475. clust_size = 5,
  476. y_max = 31000,
  477. y_min = -31000,
  478. noise_threshold = 0.0,
  479. noise_params = {
  480. offset = 0.5,
  481. scale = 0.2,
  482. spread = {x = 5, y = 5, z = 5},
  483. seed = 2316,
  484. octaves = 1,
  485. persist = 0.0
  486. },
  487. })
  488. -- Dirt
  489. minetest.register_ore({
  490. ore_type = "blob",
  491. ore = "default:dirt",
  492. wherein = {"default:stone"},
  493. clust_scarcity = 16 * 16 * 16,
  494. clust_size = 5,
  495. y_max = 31000,
  496. y_min = -31,
  497. noise_threshold = 0.0,
  498. noise_params = {
  499. offset = 0.5,
  500. scale = 0.2,
  501. spread = {x = 5, y = 5, z = 5},
  502. seed = 17676,
  503. octaves = 1,
  504. persist = 0.0
  505. },
  506. -- Only where default:dirt is present as surface material
  507. biomes = {"taiga", "snowy_grassland", "grassland", "coniferous_forest",
  508. "deciduous_forest", "deciduous_forest_shore", "rainforest",
  509. "rainforest_swamp"}
  510. })
  511. -- Gravel
  512. minetest.register_ore({
  513. ore_type = "blob",
  514. ore = "default:gravel",
  515. wherein = {"default:stone"},
  516. clust_scarcity = 16 * 16 * 16,
  517. clust_size = 5,
  518. y_max = 31000,
  519. y_min = -31000,
  520. noise_threshold = 0.0,
  521. noise_params = {
  522. offset = 0.5,
  523. scale = 0.2,
  524. spread = {x = 5, y = 5, z = 5},
  525. seed = 766,
  526. octaves = 1,
  527. persist = 0.0
  528. },
  529. })
  530. -- Scatter ores
  531. -- Coal
  532. minetest.register_ore({
  533. ore_type = "scatter",
  534. ore = "default:stone_with_coal",
  535. wherein = "default:stone",
  536. clust_scarcity = 8 * 8 * 8,
  537. clust_num_ores = 9,
  538. clust_size = 3,
  539. y_max = 31000,
  540. y_min = 1025,
  541. })
  542. minetest.register_ore({
  543. ore_type = "scatter",
  544. ore = "default:stone_with_coal",
  545. wherein = "default:stone",
  546. clust_scarcity = 8 * 8 * 8,
  547. clust_num_ores = 8,
  548. clust_size = 3,
  549. y_max = 64,
  550. y_min = -127,
  551. })
  552. minetest.register_ore({
  553. ore_type = "scatter",
  554. ore = "default:stone_with_coal",
  555. wherein = "default:stone",
  556. clust_scarcity = 12 * 12 * 12,
  557. clust_num_ores = 30,
  558. clust_size = 5,
  559. y_max = -128,
  560. y_min = -31000,
  561. })
  562. -- Tin
  563. minetest.register_ore({
  564. ore_type = "scatter",
  565. ore = "default:stone_with_tin",
  566. wherein = "default:stone",
  567. clust_scarcity = 10 * 10 * 10,
  568. clust_num_ores = 5,
  569. clust_size = 3,
  570. y_max = 31000,
  571. y_min = 1025,
  572. })
  573. minetest.register_ore({
  574. ore_type = "scatter",
  575. ore = "default:stone_with_tin",
  576. wherein = "default:stone",
  577. clust_scarcity = 13 * 13 * 13,
  578. clust_num_ores = 4,
  579. clust_size = 3,
  580. y_max = -64,
  581. y_min = -127,
  582. })
  583. minetest.register_ore({
  584. ore_type = "scatter",
  585. ore = "default:stone_with_tin",
  586. wherein = "default:stone",
  587. clust_scarcity = 10 * 10 * 10,
  588. clust_num_ores = 5,
  589. clust_size = 3,
  590. y_max = -128,
  591. y_min = -31000,
  592. })
  593. -- Copper
  594. minetest.register_ore({
  595. ore_type = "scatter",
  596. ore = "default:stone_with_copper",
  597. wherein = "default:stone",
  598. clust_scarcity = 9 * 9 * 9,
  599. clust_num_ores = 5,
  600. clust_size = 3,
  601. y_max = 31000,
  602. y_min = 1025,
  603. })
  604. minetest.register_ore({
  605. ore_type = "scatter",
  606. ore = "default:stone_with_copper",
  607. wherein = "default:stone",
  608. clust_scarcity = 12 * 12 * 12,
  609. clust_num_ores = 4,
  610. clust_size = 3,
  611. y_max = -64,
  612. y_min = -127,
  613. })
  614. minetest.register_ore({
  615. ore_type = "scatter",
  616. ore = "default:stone_with_copper",
  617. wherein = "default:stone",
  618. clust_scarcity = 9 * 9 * 9,
  619. clust_num_ores = 5,
  620. clust_size = 3,
  621. y_max = -128,
  622. y_min = -31000,
  623. })
  624. -- Iron
  625. minetest.register_ore({
  626. ore_type = "scatter",
  627. ore = "default:stone_with_iron",
  628. wherein = "default:stone",
  629. clust_scarcity = 9 * 9 * 9,
  630. clust_num_ores = 12,
  631. clust_size = 3,
  632. y_max = 31000,
  633. y_min = 1025,
  634. })
  635. minetest.register_ore({
  636. ore_type = "scatter",
  637. ore = "default:stone_with_iron",
  638. wherein = "default:stone",
  639. clust_scarcity = 7 * 7 * 7,
  640. clust_num_ores = 5,
  641. clust_size = 3,
  642. y_max = -128,
  643. y_min = -255,
  644. })
  645. minetest.register_ore({
  646. ore_type = "scatter",
  647. ore = "default:stone_with_iron",
  648. wherein = "default:stone",
  649. clust_scarcity = 12 * 12 * 12,
  650. clust_num_ores = 29,
  651. clust_size = 5,
  652. y_max = -256,
  653. y_min = -31000,
  654. })
  655. -- Gold
  656. minetest.register_ore({
  657. ore_type = "scatter",
  658. ore = "default:stone_with_gold",
  659. wherein = "default:stone",
  660. clust_scarcity = 13 * 13 * 13,
  661. clust_num_ores = 5,
  662. clust_size = 3,
  663. y_max = 31000,
  664. y_min = 1025,
  665. })
  666. minetest.register_ore({
  667. ore_type = "scatter",
  668. ore = "default:stone_with_gold",
  669. wherein = "default:stone",
  670. clust_scarcity = 15 * 15 * 15,
  671. clust_num_ores = 3,
  672. clust_size = 2,
  673. y_max = -256,
  674. y_min = -511,
  675. })
  676. minetest.register_ore({
  677. ore_type = "scatter",
  678. ore = "default:stone_with_gold",
  679. wherein = "default:stone",
  680. clust_scarcity = 13 * 13 * 13,
  681. clust_num_ores = 5,
  682. clust_size = 3,
  683. y_max = -512,
  684. y_min = -31000,
  685. })
  686. -- Mese crystal
  687. minetest.register_ore({
  688. ore_type = "scatter",
  689. ore = "default:stone_with_mese",
  690. wherein = "default:stone",
  691. clust_scarcity = 14 * 14 * 14,
  692. clust_num_ores = 5,
  693. clust_size = 3,
  694. y_max = 31000,
  695. y_min = 1025,
  696. })
  697. minetest.register_ore({
  698. ore_type = "scatter",
  699. ore = "default:stone_with_mese",
  700. wherein = "default:stone",
  701. clust_scarcity = 18 * 18 * 18,
  702. clust_num_ores = 3,
  703. clust_size = 2,
  704. y_max = -512,
  705. y_min = -1023,
  706. })
  707. minetest.register_ore({
  708. ore_type = "scatter",
  709. ore = "default:stone_with_mese",
  710. wherein = "default:stone",
  711. clust_scarcity = 14 * 14 * 14,
  712. clust_num_ores = 5,
  713. clust_size = 3,
  714. y_max = -1024,
  715. y_min = -31000,
  716. })
  717. -- Diamond
  718. minetest.register_ore({
  719. ore_type = "scatter",
  720. ore = "default:stone_with_diamond",
  721. wherein = "default:stone",
  722. clust_scarcity = 15 * 15 * 15,
  723. clust_num_ores = 4,
  724. clust_size = 3,
  725. y_max = 31000,
  726. y_min = 1025,
  727. })
  728. minetest.register_ore({
  729. ore_type = "scatter",
  730. ore = "default:stone_with_diamond",
  731. wherein = "default:stone",
  732. clust_scarcity = 17 * 17 * 17,
  733. clust_num_ores = 4,
  734. clust_size = 3,
  735. y_max = -1024,
  736. y_min = -2047,
  737. })
  738. minetest.register_ore({
  739. ore_type = "scatter",
  740. ore = "default:stone_with_diamond",
  741. wherein = "default:stone",
  742. clust_scarcity = 15 * 15 * 15,
  743. clust_num_ores = 4,
  744. clust_size = 3,
  745. y_max = -2048,
  746. y_min = -31000,
  747. })
  748. -- Mese block
  749. minetest.register_ore({
  750. ore_type = "scatter",
  751. ore = "default:mese",
  752. wherein = "default:stone",
  753. clust_scarcity = 36 * 36 * 36,
  754. clust_num_ores = 3,
  755. clust_size = 2,
  756. y_max = 31000,
  757. y_min = 1025,
  758. })
  759. minetest.register_ore({
  760. ore_type = "scatter",
  761. ore = "default:mese",
  762. wherein = "default:stone",
  763. clust_scarcity = 36 * 36 * 36,
  764. clust_num_ores = 3,
  765. clust_size = 2,
  766. y_max = -2048,
  767. y_min = -4095,
  768. })
  769. minetest.register_ore({
  770. ore_type = "scatter",
  771. ore = "default:mese",
  772. wherein = "default:stone",
  773. clust_scarcity = 28 * 28 * 28,
  774. clust_num_ores = 5,
  775. clust_size = 3,
  776. y_max = -4096,
  777. y_min = -31000,
  778. })
  779. end
  780. --
  781. -- Register biomes
  782. --
  783. -- All mapgens except mgv6
  784. function default.register_biomes()
  785. -- Icesheet
  786. minetest.register_biome({
  787. name = "icesheet",
  788. node_dust = "default:snowblock",
  789. node_top = "default:snowblock",
  790. depth_top = 1,
  791. node_filler = "default:snowblock",
  792. depth_filler = 3,
  793. node_stone = "default:cave_ice",
  794. node_water_top = "default:ice",
  795. depth_water_top = 10,
  796. node_river_water = "default:ice",
  797. node_riverbed = "default:gravel",
  798. depth_riverbed = 2,
  799. node_dungeon = "default:ice",
  800. node_dungeon_stair = "stairs:stair_ice",
  801. y_max = 31000,
  802. y_min = -8,
  803. heat_point = 0,
  804. humidity_point = 73,
  805. })
  806. minetest.register_biome({
  807. name = "icesheet_ocean",
  808. node_dust = "default:snowblock",
  809. node_top = "default:sand",
  810. depth_top = 1,
  811. node_filler = "default:sand",
  812. depth_filler = 3,
  813. node_water_top = "default:ice",
  814. depth_water_top = 10,
  815. node_cave_liquid = "default:water_source",
  816. node_dungeon = "default:cobble",
  817. node_dungeon_alt = "default:mossycobble",
  818. node_dungeon_stair = "stairs:stair_cobble",
  819. y_max = -9,
  820. y_min = -255,
  821. heat_point = 0,
  822. humidity_point = 73,
  823. })
  824. minetest.register_biome({
  825. name = "icesheet_under",
  826. node_cave_liquid = {"default:water_source", "default:lava_source"},
  827. node_dungeon = "default:cobble",
  828. node_dungeon_alt = "default:mossycobble",
  829. node_dungeon_stair = "stairs:stair_cobble",
  830. y_max = -256,
  831. y_min = -31000,
  832. heat_point = 0,
  833. humidity_point = 73,
  834. })
  835. -- Tundra
  836. minetest.register_biome({
  837. name = "tundra_highland",
  838. node_dust = "default:snow",
  839. node_riverbed = "default:gravel",
  840. depth_riverbed = 2,
  841. node_dungeon = "default:cobble",
  842. node_dungeon_alt = "default:mossycobble",
  843. node_dungeon_stair = "stairs:stair_cobble",
  844. y_max = 31000,
  845. y_min = 47,
  846. heat_point = 0,
  847. humidity_point = 40,
  848. })
  849. minetest.register_biome({
  850. name = "tundra",
  851. node_top = "default:permafrost_with_stones",
  852. depth_top = 1,
  853. node_filler = "default:permafrost",
  854. depth_filler = 1,
  855. node_riverbed = "default:gravel",
  856. depth_riverbed = 2,
  857. node_dungeon = "default:cobble",
  858. node_dungeon_alt = "default:mossycobble",
  859. node_dungeon_stair = "stairs:stair_cobble",
  860. vertical_blend = 4,
  861. y_max = 46,
  862. y_min = 2,
  863. heat_point = 0,
  864. humidity_point = 40,
  865. })
  866. minetest.register_biome({
  867. name = "tundra_beach",
  868. node_top = "default:gravel",
  869. depth_top = 1,
  870. node_filler = "default:gravel",
  871. depth_filler = 2,
  872. node_riverbed = "default:gravel",
  873. depth_riverbed = 2,
  874. node_dungeon = "default:cobble",
  875. node_dungeon_alt = "default:mossycobble",
  876. node_dungeon_stair = "stairs:stair_cobble",
  877. vertical_blend = 1,
  878. y_max = 1,
  879. y_min = -3,
  880. heat_point = 0,
  881. humidity_point = 40,
  882. })
  883. minetest.register_biome({
  884. name = "tundra_ocean",
  885. node_top = "default:sand",
  886. depth_top = 1,
  887. node_filler = "default:sand",
  888. depth_filler = 3,
  889. node_riverbed = "default:gravel",
  890. depth_riverbed = 2,
  891. node_cave_liquid = "default:water_source",
  892. node_dungeon = "default:cobble",
  893. node_dungeon_alt = "default:mossycobble",
  894. node_dungeon_stair = "stairs:stair_cobble",
  895. vertical_blend = 1,
  896. y_max = -4,
  897. y_min = -255,
  898. heat_point = 0,
  899. humidity_point = 40,
  900. })
  901. minetest.register_biome({
  902. name = "tundra_under",
  903. node_cave_liquid = {"default:water_source", "default:lava_source"},
  904. node_dungeon = "default:cobble",
  905. node_dungeon_alt = "default:mossycobble",
  906. node_dungeon_stair = "stairs:stair_cobble",
  907. y_max = -256,
  908. y_min = -31000,
  909. heat_point = 0,
  910. humidity_point = 40,
  911. })
  912. -- Taiga
  913. minetest.register_biome({
  914. name = "taiga",
  915. node_dust = "default:snow",
  916. node_top = "default:dirt_with_snow",
  917. depth_top = 1,
  918. node_filler = "default:dirt",
  919. depth_filler = 3,
  920. node_riverbed = "default:sand",
  921. depth_riverbed = 2,
  922. node_dungeon = "default:cobble",
  923. node_dungeon_alt = "default:mossycobble",
  924. node_dungeon_stair = "stairs:stair_cobble",
  925. y_max = 31000,
  926. y_min = 4,
  927. heat_point = 25,
  928. humidity_point = 70,
  929. })
  930. minetest.register_biome({
  931. name = "taiga_ocean",
  932. node_dust = "default:snow",
  933. node_top = "default:sand",
  934. depth_top = 1,
  935. node_filler = "default:sand",
  936. depth_filler = 3,
  937. node_riverbed = "default:sand",
  938. depth_riverbed = 2,
  939. node_cave_liquid = "default:water_source",
  940. node_dungeon = "default:cobble",
  941. node_dungeon_alt = "default:mossycobble",
  942. node_dungeon_stair = "stairs:stair_cobble",
  943. vertical_blend = 1,
  944. y_max = 3,
  945. y_min = -255,
  946. heat_point = 25,
  947. humidity_point = 70,
  948. })
  949. minetest.register_biome({
  950. name = "taiga_under",
  951. node_cave_liquid = {"default:water_source", "default:lava_source"},
  952. node_dungeon = "default:cobble",
  953. node_dungeon_alt = "default:mossycobble",
  954. node_dungeon_stair = "stairs:stair_cobble",
  955. y_max = -256,
  956. y_min = -31000,
  957. heat_point = 25,
  958. humidity_point = 70,
  959. })
  960. -- Snowy grassland
  961. minetest.register_biome({
  962. name = "snowy_grassland",
  963. node_dust = "default:snow",
  964. node_top = "default:dirt_with_snow",
  965. depth_top = 1,
  966. node_filler = "default:dirt",
  967. depth_filler = 1,
  968. node_riverbed = "default:sand",
  969. depth_riverbed = 2,
  970. node_dungeon = "default:cobble",
  971. node_dungeon_alt = "default:mossycobble",
  972. node_dungeon_stair = "stairs:stair_cobble",
  973. y_max = 31000,
  974. y_min = 4,
  975. heat_point = 20,
  976. humidity_point = 35,
  977. })
  978. minetest.register_biome({
  979. name = "snowy_grassland_ocean",
  980. node_dust = "default:snow",
  981. node_top = "default:sand",
  982. depth_top = 1,
  983. node_filler = "default:sand",
  984. depth_filler = 3,
  985. node_riverbed = "default:sand",
  986. depth_riverbed = 2,
  987. node_cave_liquid = "default:water_source",
  988. node_dungeon = "default:cobble",
  989. node_dungeon_alt = "default:mossycobble",
  990. node_dungeon_stair = "stairs:stair_cobble",
  991. vertical_blend = 1,
  992. y_max = 3,
  993. y_min = -255,
  994. heat_point = 20,
  995. humidity_point = 35,
  996. })
  997. minetest.register_biome({
  998. name = "snowy_grassland_under",
  999. node_cave_liquid = {"default:water_source", "default:lava_source"},
  1000. node_dungeon = "default:cobble",
  1001. node_dungeon_alt = "default:mossycobble",
  1002. node_dungeon_stair = "stairs:stair_cobble",
  1003. y_max = -256,
  1004. y_min = -31000,
  1005. heat_point = 20,
  1006. humidity_point = 35,
  1007. })
  1008. -- Grassland
  1009. minetest.register_biome({
  1010. name = "grassland",
  1011. node_top = "default:dirt_with_grass",
  1012. depth_top = 1,
  1013. node_filler = "default:dirt",
  1014. depth_filler = 1,
  1015. node_riverbed = "default:sand",
  1016. depth_riverbed = 2,
  1017. node_dungeon = "default:cobble",
  1018. node_dungeon_alt = "default:mossycobble",
  1019. node_dungeon_stair = "stairs:stair_cobble",
  1020. y_max = 31000,
  1021. y_min = 6,
  1022. heat_point = 50,
  1023. humidity_point = 35,
  1024. })
  1025. minetest.register_biome({
  1026. name = "grassland_dunes",
  1027. node_top = "default:sand",
  1028. depth_top = 1,
  1029. node_filler = "default:sand",
  1030. depth_filler = 2,
  1031. node_riverbed = "default:sand",
  1032. depth_riverbed = 2,
  1033. node_dungeon = "default:cobble",
  1034. node_dungeon_alt = "default:mossycobble",
  1035. node_dungeon_stair = "stairs:stair_cobble",
  1036. vertical_blend = 1,
  1037. y_max = 5,
  1038. y_min = 4,
  1039. heat_point = 50,
  1040. humidity_point = 35,
  1041. })
  1042. minetest.register_biome({
  1043. name = "grassland_ocean",
  1044. node_top = "default:sand",
  1045. depth_top = 1,
  1046. node_filler = "default:sand",
  1047. depth_filler = 3,
  1048. node_riverbed = "default:sand",
  1049. depth_riverbed = 2,
  1050. node_cave_liquid = "default:water_source",
  1051. node_dungeon = "default:cobble",
  1052. node_dungeon_alt = "default:mossycobble",
  1053. node_dungeon_stair = "stairs:stair_cobble",
  1054. y_max = 3,
  1055. y_min = -255,
  1056. heat_point = 50,
  1057. humidity_point = 35,
  1058. })
  1059. minetest.register_biome({
  1060. name = "grassland_under",
  1061. node_cave_liquid = {"default:water_source", "default:lava_source"},
  1062. node_dungeon = "default:cobble",
  1063. node_dungeon_alt = "default:mossycobble",
  1064. node_dungeon_stair = "stairs:stair_cobble",
  1065. y_max = -256,
  1066. y_min = -31000,
  1067. heat_point = 50,
  1068. humidity_point = 35,
  1069. })
  1070. -- Coniferous forest
  1071. minetest.register_biome({
  1072. name = "coniferous_forest",
  1073. node_top = "default:dirt_with_coniferous_litter",
  1074. depth_top = 1,
  1075. node_filler = "default:dirt",
  1076. depth_filler = 3,
  1077. node_riverbed = "default:sand",
  1078. depth_riverbed = 2,
  1079. node_dungeon = "default:cobble",
  1080. node_dungeon_alt = "default:mossycobble",
  1081. node_dungeon_stair = "stairs:stair_cobble",
  1082. y_max = 31000,
  1083. y_min = 6,
  1084. heat_point = 45,
  1085. humidity_point = 70,
  1086. })
  1087. minetest.register_biome({
  1088. name = "coniferous_forest_dunes",
  1089. node_top = "default:sand",
  1090. depth_top = 1,
  1091. node_filler = "default:sand",
  1092. depth_filler = 3,
  1093. node_riverbed = "default:sand",
  1094. depth_riverbed = 2,
  1095. node_dungeon = "default:cobble",
  1096. node_dungeon_alt = "default:mossycobble",
  1097. node_dungeon_stair = "stairs:stair_cobble",
  1098. vertical_blend = 1,
  1099. y_max = 5,
  1100. y_min = 4,
  1101. heat_point = 45,
  1102. humidity_point = 70,
  1103. })
  1104. minetest.register_biome({
  1105. name = "coniferous_forest_ocean",
  1106. node_top = "default:sand",
  1107. depth_top = 1,
  1108. node_filler = "default:sand",
  1109. depth_filler = 3,
  1110. node_riverbed = "default:sand",
  1111. depth_riverbed = 2,
  1112. node_cave_liquid = "default:water_source",
  1113. node_dungeon = "default:cobble",
  1114. node_dungeon_alt = "default:mossycobble",
  1115. node_dungeon_stair = "stairs:stair_cobble",
  1116. y_max = 3,
  1117. y_min = -255,
  1118. heat_point = 45,
  1119. humidity_point = 70,
  1120. })
  1121. minetest.register_biome({
  1122. name = "coniferous_forest_under",
  1123. node_cave_liquid = {"default:water_source", "default:lava_source"},
  1124. node_dungeon = "default:cobble",
  1125. node_dungeon_alt = "default:mossycobble",
  1126. node_dungeon_stair = "stairs:stair_cobble",
  1127. y_max = -256,
  1128. y_min = -31000,
  1129. heat_point = 45,
  1130. humidity_point = 70,
  1131. })
  1132. -- Deciduous forest
  1133. minetest.register_biome({
  1134. name = "deciduous_forest",
  1135. node_top = "default:dirt_with_grass",
  1136. depth_top = 1,
  1137. node_filler = "default:dirt",
  1138. depth_filler = 3,
  1139. node_riverbed = "default:sand",
  1140. depth_riverbed = 2,
  1141. node_dungeon = "default:cobble",
  1142. node_dungeon_alt = "default:mossycobble",
  1143. node_dungeon_stair = "stairs:stair_cobble",
  1144. y_max = 31000,
  1145. y_min = 1,
  1146. heat_point = 60,
  1147. humidity_point = 68,
  1148. })
  1149. minetest.register_biome({
  1150. name = "deciduous_forest_shore",
  1151. node_top = "default:dirt",
  1152. depth_top = 1,
  1153. node_filler = "default:dirt",
  1154. depth_filler = 3,
  1155. node_riverbed = "default:sand",
  1156. depth_riverbed = 2,
  1157. node_dungeon = "default:cobble",
  1158. node_dungeon_alt = "default:mossycobble",
  1159. node_dungeon_stair = "stairs:stair_cobble",
  1160. y_max = 0,
  1161. y_min = -1,
  1162. heat_point = 60,
  1163. humidity_point = 68,
  1164. })
  1165. minetest.register_biome({
  1166. name = "deciduous_forest_ocean",
  1167. node_top = "default:sand",
  1168. depth_top = 1,
  1169. node_filler = "default:sand",
  1170. depth_filler = 3,
  1171. node_riverbed = "default:sand",
  1172. depth_riverbed = 2,
  1173. node_cave_liquid = "default:water_source",
  1174. node_dungeon = "default:cobble",
  1175. node_dungeon_alt = "default:mossycobble",
  1176. node_dungeon_stair = "stairs:stair_cobble",
  1177. vertical_blend = 1,
  1178. y_max = -2,
  1179. y_min = -255,
  1180. heat_point = 60,
  1181. humidity_point = 68,
  1182. })
  1183. minetest.register_biome({
  1184. name = "deciduous_forest_under",
  1185. node_cave_liquid = {"default:water_source", "default:lava_source"},
  1186. node_dungeon = "default:cobble",
  1187. node_dungeon_alt = "default:mossycobble",
  1188. node_dungeon_stair = "stairs:stair_cobble",
  1189. y_max = -256,
  1190. y_min = -31000,
  1191. heat_point = 60,
  1192. humidity_point = 68,
  1193. })
  1194. -- Desert
  1195. minetest.register_biome({
  1196. name = "desert",
  1197. node_top = "default:desert_sand",
  1198. depth_top = 1,
  1199. node_filler = "default:desert_sand",
  1200. depth_filler = 1,
  1201. node_stone = "default:desert_stone",
  1202. node_riverbed = "default:sand",
  1203. depth_riverbed = 2,
  1204. node_dungeon = "default:desert_stone",
  1205. node_dungeon_stair = "stairs:stair_desert_stone",
  1206. y_max = 31000,
  1207. y_min = 4,
  1208. heat_point = 92,
  1209. humidity_point = 16,
  1210. })
  1211. minetest.register_biome({
  1212. name = "desert_ocean",
  1213. node_top = "default:sand",
  1214. depth_top = 1,
  1215. node_filler = "default:sand",
  1216. depth_filler = 3,
  1217. node_stone = "default:desert_stone",
  1218. node_riverbed = "default:sand",
  1219. depth_riverbed = 2,
  1220. node_cave_liquid = "default:water_source",
  1221. node_dungeon = "default:desert_stone",
  1222. node_dungeon_stair = "stairs:stair_desert_stone",
  1223. vertical_blend = 1,
  1224. y_max = 3,
  1225. y_min = -255,
  1226. heat_point = 92,
  1227. humidity_point = 16,
  1228. })
  1229. minetest.register_biome({
  1230. name = "desert_under",
  1231. node_cave_liquid = {"default:water_source", "default:lava_source"},
  1232. node_dungeon = "default:cobble",
  1233. node_dungeon_alt = "default:mossycobble",
  1234. node_dungeon_stair = "stairs:stair_cobble",
  1235. y_max = -256,
  1236. y_min = -31000,
  1237. heat_point = 92,
  1238. humidity_point = 16,
  1239. })
  1240. -- Sandstone desert
  1241. minetest.register_biome({
  1242. name = "sandstone_desert",
  1243. node_top = "default:sand",
  1244. depth_top = 1,
  1245. node_filler = "default:sand",
  1246. depth_filler = 1,
  1247. node_stone = "default:sandstone",
  1248. node_riverbed = "default:sand",
  1249. depth_riverbed = 2,
  1250. node_dungeon = "default:sandstonebrick",
  1251. node_dungeon_stair = "stairs:stair_sandstone_block",
  1252. y_max = 31000,
  1253. y_min = 4,
  1254. heat_point = 60,
  1255. humidity_point = 0,
  1256. })
  1257. minetest.register_biome({
  1258. name = "sandstone_desert_ocean",
  1259. node_top = "default:sand",
  1260. depth_top = 1,
  1261. node_filler = "default:sand",
  1262. depth_filler = 3,
  1263. node_stone = "default:sandstone",
  1264. node_riverbed = "default:sand",
  1265. depth_riverbed = 2,
  1266. node_cave_liquid = "default:water_source",
  1267. node_dungeon = "default:sandstonebrick",
  1268. node_dungeon_stair = "stairs:stair_sandstone_block",
  1269. y_max = 3,
  1270. y_min = -255,
  1271. heat_point = 60,
  1272. humidity_point = 0,
  1273. })
  1274. minetest.register_biome({
  1275. name = "sandstone_desert_under",
  1276. node_cave_liquid = {"default:water_source", "default:lava_source"},
  1277. node_dungeon = "default:cobble",
  1278. node_dungeon_alt = "default:mossycobble",
  1279. node_dungeon_stair = "stairs:stair_cobble",
  1280. y_max = -256,
  1281. y_min = -31000,
  1282. heat_point = 60,
  1283. humidity_point = 0,
  1284. })
  1285. -- Cold desert
  1286. minetest.register_biome({
  1287. name = "cold_desert",
  1288. node_top = "default:silver_sand",
  1289. depth_top = 1,
  1290. node_filler = "default:silver_sand",
  1291. depth_filler = 1,
  1292. node_riverbed = "default:sand",
  1293. depth_riverbed = 2,
  1294. node_dungeon = "default:cobble",
  1295. node_dungeon_alt = "default:mossycobble",
  1296. node_dungeon_stair = "stairs:stair_cobble",
  1297. y_max = 31000,
  1298. y_min = 4,
  1299. heat_point = 40,
  1300. humidity_point = 0,
  1301. })
  1302. minetest.register_biome({
  1303. name = "cold_desert_ocean",
  1304. node_top = "default:sand",
  1305. depth_top = 1,
  1306. node_filler = "default:sand",
  1307. depth_filler = 3,
  1308. node_riverbed = "default:sand",
  1309. depth_riverbed = 2,
  1310. node_cave_liquid = "default:water_source",
  1311. node_dungeon = "default:cobble",
  1312. node_dungeon_alt = "default:mossycobble",
  1313. node_dungeon_stair = "stairs:stair_cobble",
  1314. vertical_blend = 1,
  1315. y_max = 3,
  1316. y_min = -255,
  1317. heat_point = 40,
  1318. humidity_point = 0,
  1319. })
  1320. minetest.register_biome({
  1321. name = "cold_desert_under",
  1322. node_cave_liquid = {"default:water_source", "default:lava_source"},
  1323. node_dungeon = "default:cobble",
  1324. node_dungeon_alt = "default:mossycobble",
  1325. node_dungeon_stair = "stairs:stair_cobble",
  1326. y_max = -256,
  1327. y_min = -31000,
  1328. heat_point = 40,
  1329. humidity_point = 0,
  1330. })
  1331. -- Savanna
  1332. minetest.register_biome({
  1333. name = "savanna",
  1334. node_top = "default:dry_dirt_with_dry_grass",
  1335. depth_top = 1,
  1336. node_filler = "default:dry_dirt",
  1337. depth_filler = 1,
  1338. node_riverbed = "default:sand",
  1339. depth_riverbed = 2,
  1340. node_dungeon = "default:cobble",
  1341. node_dungeon_alt = "default:mossycobble",
  1342. node_dungeon_stair = "stairs:stair_cobble",
  1343. y_max = 31000,
  1344. y_min = 1,
  1345. heat_point = 89,
  1346. humidity_point = 42,
  1347. })
  1348. minetest.register_biome({
  1349. name = "savanna_shore",
  1350. node_top = "default:dry_dirt",
  1351. depth_top = 1,
  1352. node_filler = "default:dry_dirt",
  1353. depth_filler = 3,
  1354. node_riverbed = "default:sand",
  1355. depth_riverbed = 2,
  1356. node_dungeon = "default:cobble",
  1357. node_dungeon_alt = "default:mossycobble",
  1358. node_dungeon_stair = "stairs:stair_cobble",
  1359. y_max = 0,
  1360. y_min = -1,
  1361. heat_point = 89,
  1362. humidity_point = 42,
  1363. })
  1364. minetest.register_biome({
  1365. name = "savanna_ocean",
  1366. node_top = "default:sand",
  1367. depth_top = 1,
  1368. node_filler = "default:sand",
  1369. depth_filler = 3,
  1370. node_riverbed = "default:sand",
  1371. depth_riverbed = 2,
  1372. node_cave_liquid = "default:water_source",
  1373. node_dungeon = "default:cobble",
  1374. node_dungeon_alt = "default:mossycobble",
  1375. node_dungeon_stair = "stairs:stair_cobble",
  1376. vertical_blend = 1,
  1377. y_max = -2,
  1378. y_min = -255,
  1379. heat_point = 89,
  1380. humidity_point = 42,
  1381. })
  1382. minetest.register_biome({
  1383. name = "savanna_under",
  1384. node_cave_liquid = {"default:water_source", "default:lava_source"},
  1385. node_dungeon = "default:cobble",
  1386. node_dungeon_alt = "default:mossycobble",
  1387. node_dungeon_stair = "stairs:stair_cobble",
  1388. y_max = -256,
  1389. y_min = -31000,
  1390. heat_point = 89,
  1391. humidity_point = 42,
  1392. })
  1393. -- Rainforest
  1394. minetest.register_biome({
  1395. name = "rainforest",
  1396. node_top = "default:dirt_with_rainforest_litter",
  1397. depth_top = 1,
  1398. node_filler = "default:dirt",
  1399. depth_filler = 3,
  1400. node_riverbed = "default:sand",
  1401. depth_riverbed = 2,
  1402. node_dungeon = "default:cobble",
  1403. node_dungeon_alt = "default:mossycobble",
  1404. node_dungeon_stair = "stairs:stair_cobble",
  1405. y_max = 31000,
  1406. y_min = 1,
  1407. heat_point = 86,
  1408. humidity_point = 65,
  1409. })
  1410. minetest.register_biome({
  1411. name = "rainforest_swamp",
  1412. node_top = "default:dirt",
  1413. depth_top = 1,
  1414. node_filler = "default:dirt",
  1415. depth_filler = 3,
  1416. node_riverbed = "default:sand",
  1417. depth_riverbed = 2,
  1418. node_dungeon = "default:cobble",
  1419. node_dungeon_alt = "default:mossycobble",
  1420. node_dungeon_stair = "stairs:stair_cobble",
  1421. y_max = 0,
  1422. y_min = -1,
  1423. heat_point = 86,
  1424. humidity_point = 65,
  1425. })
  1426. minetest.register_biome({
  1427. name = "rainforest_ocean",
  1428. node_top = "default:sand",
  1429. depth_top = 1,
  1430. node_filler = "default:sand",
  1431. depth_filler = 3,
  1432. node_riverbed = "default:sand",
  1433. depth_riverbed = 2,
  1434. node_cave_liquid = "default:water_source",
  1435. node_dungeon = "default:cobble",
  1436. node_dungeon_alt = "default:mossycobble",
  1437. node_dungeon_stair = "stairs:stair_cobble",
  1438. vertical_blend = 1,
  1439. y_max = -2,
  1440. y_min = -255,
  1441. heat_point = 86,
  1442. humidity_point = 65,
  1443. })
  1444. minetest.register_biome({
  1445. name = "rainforest_under",
  1446. node_cave_liquid = {"default:water_source", "default:lava_source"},
  1447. node_dungeon = "default:cobble",
  1448. node_dungeon_alt = "default:mossycobble",
  1449. node_dungeon_stair = "stairs:stair_cobble",
  1450. y_max = -256,
  1451. y_min = -31000,
  1452. heat_point = 86,
  1453. humidity_point = 65,
  1454. })
  1455. end
  1456. --
  1457. -- Register decorations
  1458. --
  1459. -- Mgv6
  1460. function default.register_mgv6_decorations()
  1461. -- Papyrus
  1462. minetest.register_decoration({
  1463. name = "default:papyrus",
  1464. deco_type = "simple",
  1465. place_on = {"default:dirt_with_grass"},
  1466. sidelen = 16,
  1467. noise_params = {
  1468. offset = -0.3,
  1469. scale = 0.7,
  1470. spread = {x = 100, y = 100, z = 100},
  1471. seed = 354,
  1472. octaves = 3,
  1473. persist = 0.7
  1474. },
  1475. y_max = 1,
  1476. y_min = 1,
  1477. decoration = "default:papyrus",
  1478. height = 2,
  1479. height_max = 4,
  1480. spawn_by = "default:water_source",
  1481. num_spawn_by = 1,
  1482. })
  1483. -- Cacti
  1484. minetest.register_decoration({
  1485. name = "default:cactus",
  1486. deco_type = "simple",
  1487. place_on = {"default:desert_sand"},
  1488. sidelen = 16,
  1489. noise_params = {
  1490. offset = -0.012,
  1491. scale = 0.024,
  1492. spread = {x = 100, y = 100, z = 100},
  1493. seed = 230,
  1494. octaves = 3,
  1495. persist = 0.6
  1496. },
  1497. y_max = 30,
  1498. y_min = 1,
  1499. decoration = "default:cactus",
  1500. height = 3,
  1501. height_max = 4,
  1502. })
  1503. -- Long grasses
  1504. for length = 1, 5 do
  1505. minetest.register_decoration({
  1506. name = "default:grass_"..length,
  1507. deco_type = "simple",
  1508. place_on = {"default:dirt_with_grass"},
  1509. sidelen = 16,
  1510. noise_params = {
  1511. offset = 0,
  1512. scale = 0.007,
  1513. spread = {x = 100, y = 100, z = 100},
  1514. seed = 329,
  1515. octaves = 3,
  1516. persist = 0.6
  1517. },
  1518. y_max = 30,
  1519. y_min = 1,
  1520. decoration = "default:grass_"..length,
  1521. })
  1522. end
  1523. -- Dry shrubs
  1524. minetest.register_decoration({
  1525. name = "default:dry_shrub",
  1526. deco_type = "simple",
  1527. place_on = {"default:desert_sand", "default:dirt_with_snow"},
  1528. sidelen = 16,
  1529. noise_params = {
  1530. offset = 0,
  1531. scale = 0.035,
  1532. spread = {x = 100, y = 100, z = 100},
  1533. seed = 329,
  1534. octaves = 3,
  1535. persist = 0.6
  1536. },
  1537. y_max = 30,
  1538. y_min = 1,
  1539. decoration = "default:dry_shrub",
  1540. param2 = 4,
  1541. })
  1542. end
  1543. -- All mapgens except mgv6
  1544. local function register_grass_decoration(offset, scale, length)
  1545. minetest.register_decoration({
  1546. name = "default:grass_" .. length,
  1547. deco_type = "simple",
  1548. place_on = {"default:dirt_with_grass"},
  1549. sidelen = 16,
  1550. noise_params = {
  1551. offset = offset,
  1552. scale = scale,
  1553. spread = {x = 200, y = 200, z = 200},
  1554. seed = 329,
  1555. octaves = 3,
  1556. persist = 0.6
  1557. },
  1558. biomes = {"grassland", "deciduous_forest"},
  1559. y_max = 31000,
  1560. y_min = 1,
  1561. decoration = "default:grass_" .. length,
  1562. })
  1563. end
  1564. local function register_dry_grass_decoration(offset, scale, length)
  1565. minetest.register_decoration({
  1566. name = "default:dry_grass_" .. length,
  1567. deco_type = "simple",
  1568. place_on = {"default:dry_dirt_with_dry_grass"},
  1569. sidelen = 16,
  1570. noise_params = {
  1571. offset = offset,
  1572. scale = scale,
  1573. spread = {x = 200, y = 200, z = 200},
  1574. seed = 329,
  1575. octaves = 3,
  1576. persist = 0.6
  1577. },
  1578. biomes = {"savanna"},
  1579. y_max = 31000,
  1580. y_min = 1,
  1581. decoration = "default:dry_grass_" .. length,
  1582. })
  1583. end
  1584. local function register_fern_decoration(seed, length)
  1585. minetest.register_decoration({
  1586. name = "default:fern_" .. length,
  1587. deco_type = "simple",
  1588. place_on = {"default:dirt_with_coniferous_litter"},
  1589. sidelen = 16,
  1590. noise_params = {
  1591. offset = 0,
  1592. scale = 0.2,
  1593. spread = {x = 100, y = 100, z = 100},
  1594. seed = seed,
  1595. octaves = 3,
  1596. persist = 0.7
  1597. },
  1598. biomes = {"coniferous_forest"},
  1599. y_max = 31000,
  1600. y_min = 6,
  1601. decoration = "default:fern_" .. length,
  1602. })
  1603. end
  1604. function default.register_decorations()
  1605. -- Savanna bare dirt patches.
  1606. -- Must come before all savanna decorations that are placed on dry grass.
  1607. -- Noise is similar to long dry grass noise, but scale inverted, to appear
  1608. -- where long dry grass is least dense and shortest.
  1609. minetest.register_decoration({
  1610. deco_type = "simple",
  1611. place_on = {"default:dry_dirt_with_dry_grass"},
  1612. sidelen = 4,
  1613. noise_params = {
  1614. offset = -1.5,
  1615. scale = -1.5,
  1616. spread = {x = 200, y = 200, z = 200},
  1617. seed = 329,
  1618. octaves = 4,
  1619. persist = 1.0
  1620. },
  1621. biomes = {"savanna"},
  1622. y_max = 31000,
  1623. y_min = 1,
  1624. decoration = "default:dry_dirt",
  1625. place_offset_y = -1,
  1626. flags = "force_placement",
  1627. })
  1628. -- Apple tree and log
  1629. minetest.register_decoration({
  1630. name = "default:apple_tree",
  1631. deco_type = "schematic",
  1632. place_on = {"default:dirt_with_grass"},
  1633. sidelen = 16,
  1634. noise_params = {
  1635. offset = 0.024,
  1636. scale = 0.015,
  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_max = 31000,
  1644. y_min = 1,
  1645. schematic = minetest.get_modpath("default") .. "/schematics/apple_tree.mts",
  1646. flags = "place_center_x, place_center_z",
  1647. rotation = "random",
  1648. })
  1649. minetest.register_decoration({
  1650. name = "default:apple_log",
  1651. deco_type = "schematic",
  1652. place_on = {"default:dirt_with_grass"},
  1653. place_offset_y = 1,
  1654. sidelen = 16,
  1655. noise_params = {
  1656. offset = 0.0012,
  1657. scale = 0.0007,
  1658. spread = {x = 250, y = 250, z = 250},
  1659. seed = 2,
  1660. octaves = 3,
  1661. persist = 0.66
  1662. },
  1663. biomes = {"deciduous_forest"},
  1664. y_max = 31000,
  1665. y_min = 1,
  1666. schematic = minetest.get_modpath("default") .. "/schematics/apple_log.mts",
  1667. flags = "place_center_x",
  1668. rotation = "random",
  1669. spawn_by = "default:dirt_with_grass",
  1670. num_spawn_by = 8,
  1671. })
  1672. -- Emergent jungle tree
  1673. -- Due to 32 node height, altitude is limited and prescence depends on chunksize
  1674. local chunksize = tonumber(minetest.get_mapgen_setting("chunksize"))
  1675. if chunksize >= 5 then
  1676. minetest.register_decoration({
  1677. name = "default:emergent_jungle_tree",
  1678. deco_type = "schematic",
  1679. place_on = {"default:dirt_with_rainforest_litter"},
  1680. sidelen = 80,
  1681. noise_params = {
  1682. offset = 0.0,
  1683. scale = 0.0025,
  1684. spread = {x = 250, y = 250, z = 250},
  1685. seed = 2685,
  1686. octaves = 3,
  1687. persist = 0.7
  1688. },
  1689. biomes = {"rainforest"},
  1690. y_max = 32,
  1691. y_min = 1,
  1692. schematic = minetest.get_modpath("default") ..
  1693. "/schematics/emergent_jungle_tree.mts",
  1694. flags = "place_center_x, place_center_z",
  1695. rotation = "random",
  1696. place_offset_y = -4,
  1697. })
  1698. end
  1699. -- Jungle tree and log
  1700. minetest.register_decoration({
  1701. name = "default:jungle_tree",
  1702. deco_type = "schematic",
  1703. place_on = {"default:dirt_with_rainforest_litter"},
  1704. sidelen = 80,
  1705. fill_ratio = 0.1,
  1706. biomes = {"rainforest"},
  1707. y_max = 31000,
  1708. y_min = 1,
  1709. schematic = minetest.get_modpath("default") .. "/schematics/jungle_tree.mts",
  1710. flags = "place_center_x, place_center_z",
  1711. rotation = "random",
  1712. })
  1713. -- Swamp jungle trees
  1714. minetest.register_decoration({
  1715. name = "default:jungle_tree(swamp)",
  1716. deco_type = "schematic",
  1717. place_on = {"default:dirt"},
  1718. sidelen = 16,
  1719. -- Noise tuned to place swamp trees where papyrus is absent
  1720. noise_params = {
  1721. offset = 0.0,
  1722. scale = -0.1,
  1723. spread = {x = 200, y = 200, z = 200},
  1724. seed = 354,
  1725. octaves = 1,
  1726. persist = 0.5
  1727. },
  1728. biomes = {"rainforest_swamp"},
  1729. y_max = 0,
  1730. y_min = -1,
  1731. schematic = minetest.get_modpath("default") .. "/schematics/jungle_tree.mts",
  1732. flags = "place_center_x, place_center_z",
  1733. rotation = "random",
  1734. })
  1735. minetest.register_decoration({
  1736. name = "default:jungle_log",
  1737. deco_type = "schematic",
  1738. place_on = {"default:dirt_with_rainforest_litter"},
  1739. place_offset_y = 1,
  1740. sidelen = 80,
  1741. fill_ratio = 0.005,
  1742. biomes = {"rainforest"},
  1743. y_max = 31000,
  1744. y_min = 1,
  1745. schematic = minetest.get_modpath("default") .. "/schematics/jungle_log.mts",
  1746. flags = "place_center_x",
  1747. rotation = "random",
  1748. spawn_by = "default:dirt_with_rainforest_litter",
  1749. num_spawn_by = 8,
  1750. })
  1751. -- Taiga and temperate coniferous forest pine tree, small pine tree and log
  1752. minetest.register_decoration({
  1753. name = "default:pine_tree",
  1754. deco_type = "schematic",
  1755. place_on = {"default:dirt_with_snow", "default:dirt_with_coniferous_litter"},
  1756. sidelen = 16,
  1757. noise_params = {
  1758. offset = 0.010,
  1759. scale = 0.048,
  1760. spread = {x = 250, y = 250, z = 250},
  1761. seed = 2,
  1762. octaves = 3,
  1763. persist = 0.66
  1764. },
  1765. biomes = {"taiga", "coniferous_forest"},
  1766. y_max = 31000,
  1767. y_min = 4,
  1768. schematic = minetest.get_modpath("default") .. "/schematics/pine_tree.mts",
  1769. flags = "place_center_x, place_center_z",
  1770. })
  1771. minetest.register_decoration({
  1772. name = "default:small_pine_tree",
  1773. deco_type = "schematic",
  1774. place_on = {"default:dirt_with_snow", "default:dirt_with_coniferous_litter"},
  1775. sidelen = 16,
  1776. noise_params = {
  1777. offset = 0.010,
  1778. scale = -0.048,
  1779. spread = {x = 250, y = 250, z = 250},
  1780. seed = 2,
  1781. octaves = 3,
  1782. persist = 0.66
  1783. },
  1784. biomes = {"taiga", "coniferous_forest"},
  1785. y_max = 31000,
  1786. y_min = 4,
  1787. schematic = minetest.get_modpath("default") .. "/schematics/small_pine_tree.mts",
  1788. flags = "place_center_x, place_center_z",
  1789. })
  1790. minetest.register_decoration({
  1791. name = "default:pine_log",
  1792. deco_type = "schematic",
  1793. place_on = {"default:dirt_with_snow", "default:dirt_with_coniferous_litter"},
  1794. place_offset_y = 1,
  1795. sidelen = 80,
  1796. fill_ratio = 0.0018,
  1797. biomes = {"taiga", "coniferous_forest"},
  1798. y_max = 31000,
  1799. y_min = 4,
  1800. schematic = minetest.get_modpath("default") .. "/schematics/pine_log.mts",
  1801. flags = "place_center_x",
  1802. rotation = "random",
  1803. spawn_by = {"default:dirt_with_snow", "default:dirt_with_coniferous_litter"},
  1804. num_spawn_by = 8,
  1805. })
  1806. -- Acacia tree and log
  1807. minetest.register_decoration({
  1808. name = "default:acacia_tree",
  1809. deco_type = "schematic",
  1810. place_on = {"default:dry_dirt_with_dry_grass"},
  1811. sidelen = 16,
  1812. noise_params = {
  1813. offset = 0,
  1814. scale = 0.002,
  1815. spread = {x = 250, y = 250, z = 250},
  1816. seed = 2,
  1817. octaves = 3,
  1818. persist = 0.66
  1819. },
  1820. biomes = {"savanna"},
  1821. y_max = 31000,
  1822. y_min = 1,
  1823. schematic = minetest.get_modpath("default") .. "/schematics/acacia_tree.mts",
  1824. flags = "place_center_x, place_center_z",
  1825. rotation = "random",
  1826. })
  1827. minetest.register_decoration({
  1828. name = "default:acacia_log",
  1829. deco_type = "schematic",
  1830. place_on = {"default:dry_dirt_with_dry_grass"},
  1831. place_offset_y = 1,
  1832. sidelen = 16,
  1833. noise_params = {
  1834. offset = 0,
  1835. scale = 0.001,
  1836. spread = {x = 250, y = 250, z = 250},
  1837. seed = 2,
  1838. octaves = 3,
  1839. persist = 0.66
  1840. },
  1841. biomes = {"savanna"},
  1842. y_max = 31000,
  1843. y_min = 1,
  1844. schematic = minetest.get_modpath("default") .. "/schematics/acacia_log.mts",
  1845. flags = "place_center_x",
  1846. rotation = "random",
  1847. spawn_by = "default:dry_dirt_with_dry_grass",
  1848. num_spawn_by = 8,
  1849. })
  1850. -- Aspen tree and log
  1851. minetest.register_decoration({
  1852. name = "default:aspen_tree",
  1853. deco_type = "schematic",
  1854. place_on = {"default:dirt_with_grass"},
  1855. sidelen = 16,
  1856. noise_params = {
  1857. offset = 0.0,
  1858. scale = -0.015,
  1859. spread = {x = 250, y = 250, z = 250},
  1860. seed = 2,
  1861. octaves = 3,
  1862. persist = 0.66
  1863. },
  1864. biomes = {"deciduous_forest"},
  1865. y_max = 31000,
  1866. y_min = 1,
  1867. schematic = minetest.get_modpath("default") .. "/schematics/aspen_tree.mts",
  1868. flags = "place_center_x, place_center_z",
  1869. })
  1870. minetest.register_decoration({
  1871. name = "default:aspen_log",
  1872. deco_type = "schematic",
  1873. place_on = {"default:dirt_with_grass"},
  1874. place_offset_y = 1,
  1875. sidelen = 16,
  1876. noise_params = {
  1877. offset = 0.0,
  1878. scale = -0.0008,
  1879. spread = {x = 250, y = 250, z = 250},
  1880. seed = 2,
  1881. octaves = 3,
  1882. persist = 0.66
  1883. },
  1884. biomes = {"deciduous_forest"},
  1885. y_max = 31000,
  1886. y_min = 1,
  1887. schematic = minetest.get_modpath("default") .. "/schematics/aspen_log.mts",
  1888. flags = "place_center_x",
  1889. rotation = "random",
  1890. spawn_by = "default:dirt_with_grass",
  1891. num_spawn_by = 8,
  1892. })
  1893. -- Large cactus
  1894. minetest.register_decoration({
  1895. name = "default:large_cactus",
  1896. deco_type = "schematic",
  1897. place_on = {"default:desert_sand"},
  1898. sidelen = 16,
  1899. noise_params = {
  1900. offset = -0.0003,
  1901. scale = 0.0009,
  1902. spread = {x = 200, y = 200, z = 200},
  1903. seed = 230,
  1904. octaves = 3,
  1905. persist = 0.6
  1906. },
  1907. biomes = {"desert"},
  1908. y_max = 31000,
  1909. y_min = 4,
  1910. schematic = minetest.get_modpath("default") .. "/schematics/large_cactus.mts",
  1911. flags = "place_center_x, place_center_z",
  1912. rotation = "random",
  1913. })
  1914. -- Cactus
  1915. minetest.register_decoration({
  1916. name = "default:cactus",
  1917. deco_type = "simple",
  1918. place_on = {"default:desert_sand"},
  1919. sidelen = 16,
  1920. noise_params = {
  1921. offset = -0.0003,
  1922. scale = 0.0009,
  1923. spread = {x = 200, y = 200, z = 200},
  1924. seed = 230,
  1925. octaves = 3,
  1926. persist = 0.6
  1927. },
  1928. biomes = {"desert"},
  1929. y_max = 31000,
  1930. y_min = 4,
  1931. decoration = "default:cactus",
  1932. height = 2,
  1933. height_max = 5,
  1934. })
  1935. -- Papyrus
  1936. -- Dirt version for rainforest swamp
  1937. minetest.register_decoration({
  1938. name = "default:papyrus_on_dirt",
  1939. deco_type = "schematic",
  1940. place_on = {"default:dirt"},
  1941. sidelen = 16,
  1942. noise_params = {
  1943. offset = -0.3,
  1944. scale = 0.7,
  1945. spread = {x = 200, y = 200, z = 200},
  1946. seed = 354,
  1947. octaves = 3,
  1948. persist = 0.7
  1949. },
  1950. biomes = {"rainforest_swamp"},
  1951. y_max = 0,
  1952. y_min = 0,
  1953. schematic = minetest.get_modpath("default") .. "/schematics/papyrus_on_dirt.mts",
  1954. })
  1955. -- Dry dirt version for savanna shore
  1956. minetest.register_decoration({
  1957. name = "default:papyrus_on_dry_dirt",
  1958. deco_type = "schematic",
  1959. place_on = {"default:dry_dirt"},
  1960. sidelen = 16,
  1961. noise_params = {
  1962. offset = -0.3,
  1963. scale = 0.7,
  1964. spread = {x = 200, y = 200, z = 200},
  1965. seed = 354,
  1966. octaves = 3,
  1967. persist = 0.7
  1968. },
  1969. biomes = {"savanna_shore"},
  1970. y_max = 0,
  1971. y_min = 0,
  1972. schematic = minetest.get_modpath("default") ..
  1973. "/schematics/papyrus_on_dry_dirt.mts",
  1974. })
  1975. -- Bush
  1976. minetest.register_decoration({
  1977. name = "default:bush",
  1978. deco_type = "schematic",
  1979. place_on = {"default:dirt_with_grass"},
  1980. sidelen = 16,
  1981. noise_params = {
  1982. offset = -0.004,
  1983. scale = 0.01,
  1984. spread = {x = 100, y = 100, z = 100},
  1985. seed = 137,
  1986. octaves = 3,
  1987. persist = 0.7,
  1988. },
  1989. biomes = {"grassland", "deciduous_forest"},
  1990. y_max = 31000,
  1991. y_min = 1,
  1992. schematic = minetest.get_modpath("default") .. "/schematics/bush.mts",
  1993. flags = "place_center_x, place_center_z",
  1994. })
  1995. -- Blueberry bush
  1996. minetest.register_decoration({
  1997. name = "default:blueberry_bush",
  1998. deco_type = "schematic",
  1999. place_on = {"default:dirt_with_grass", "default:dirt_with_snow"},
  2000. sidelen = 16,
  2001. noise_params = {
  2002. offset = -0.004,
  2003. scale = 0.01,
  2004. spread = {x = 100, y = 100, z = 100},
  2005. seed = 697,
  2006. octaves = 3,
  2007. persist = 0.7,
  2008. },
  2009. biomes = {"grassland", "snowy_grassland"},
  2010. y_max = 31000,
  2011. y_min = 1,
  2012. place_offset_y = 1,
  2013. schematic = minetest.get_modpath("default") .. "/schematics/blueberry_bush.mts",
  2014. flags = "place_center_x, place_center_z",
  2015. })
  2016. -- Acacia bush
  2017. minetest.register_decoration({
  2018. name = "default:acacia_bush",
  2019. deco_type = "schematic",
  2020. place_on = {"default:dry_dirt_with_dry_grass"},
  2021. sidelen = 16,
  2022. noise_params = {
  2023. offset = -0.004,
  2024. scale = 0.01,
  2025. spread = {x = 100, y = 100, z = 100},
  2026. seed = 90155,
  2027. octaves = 3,
  2028. persist = 0.7,
  2029. },
  2030. biomes = {"savanna"},
  2031. y_max = 31000,
  2032. y_min = 1,
  2033. schematic = minetest.get_modpath("default") .. "/schematics/acacia_bush.mts",
  2034. flags = "place_center_x, place_center_z",
  2035. })
  2036. -- Pine bush
  2037. minetest.register_decoration({
  2038. name = "default:pine_bush",
  2039. deco_type = "schematic",
  2040. place_on = {"default:dirt_with_snow"},
  2041. sidelen = 16,
  2042. noise_params = {
  2043. offset = -0.004,
  2044. scale = 0.01,
  2045. spread = {x = 100, y = 100, z = 100},
  2046. seed = 137,
  2047. octaves = 3,
  2048. persist = 0.7,
  2049. },
  2050. biomes = {"taiga", "snowy_grassland"},
  2051. y_max = 31000,
  2052. y_min = 4,
  2053. schematic = minetest.get_modpath("default") .. "/schematics/pine_bush.mts",
  2054. flags = "place_center_x, place_center_z",
  2055. })
  2056. -- Grasses
  2057. register_grass_decoration(-0.03, 0.09, 5)
  2058. register_grass_decoration(-0.015, 0.075, 4)
  2059. register_grass_decoration(0, 0.06, 3)
  2060. register_grass_decoration(0.015, 0.045, 2)
  2061. register_grass_decoration(0.03, 0.03, 1)
  2062. -- Dry grasses
  2063. register_dry_grass_decoration(0.01, 0.05, 5)
  2064. register_dry_grass_decoration(0.03, 0.03, 4)
  2065. register_dry_grass_decoration(0.05, 0.01, 3)
  2066. register_dry_grass_decoration(0.07, -0.01, 2)
  2067. register_dry_grass_decoration(0.09, -0.03, 1)
  2068. -- Ferns
  2069. register_fern_decoration(14936, 3)
  2070. register_fern_decoration(801, 2)
  2071. register_fern_decoration(5, 1)
  2072. -- Junglegrass
  2073. minetest.register_decoration({
  2074. name = "default:junglegrass",
  2075. deco_type = "simple",
  2076. place_on = {"default:dirt_with_rainforest_litter"},
  2077. sidelen = 80,
  2078. fill_ratio = 0.1,
  2079. biomes = {"rainforest"},
  2080. y_max = 31000,
  2081. y_min = 1,
  2082. decoration = "default:junglegrass",
  2083. })
  2084. -- Dry shrub
  2085. minetest.register_decoration({
  2086. name = "default:dry_shrub",
  2087. deco_type = "simple",
  2088. place_on = {"default:desert_sand",
  2089. "default:sand", "default:silver_sand"},
  2090. sidelen = 16,
  2091. noise_params = {
  2092. offset = 0,
  2093. scale = 0.02,
  2094. spread = {x = 200, y = 200, z = 200},
  2095. seed = 329,
  2096. octaves = 3,
  2097. persist = 0.6
  2098. },
  2099. biomes = {"desert", "sandstone_desert", "cold_desert"},
  2100. y_max = 31000,
  2101. y_min = 2,
  2102. decoration = "default:dry_shrub",
  2103. param2 = 4,
  2104. })
  2105. -- Marram grass
  2106. minetest.register_decoration({
  2107. name = "default:marram_grass",
  2108. deco_type = "simple",
  2109. place_on = {"default:sand"},
  2110. sidelen = 4,
  2111. noise_params = {
  2112. offset = -0.7,
  2113. scale = 4.0,
  2114. spread = {x = 16, y = 16, z = 16},
  2115. seed = 513337,
  2116. octaves = 1,
  2117. persist = 0.0,
  2118. flags = "absvalue, eased"
  2119. },
  2120. biomes = {"coniferous_forest_dunes", "grassland_dunes"},
  2121. y_max = 6,
  2122. y_min = 4,
  2123. decoration = {
  2124. "default:marram_grass_1",
  2125. "default:marram_grass_2",
  2126. "default:marram_grass_3",
  2127. },
  2128. })
  2129. -- Tundra moss
  2130. minetest.register_decoration({
  2131. deco_type = "simple",
  2132. place_on = {"default:permafrost_with_stones"},
  2133. sidelen = 4,
  2134. noise_params = {
  2135. offset = -0.8,
  2136. scale = 2.0,
  2137. spread = {x = 100, y = 100, z = 100},
  2138. seed = 53995,
  2139. octaves = 3,
  2140. persist = 1.0
  2141. },
  2142. biomes = {"tundra"},
  2143. y_max = 50,
  2144. y_min = 2,
  2145. decoration = "default:permafrost_with_moss",
  2146. place_offset_y = -1,
  2147. flags = "force_placement",
  2148. })
  2149. -- Tundra patchy snow
  2150. minetest.register_decoration({
  2151. deco_type = "simple",
  2152. place_on = {
  2153. "default:permafrost_with_moss",
  2154. "default:permafrost_with_stones",
  2155. "default:stone",
  2156. "default:gravel"
  2157. },
  2158. sidelen = 4,
  2159. noise_params = {
  2160. offset = 0,
  2161. scale = 1.0,
  2162. spread = {x = 100, y = 100, z = 100},
  2163. seed = 172555,
  2164. octaves = 3,
  2165. persist = 1.0
  2166. },
  2167. biomes = {"tundra", "tundra_beach"},
  2168. y_max = 50,
  2169. y_min = 1,
  2170. decoration = "default:snow",
  2171. })
  2172. -- Coral reef
  2173. minetest.register_decoration({
  2174. name = "default:corals",
  2175. deco_type = "simple",
  2176. place_on = {"default:sand"},
  2177. place_offset_y = -1,
  2178. sidelen = 4,
  2179. noise_params = {
  2180. offset = -4,
  2181. scale = 4,
  2182. spread = {x = 50, y = 50, z = 50},
  2183. seed = 7013,
  2184. octaves = 3,
  2185. persist = 0.7,
  2186. },
  2187. biomes = {
  2188. "desert_ocean",
  2189. "savanna_ocean",
  2190. "rainforest_ocean",
  2191. },
  2192. y_max = -2,
  2193. y_min = -8,
  2194. flags = "force_placement",
  2195. decoration = {
  2196. "default:coral_green", "default:coral_pink",
  2197. "default:coral_cyan", "default:coral_brown",
  2198. "default:coral_orange", "default:coral_skeleton",
  2199. },
  2200. })
  2201. -- Kelp
  2202. minetest.register_decoration({
  2203. name = "default:kelp",
  2204. deco_type = "simple",
  2205. place_on = {"default:sand"},
  2206. place_offset_y = -1,
  2207. sidelen = 16,
  2208. noise_params = {
  2209. offset = -0.04,
  2210. scale = 0.1,
  2211. spread = {x = 200, y = 200, z = 200},
  2212. seed = 87112,
  2213. octaves = 3,
  2214. persist = 0.7
  2215. },
  2216. biomes = {
  2217. "taiga_ocean",
  2218. "snowy_grassland_ocean",
  2219. "grassland_ocean",
  2220. "coniferous_forest_ocean",
  2221. "deciduous_forest_ocean",
  2222. "sandstone_desert_ocean",
  2223. "cold_desert_ocean"},
  2224. y_max = -5,
  2225. y_min = -10,
  2226. flags = "force_placement",
  2227. decoration = "default:sand_with_kelp",
  2228. param2 = 48,
  2229. param2_max = 96,
  2230. })
  2231. end
  2232. --
  2233. -- Detect mapgen to select functions
  2234. --
  2235. local mg_name = minetest.get_mapgen_setting("mg_name")
  2236. if mg_name == "v6" then
  2237. default.register_mgv6_ores()
  2238. default.register_mgv6_decorations()
  2239. else
  2240. default.register_biomes()
  2241. default.register_ores()
  2242. default.register_decorations()
  2243. end