mapgen.lua 57 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493
  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. minetest.clear_registered_biomes()
  2236. minetest.clear_registered_ores()
  2237. minetest.clear_registered_decorations()
  2238. local mg_name = minetest.get_mapgen_setting("mg_name")
  2239. if mg_name == "v6" then
  2240. default.register_mgv6_ores()
  2241. default.register_mgv6_decorations()
  2242. else
  2243. default.register_biomes()
  2244. default.register_ores()
  2245. default.register_decorations()
  2246. end