mapgen.lua 57 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470
  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. -- Reed
  1462. minetest.register_decoration({
  1463. name = "default:reed",
  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:reed",
  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 reed 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. -- Reed
  1936. -- Dirt version for rainforest swamp
  1937. minetest.register_decoration({
  1938. name = "default:reed_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/reed_on_dirt.mts",
  1954. })
  1955. -- Dry dirt version for savanna shore
  1956. minetest.register_decoration({
  1957. name = "default:reed_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/reed_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. -- Acacia bush
  1996. minetest.register_decoration({
  1997. name = "default:acacia_bush",
  1998. deco_type = "schematic",
  1999. place_on = {"default:dry_dirt_with_dry_grass"},
  2000. sidelen = 16,
  2001. noise_params = {
  2002. offset = -0.004,
  2003. scale = 0.01,
  2004. spread = {x = 100, y = 100, z = 100},
  2005. seed = 90155,
  2006. octaves = 3,
  2007. persist = 0.7,
  2008. },
  2009. biomes = {"savanna"},
  2010. y_max = 31000,
  2011. y_min = 1,
  2012. schematic = minetest.get_modpath("default") .. "/schematics/acacia_bush.mts",
  2013. flags = "place_center_x, place_center_z",
  2014. })
  2015. -- Pine bush
  2016. minetest.register_decoration({
  2017. name = "default:pine_bush",
  2018. deco_type = "schematic",
  2019. place_on = {"default:dirt_with_snow"},
  2020. sidelen = 16,
  2021. noise_params = {
  2022. offset = -0.004,
  2023. scale = 0.01,
  2024. spread = {x = 100, y = 100, z = 100},
  2025. seed = 137,
  2026. octaves = 3,
  2027. persist = 0.7,
  2028. },
  2029. biomes = {"taiga", "snowy_grassland"},
  2030. y_max = 31000,
  2031. y_min = 4,
  2032. schematic = minetest.get_modpath("default") .. "/schematics/pine_bush.mts",
  2033. flags = "place_center_x, place_center_z",
  2034. })
  2035. -- Grasses
  2036. register_grass_decoration(-0.03, 0.09, 5)
  2037. register_grass_decoration(-0.015, 0.075, 4)
  2038. register_grass_decoration(0, 0.06, 3)
  2039. register_grass_decoration(0.015, 0.045, 2)
  2040. register_grass_decoration(0.03, 0.03, 1)
  2041. -- Dry grasses
  2042. register_dry_grass_decoration(0.01, 0.05, 5)
  2043. register_dry_grass_decoration(0.03, 0.03, 4)
  2044. register_dry_grass_decoration(0.05, 0.01, 3)
  2045. register_dry_grass_decoration(0.07, -0.01, 2)
  2046. register_dry_grass_decoration(0.09, -0.03, 1)
  2047. -- Ferns
  2048. register_fern_decoration(14936, 3)
  2049. register_fern_decoration(801, 2)
  2050. register_fern_decoration(5, 1)
  2051. -- Junglegrass
  2052. minetest.register_decoration({
  2053. name = "default:junglegrass",
  2054. deco_type = "simple",
  2055. place_on = {"default:dirt_with_rainforest_litter"},
  2056. sidelen = 80,
  2057. fill_ratio = 0.1,
  2058. biomes = {"rainforest"},
  2059. y_max = 31000,
  2060. y_min = 1,
  2061. decoration = "default:junglegrass",
  2062. })
  2063. -- Dry shrub
  2064. minetest.register_decoration({
  2065. name = "default:dry_shrub",
  2066. deco_type = "simple",
  2067. place_on = {"default:desert_sand",
  2068. "default:sand", "default:silver_sand"},
  2069. sidelen = 16,
  2070. noise_params = {
  2071. offset = 0,
  2072. scale = 0.02,
  2073. spread = {x = 200, y = 200, z = 200},
  2074. seed = 329,
  2075. octaves = 3,
  2076. persist = 0.6
  2077. },
  2078. biomes = {"desert", "sandstone_desert", "cold_desert"},
  2079. y_max = 31000,
  2080. y_min = 2,
  2081. decoration = "default:dry_shrub",
  2082. param2 = 4,
  2083. })
  2084. -- Marram grass
  2085. minetest.register_decoration({
  2086. name = "default:marram_grass",
  2087. deco_type = "simple",
  2088. place_on = {"default:sand"},
  2089. sidelen = 4,
  2090. noise_params = {
  2091. offset = -0.7,
  2092. scale = 4.0,
  2093. spread = {x = 16, y = 16, z = 16},
  2094. seed = 513337,
  2095. octaves = 1,
  2096. persist = 0.0,
  2097. flags = "absvalue, eased"
  2098. },
  2099. biomes = {"coniferous_forest_dunes", "grassland_dunes"},
  2100. y_max = 6,
  2101. y_min = 4,
  2102. decoration = {
  2103. "default:marram_grass_1",
  2104. "default:marram_grass_2",
  2105. "default:marram_grass_3",
  2106. },
  2107. })
  2108. -- Tundra moss
  2109. minetest.register_decoration({
  2110. deco_type = "simple",
  2111. place_on = {"default:permafrost_with_stones"},
  2112. sidelen = 4,
  2113. noise_params = {
  2114. offset = -0.8,
  2115. scale = 2.0,
  2116. spread = {x = 100, y = 100, z = 100},
  2117. seed = 53995,
  2118. octaves = 3,
  2119. persist = 1.0
  2120. },
  2121. biomes = {"tundra"},
  2122. y_max = 50,
  2123. y_min = 2,
  2124. decoration = "default:permafrost_with_moss",
  2125. place_offset_y = -1,
  2126. flags = "force_placement",
  2127. })
  2128. -- Tundra patchy snow
  2129. minetest.register_decoration({
  2130. deco_type = "simple",
  2131. place_on = {
  2132. "default:permafrost_with_moss",
  2133. "default:permafrost_with_stones",
  2134. "default:stone",
  2135. "default:gravel"
  2136. },
  2137. sidelen = 4,
  2138. noise_params = {
  2139. offset = 0,
  2140. scale = 1.0,
  2141. spread = {x = 100, y = 100, z = 100},
  2142. seed = 172555,
  2143. octaves = 3,
  2144. persist = 1.0
  2145. },
  2146. biomes = {"tundra", "tundra_beach"},
  2147. y_max = 50,
  2148. y_min = 1,
  2149. decoration = "default:snow",
  2150. })
  2151. -- Coral reef
  2152. minetest.register_decoration({
  2153. name = "default:corals",
  2154. deco_type = "simple",
  2155. place_on = {"default:sand"},
  2156. place_offset_y = -1,
  2157. sidelen = 4,
  2158. noise_params = {
  2159. offset = -4,
  2160. scale = 4,
  2161. spread = {x = 50, y = 50, z = 50},
  2162. seed = 7013,
  2163. octaves = 3,
  2164. persist = 0.7,
  2165. },
  2166. biomes = {
  2167. "desert_ocean",
  2168. "savanna_ocean",
  2169. "rainforest_ocean",
  2170. },
  2171. y_max = -2,
  2172. y_min = -8,
  2173. flags = "force_placement",
  2174. decoration = {
  2175. "default:coral_green", "default:coral_pink",
  2176. "default:coral_cyan", "default:coral_brown",
  2177. "default:coral_orange", "default:coral_skeleton",
  2178. },
  2179. })
  2180. -- Kelp
  2181. minetest.register_decoration({
  2182. name = "default:kelp",
  2183. deco_type = "simple",
  2184. place_on = {"default:sand"},
  2185. place_offset_y = -1,
  2186. sidelen = 16,
  2187. noise_params = {
  2188. offset = -0.04,
  2189. scale = 0.1,
  2190. spread = {x = 200, y = 200, z = 200},
  2191. seed = 87112,
  2192. octaves = 3,
  2193. persist = 0.7
  2194. },
  2195. biomes = {
  2196. "taiga_ocean",
  2197. "snowy_grassland_ocean",
  2198. "grassland_ocean",
  2199. "coniferous_forest_ocean",
  2200. "deciduous_forest_ocean",
  2201. "sandstone_desert_ocean",
  2202. "cold_desert_ocean"},
  2203. y_max = -5,
  2204. y_min = -10,
  2205. flags = "force_placement",
  2206. decoration = "default:sand_with_kelp",
  2207. param2 = 48,
  2208. param2_max = 96,
  2209. })
  2210. end
  2211. --
  2212. -- Detect mapgen to select functions
  2213. --
  2214. minetest.clear_registered_biomes()
  2215. minetest.clear_registered_ores()
  2216. minetest.clear_registered_decorations()
  2217. local mg_name = minetest.get_mapgen_setting("mg_name")
  2218. if mg_name == "v6" then
  2219. default.register_mgv6_ores()
  2220. default.register_mgv6_decorations()
  2221. else
  2222. default.register_biomes()
  2223. default.register_ores()
  2224. default.register_decorations()
  2225. end