mapgen.lua 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206
  1. -- clear default mapgen biomes, decorations and ores
  2. minetest.clear_registered_biomes()
  3. minetest.clear_registered_decorations()
  4. --minetest.clear_registered_ores()
  5. local path = minetest.get_modpath("ethereal")
  6. dofile(path .. "/ores.lua")
  7. path = path .. "/schematics/"
  8. local dpath = minetest.get_modpath("default") .. "/schematics/"
  9. -- tree schematics
  10. dofile(path .. "orange_tree.lua")
  11. dofile(path .. "banana_tree.lua")
  12. dofile(path .. "bamboo_tree.lua")
  13. dofile(path .. "birch_tree.lua")
  14. dofile(path .. "bush.lua")
  15. dofile(path .. "waterlily.lua")
  16. dofile(path .. "volcanom.lua")
  17. dofile(path .. "volcanol.lua")
  18. dofile(path .. "frosttrees.lua")
  19. dofile(path .. "palmtree.lua")
  20. dofile(path .. "pinetree.lua")
  21. dofile(path .. "yellowtree.lua")
  22. dofile(path .. "mushroomone.lua")
  23. dofile(path .. "willow.lua")
  24. dofile(path .. "bigtree.lua")
  25. dofile(path .. "redwood_tree.lua")
  26. dofile(path .. "vinetree.lua")
  27. dofile(path .. "sakura.lua")
  28. dofile(path .. "igloo.lua")
  29. --= Biomes
  30. local add_biome = function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)
  31. if p ~= 1 then return end
  32. minetest.register_biome({
  33. name = a,
  34. node_dust = b,
  35. node_top = c,
  36. depth_top = d,
  37. node_filler = e,
  38. depth_filler = f,
  39. node_stone = g,
  40. node_water_top = h,
  41. depth_water_top = i,
  42. node_water = j,
  43. node_river_water = k,
  44. y_min = l,
  45. y_max = m,
  46. heat_point = n,
  47. humidity_point = o,
  48. })
  49. end
  50. add_biome("underground", nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
  51. -31000, -192, 50, 50, 1)
  52. add_biome("mountain", nil, "default:snow", 1, "default:snowblock", 2,
  53. nil, nil, nil, nil, nil, 140, 31000, 50, 50, 1)
  54. add_biome("desert", nil, "default:desert_sand", 1, "default:desert_sand", 3,
  55. "default:desert_stone", nil, nil, nil, nil, 3, 23, 35, 20, ethereal.desert)
  56. add_biome("desert_ocean", nil, "default:sand", 1, "default:sand", 2,
  57. "default:desert_stone", nil, nil, nil, nil, -192, 3, 35, 20, ethereal.desert)
  58. if ethereal.glacier == 1 then
  59. minetest.register_biome({
  60. name = "glacier",
  61. node_dust = "default:snowblock",
  62. node_top = "default:snowblock",
  63. depth_top = 1,
  64. node_filler = "default:snowblock",
  65. depth_filler = 3,
  66. node_stone = "default:ice",
  67. node_water_top = "default:ice",
  68. depth_water_top = 10,
  69. --node_water = "",
  70. node_river_water = "default:ice",
  71. node_riverbed = "default:gravel",
  72. depth_riverbed = 2,
  73. y_min = -8,
  74. y_max = 31000,
  75. heat_point = 0,
  76. humidity_point = 50,
  77. })
  78. minetest.register_biome({
  79. name = "glacier_ocean",
  80. node_dust = "default:snowblock",
  81. node_top = "default:sand",
  82. depth_top = 1,
  83. node_filler = "default:sand",
  84. depth_filler = 3,
  85. --node_stone = "",
  86. --node_water_top = "",
  87. --depth_water_top = ,
  88. --node_water = "",
  89. --node_river_water = "",
  90. y_min = -112,
  91. y_max = -9,
  92. heat_point = 0,
  93. humidity_point = 50,
  94. })
  95. end
  96. add_biome("clearing", nil, "default:dirt_with_grass", 1, "default:dirt", 3,
  97. nil, nil, nil, nil, nil, 3, 71, 45, 65, 1) -- ADDED
  98. add_biome("bamboo", nil, "ethereal:bamboo_dirt", 1, "default:dirt", 3,
  99. nil, nil, nil, nil, nil, 25, 70, 45, 75, ethereal.bamboo)
  100. --add_biome("bamboo_ocean", nil, "default:sand", 1, "default:sand", 2,
  101. --nil, nil, nil, nil, nil, -192, 2, 45, 75, ethereal.bamboo)
  102. add_biome("sakura", nil, "ethereal:bamboo_dirt", 1, "default:dirt", 3,
  103. nil, nil, nil, nil, nil, 3, 25, 45, 75, ethereal.sakura)
  104. add_biome("sakura_ocean", nil, "default:sand", 1, "default:sand", 2,
  105. nil, nil, nil, nil, nil, -192, 2, 45, 75, ethereal.sakura)
  106. add_biome("mesa", nil, "default:dirt_with_dry_grass", 1, "bakedclay:orange", 15,
  107. nil, nil, nil, nil, nil, 1, 71, 25, 28, ethereal.mesa)
  108. add_biome("mesa_ocean", nil, "default:sand", 1, "default:sand", 2,
  109. nil, nil, nil, nil, nil, -192, 1, 25, 28, ethereal.mesa)
  110. add_biome("alpine", nil, "default:dirt_with_snow", 1, "default:dirt", 2,
  111. nil, nil, nil, nil, nil, 40, 140, 10, 40, ethereal.alpine)
  112. if minetest.registered_nodes["default:dirt_with_coniferous_litter"] then
  113. add_biome("snowy", nil, "default:dirt_with_coniferous_litter", 1, "default:dirt",
  114. 2, nil, nil, nil, nil, nil, 4, 40, 10, 40, ethereal.snowy)
  115. else
  116. add_biome("snowy", nil, "ethereal:cold_dirt", 1, "default:dirt", 2,
  117. nil, nil, nil, nil, nil, 4, 40, 10, 40, ethereal.snowy)
  118. end
  119. add_biome("frost", nil, "ethereal:crystal_dirt", 1, "default:dirt", 3,
  120. nil, nil, nil, nil, nil, 1, 71, 10, 40, ethereal.frost)
  121. add_biome("frost_ocean", nil, "default:sand", 1, "default:sand", 2,
  122. nil, nil, nil, nil, nil, -192, 1, 10, 40, ethereal.frost)
  123. add_biome("grassy", nil, "default:dirt_with_grass", 1, "default:dirt", 3,
  124. nil, nil, nil, nil, nil, 3, 91, 13, 40, ethereal.grassy)
  125. add_biome("grassy_ocean", nil, "defaut:sand", 2, "default:gravel", 1,
  126. nil, nil, nil, nil, nil, -31000, 3, 13, 40, ethereal.grassy)
  127. add_biome("caves", nil, "default:desert_stone", 3, "air", 8,
  128. nil, nil, nil, nil, nil, 4, 41, 15, 25, ethereal.caves)
  129. add_biome("grayness", nil, "ethereal:gray_dirt", 1, "default:dirt", 3,
  130. nil, nil, nil, nil, nil, 2, 41, 15, 30, ethereal.grayness)
  131. if minetest.registered_nodes["default:silver_sand"] then
  132. add_biome("grayness_ocean", nil, "default:silver_sand", 2, "default:sand", 2,
  133. nil, nil, nil, nil, nil, -192, 1, 15, 30, ethereal.grayness)
  134. else
  135. add_biome("grayness_ocean", nil, "default:sand", 1, "default:sand", 2,
  136. nil, nil, nil, nil, nil, -192, 1, 15, 30, ethereal.grayness)
  137. end
  138. add_biome("grassytwo", nil, "default:dirt_with_grass", 1, "default:dirt", 3,
  139. nil, nil, nil, nil, nil, 1, 91, 15, 40, ethereal.grassytwo)
  140. add_biome("grassytwo_ocean", nil, "default:sand", 1, "default:sand", 2,
  141. nil, nil, nil, nil, nil, -192, 1, 15, 40, ethereal.grassytwo)
  142. add_biome("prairie", nil, "ethereal:prairie_dirt", 1, "default:dirt", 3,
  143. nil, nil, nil, nil, nil, 3, 26, 20, 40, ethereal.prairie)
  144. add_biome("prairie_ocean", nil, "default:sand", 1, "default:sand", 2,
  145. nil, nil, nil, nil, nil, -192, 1, 20, 40, ethereal.prairie)
  146. add_biome("jumble", nil, "default:dirt_with_grass", 1, "default:dirt", 3,
  147. nil, nil, nil, nil, nil, 1, 71, 25, 50, ethereal.jumble)
  148. add_biome("jumble_ocean", nil, "default:sand", 1, "default:sand", 2,
  149. nil, nil, nil, nil, nil, -192, 1, 25, 50, ethereal.jumble)
  150. if minetest.registered_nodes["default:dirt_with_rainforest_litter"] then
  151. add_biome("junglee", nil, "default:dirt_with_rainforest_litter", 1, "default:dirt", 3,
  152. nil, nil, nil, nil, nil, 1, 71, 30, 60, ethereal.junglee)
  153. else
  154. add_biome("junglee", nil, "ethereal:jungle_dirt", 1, "default:dirt", 3,
  155. nil, nil, nil, nil, nil, 1, 71, 30, 60, ethereal.junglee)
  156. end
  157. add_biome("junglee_ocean", nil, "default:sand", 1, "default:sand", 2,
  158. nil, nil, nil, nil, nil, -192, 1, 30, 60, ethereal.junglee)
  159. add_biome("grove", nil, "ethereal:grove_dirt", 1, "default:dirt", 3,
  160. nil, nil, nil, nil, nil, 3, 23, 45, 35, ethereal.grove)
  161. add_biome("grove_ocean", nil, "default:sand", 1, "default:sand", 2,
  162. nil, nil, nil, nil, nil, -192, 2, 45, 35, ethereal.grove)
  163. add_biome("mushroom", nil, "ethereal:mushroom_dirt", 1, "default:dirt", 3,
  164. nil, nil, nil, nil, nil, 3, 50, 45, 55, ethereal.mushroom)
  165. add_biome("mushroom_ocean", nil, "default:sand", 1, "default:sand", 2,
  166. nil, nil, nil, nil, nil, -192, 2, 45, 55, ethereal.mushroom)
  167. add_biome("sandstone", nil, "default:sandstone", 1, "default:sandstone", 1,
  168. "default:sandstone", nil, nil, nil, nil, 3, 23, 50, 20, ethereal.sandstone)
  169. add_biome("sandstone_ocean", nil, "default:sand", 1, "default:sand", 2,
  170. nil, nil, nil, nil, nil, -192, 2, 50, 20, ethereal.sandstone)
  171. add_biome("quicksand", nil, "ethereal:quicksand2", 3, "default:gravel", 1,
  172. nil, nil, nil, nil, nil, 1, 1, 50, 38, ethereal.quicksand)
  173. add_biome("plains", nil, "ethereal:dry_dirt", 1, "default:dirt", 3,
  174. nil, nil, nil, nil, nil, 3, 25, 65, 25, ethereal.plains)
  175. add_biome("plains_ocean", nil, "default:sand", 1, "default:sand", 2,
  176. nil, nil, nil, nil, nil, -192, 2, 55, 25, ethereal.plains)
  177. add_biome("savannah", nil, "default:dirt_with_dry_grass", 1, "default:dirt", 3,
  178. nil, nil, nil, nil, nil, 3, 50, 55, 25, ethereal.savannah)
  179. add_biome("savannah_ocean", nil, "default:sand", 1, "default:sand", 2,
  180. nil, nil, nil, nil, nil, -192, 1, 55, 25, ethereal.savannah)
  181. add_biome("fiery", nil, "ethereal:fiery_dirt", 1, "default:dirt", 3,
  182. nil, nil, nil, nil, nil, 5, 20, 75, 10, ethereal.fiery)
  183. add_biome("fiery_ocean", nil, "default:sand", 1, "default:sand", 2,
  184. nil, nil, nil, nil, nil, -192, 4, 75, 10, ethereal.fiery)
  185. add_biome("sandclay", nil, "default:sand", 3, "default:clay", 2,
  186. nil, nil, nil, nil, nil, 1, 11, 65, 2, ethereal.sandclay)
  187. add_biome("swamp", nil, "default:dirt_with_grass", 1, "default:dirt", 3,
  188. nil, nil, nil, nil, nil, 1, 7, 80, 90, ethereal.swamp)
  189. add_biome("swamp_ocean", nil, "default:sand", 2, "default:clay", 2,
  190. nil, nil, nil, nil, nil, -192, 1, 80, 90, ethereal.swamp)
  191. --= schematic decorations
  192. local add_schem = function(a, b, c, d, e, f, g, h)
  193. if g ~= 1 then return end
  194. minetest.register_decoration({
  195. deco_type = "schematic",
  196. place_on = a,
  197. sidelen = 80,
  198. fill_ratio = b,
  199. biomes = c,
  200. y_min = d,
  201. y_max = e,
  202. schematic = f,
  203. flags = "place_center_x, place_center_z",
  204. replacements = h,
  205. })
  206. end
  207. if ethereal.glacier then
  208. -- igloo
  209. minetest.register_decoration({
  210. deco_type = "schematic",
  211. place_on = {"default:snowblock"},
  212. sidelen = 80,
  213. fill_ratio = 0.001,
  214. biomes = {"glacier"},
  215. y_min = 3,
  216. y_max = 50,
  217. schematic = ethereal.igloo,
  218. flags = "place_center_x, place_center_z",
  219. spawn_by = "default:snowblock",
  220. num_spawn_by = 8,
  221. rotation = "random",
  222. })
  223. end
  224. --sakura tree
  225. add_schem({"ethereal:bamboo_dirt"}, 0.01, {"sakura"}, 7, 100, ethereal.sakura_tree, ethereal.sakura)
  226. -- redwood tree
  227. add_schem({"default:dirt_with_dry_grass"}, 0.0025, {"mesa"}, 1, 100, ethereal.redwood_tree, ethereal.mesa)
  228. -- banana tree
  229. add_schem({"ethereal:grove_dirt"}, 0.015, {"grove"}, 1, 100, ethereal.bananatree, ethereal.grove)
  230. -- healing tree
  231. add_schem({"default:dirt_with_snow"}, 0.01, {"alpine"}, 120, 140, ethereal.yellowtree, ethereal.alpine)
  232. -- crystal frost tree
  233. add_schem({"ethereal:crystal_dirt"}, 0.01, {"frost"}, 1, 100, ethereal.frosttrees, ethereal.frost)
  234. if ethereal.mushroom then
  235. -- giant shroom
  236. minetest.register_decoration({
  237. deco_type = "schematic",
  238. place_on = {"ethereal:mushroom_dirt"},
  239. sidelen = 80,
  240. fill_ratio = 0.02,
  241. biomes = {"mushroom"},
  242. y_min = 1,
  243. y_max = 100,
  244. schematic = ethereal.mushroomone,
  245. flags = "place_center_x, place_center_z",
  246. spawn_by = "ethereal:mushroom_dirt",
  247. num_spawn_by = 6,
  248. })
  249. end
  250. if ethereal.fiery then
  251. -- small lava crater
  252. minetest.register_decoration({
  253. deco_type = "schematic",
  254. place_on = {"ethereal:fiery_dirt"},
  255. sidelen = 80,
  256. fill_ratio = 0.01,
  257. biomes = {"fiery"},
  258. y_min = 1,
  259. y_max = 100,
  260. schematic = ethereal.volcanom,
  261. flags = "place_center_x, place_center_z",
  262. spawn_by = "ethereal:fiery_dirt",
  263. num_spawn_by = 8,
  264. })
  265. -- large lava crater
  266. minetest.register_decoration({
  267. deco_type = "schematic",
  268. place_on = {"ethereal:fiery_dirt"},
  269. sidelen = 80,
  270. fill_ratio = 0.003,
  271. biomes = {"fiery"},
  272. y_min = 1,
  273. y_max = 100,
  274. schematic = ethereal.volcanol,
  275. flags = "place_center_x, place_center_z",
  276. spawn_by = "ethereal:fiery_dirt",
  277. num_spawn_by = 8,
  278. rotation = "random",
  279. })
  280. end
  281. -- default jungle tree
  282. add_schem({"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"}, 0.08, {"junglee"}, 1, 100, dpath .. "jungle_tree.mts", ethereal.junglee)
  283. -- willow tree
  284. add_schem({"ethereal:gray_dirt"}, 0.02, {"grayness"}, 1, 100, ethereal.willow, ethereal.grayness)
  285. -- pine tree (default for lower elevation and ethereal for higher)
  286. add_schem({"ethereal:cold_dirt", "default:dirt_with_coniferous_litter"}, 0.025, {"snowy"}, 10, 40, ethereal.pinetree, ethereal.snowy)
  287. add_schem({"default:dirt_with_snow"}, 0.025, {"alpine"}, 40, 140, ethereal.pinetree, ethereal.alpine)
  288. -- default apple tree
  289. add_schem({"default:dirt_with_grass"}, 0.02, {"jumble"}, 1, 100, dpath .. "apple_tree.mts", ethereal.grassy)
  290. add_schem({"default:dirt_with_grass"}, 0.03, {"grassy"}, 1, 100, dpath .. "apple_tree.mts", ethereal.grassy)
  291. -- big old tree
  292. add_schem({"default:dirt_with_grass"}, 0.001, {"jumble"}, 1, 100, ethereal.bigtree, ethereal.jumble)
  293. -- aspen tree
  294. add_schem({"default:dirt_with_grass"}, 0.02, {"grassytwo"}, 1, 50, dpath .. "aspen_tree.mts", ethereal.jumble)
  295. -- birch tree
  296. add_schem({"default:dirt_with_grass"}, 0.02, {"grassytwo"}, 50, 100, ethereal.birchtree, ethereal.grassytwo)
  297. -- orange tree
  298. add_schem({"ethereal:prairie_dirt"}, 0.01, {"prairie"}, 1, 100, ethereal.orangetree, ethereal.prairie)
  299. -- default acacia tree
  300. add_schem({"default:dirt_with_dry_grass"}, 0.004, {"savannah"}, 1, 100, dpath .. "acacia_tree.mts", ethereal.savannah)
  301. -- large cactus (by Paramat)
  302. if ethereal.desert == 1 then
  303. minetest.register_decoration({
  304. deco_type = "schematic",
  305. place_on = {"default:desert_sand"},
  306. sidelen = 80,
  307. noise_params = {
  308. offset = -0.0005,
  309. scale = 0.0015,
  310. spread = {x = 200, y = 200, z = 200},
  311. seed = 230,
  312. octaves = 3,
  313. persist = 0.6
  314. },
  315. biomes = {"desert"},
  316. y_min = 5,
  317. y_max = 31000,
  318. schematic = dpath.."large_cactus.mts",
  319. flags = "place_center_x", --, place_center_z",
  320. rotation = "random",
  321. })
  322. end
  323. -- palm tree
  324. add_schem({"default:sand"}, 0.0025, {"desert_ocean"}, 1, 1, ethereal.palmtree, ethereal.desert)
  325. add_schem({"default:sand"}, 0.0025, {"plains_ocean"}, 1, 1, ethereal.palmtree, ethereal.plains)
  326. add_schem({"default:sand"}, 0.0025, {"sandclay"}, 1, 1, ethereal.palmtree, ethereal.sandclay)
  327. add_schem({"default:sand"}, 0.0025, {"sandstone_ocean"}, 1, 1, ethereal.palmtree, ethereal.sandstone)
  328. add_schem({"default:sand"}, 0.0025, {"mesa_ocean"}, 1, 1, ethereal.palmtree, ethereal.mesa)
  329. add_schem({"default:sand"}, 0.0025, {"grove_ocean"}, 1, 1, ethereal.palmtree, ethereal.grove)
  330. add_schem({"default:sand"}, 0.0025, {"grassy_ocean"}, 1, 1, ethereal.palmtree, ethereal.grassy)
  331. -- bamboo tree
  332. add_schem({"ethereal:bamboo_dirt"}, 0.025, {"bamboo"}, 1, 100, ethereal.bambootree, ethereal.bamboo)
  333. -- bush
  334. add_schem({"ethereal:bamboo_dirt"}, 0.08, {"bamboo"}, 1, 100, ethereal.bush, ethereal.bamboo)
  335. -- vine tree
  336. add_schem({"default:dirt_with_grass"}, 0.02, {"swamp"}, 1, 100, ethereal.vinetree, ethereal.swamp)
  337. -- water pools in swamp areas if 5.0 detected
  338. if minetest.registered_nodes["default:permafrost"] then
  339. minetest.register_decoration({
  340. deco_type = "simple",
  341. place_on = {"default:dirt_with_grass"},
  342. place_offset_y = -1,
  343. sidelen = 16,
  344. fill_ratio = 0.01,
  345. biomes = {"swamp"},
  346. y_max = 2,
  347. y_min = 1,
  348. flags = "force_placement",
  349. decoration = "default:water_source",
  350. spawn_by = "default:dirt_with_grass",
  351. num_spawn_by = 8,
  352. })
  353. minetest.register_decoration({
  354. deco_type = "simple",
  355. place_on = {"default:dirt_with_grass"},
  356. place_offset_y = -1,
  357. sidelen = 16,
  358. fill_ratio = 0.1,
  359. biomes = {"swamp"},
  360. y_max = 2,
  361. y_min = 1,
  362. flags = "force_placement",
  363. decoration = "default:water_source",
  364. spawn_by = {"default:dirt_with_grass", "default:water_source"},
  365. num_spawn_by = 8,
  366. })
  367. end
  368. -- bush
  369. minetest.register_decoration({
  370. deco_type = "schematic",
  371. place_on = {"default:dirt_with_grass", "default:dirt_with_snow"},
  372. sidelen = 16,
  373. noise_params = {
  374. offset = -0.004,
  375. scale = 0.01,
  376. spread = {x = 100, y = 100, z = 100},
  377. seed = 137,
  378. octaves = 3,
  379. persist = 0.7,
  380. },
  381. biomes = {"grassy", "grassytwo", "jumble"},
  382. y_min = 1,
  383. y_max = 31000,
  384. schematic = dpath .. "/bush.mts",
  385. flags = "place_center_x, place_center_z",
  386. })
  387. -- Acacia bush
  388. minetest.register_decoration({
  389. deco_type = "schematic",
  390. place_on = {"default:dirt_with_dry_grass"},
  391. sidelen = 16,
  392. noise_params = {
  393. offset = -0.004,
  394. scale = 0.01,
  395. spread = {x = 100, y = 100, z = 100},
  396. seed = 90155,
  397. octaves = 3,
  398. persist = 0.7,
  399. },
  400. biomes = {"savannah", "mesa"},
  401. y_min = 1,
  402. y_max = 31000,
  403. schematic = dpath .. "/acacia_bush.mts",
  404. flags = "place_center_x, place_center_z",
  405. })
  406. --= simple decorations
  407. local add_node = function(a, b, c, d, e, f, g, h, i, j)
  408. if j ~= 1 then return end
  409. minetest.register_decoration({
  410. deco_type = "simple",
  411. place_on = a,
  412. sidelen = 80,
  413. fill_ratio = b,
  414. biomes = c,
  415. y_min = d,
  416. y_max = e,
  417. decoration = f,
  418. height_max = g,
  419. spawn_by = h,
  420. num_spawn_by = i,
  421. })
  422. end
  423. --firethorn shrub
  424. add_node({"default:snowblock"}, 0.001, {"glacier"}, 1, 30, {"ethereal:firethorn"}, nil, nil, nil, ethereal.glacier)
  425. -- scorched tree
  426. add_node({"ethereal:dry_dirt"}, 0.006, {"plains"}, 1, 100, {"ethereal:scorched_tree"}, 6, nil, nil, ethereal.plains)
  427. -- dry shrub
  428. add_node({"ethereal:dry_dirt"}, 0.015, {"plains"}, 1, 100, {"default:dry_shrub"}, nil, nil, nil, ethereal.plains)
  429. add_node({"default:sand"}, 0.015, {"grassy_ocean"}, 1, 100, {"default:dry_shrub"}, nil, nil, nil, ethereal.grassy)
  430. add_node({"default:desert_sand"}, 0.015, {"desert"}, 1, 100, {"default:dry_shrub"}, nil, nil, nil, ethereal.desert)
  431. add_node({"default:sandstone"}, 0.015, {"sandstone"}, 1, 100, {"default:dry_shrub"}, nil, nil, nil, ethereal.sandstone)
  432. add_node({"bakedclay:red", "bakedclay:orange"}, 0.015, {"mesa"}, 1, 100, {"default:dry_shrub"}, nil, nil, nil, ethereal.mesa)
  433. -- dry grass
  434. add_node({"default:dirt_with_dry_grass"}, 0.25, {"savannah"}, 1, 100, {"default:dry_grass_2",
  435. "default:dry_grass_3", "default:dry_grass_4", "default:dry_grass_5"}, nil, nil, nil, ethereal.savannah)
  436. add_node({"default:dirt_with_dry_grass"}, 0.10, {"mesa"}, 1, 100, {"default:dry_grass_2",
  437. "default:dry_grass_3", "default:dry_grass_4", "default:dry_grass_5"}, nil, nil, nil, ethereal.mesa)
  438. -- flowers & strawberry
  439. add_node({"default:dirt_with_grass"}, 0.025, {"grassy"}, 1, 100, {"flowers:dandelion_white",
  440. "flowers:dandelion_yellow", "flowers:geranium", "flowers:rose", "flowers:tulip",
  441. "flowers:viola", "ethereal:strawberry_7"}, nil, nil, nil, ethereal.grassy)
  442. add_node({"default:dirt_with_grass"}, 0.025, {"grassytwo"}, 1, 100, {"flowers:dandelion_white",
  443. "flowers:dandelion_yellow", "flowers:geranium", "flowers:rose", "flowers:tulip",
  444. "flowers:viola", "ethereal:strawberry_7"}, nil, nil, nil, ethereal.grassytwo)
  445. -- prairie flowers & strawberry
  446. add_node({"ethereal:prairie_dirt"}, 0.035, {"prairie"}, 1, 100, {"flowers:dandelion_white",
  447. "flowers:dandelion_yellow", "flowers:geranium", "flowers:rose", "flowers:tulip",
  448. "flowers:viola", "ethereal:strawberry_7", "flowers:chrysanthemum_green", "flowers:tulip_black"}, nil, nil, nil, ethereal.prairie)
  449. -- crystal spike & crystal grass
  450. add_node({"ethereal:crystal_dirt"}, 0.02, {"frost"}, 1, 100, {"ethereal:crystal_spike",
  451. "ethereal:crystalgrass"}, nil, nil, nil, ethereal.frost)
  452. -- red shrub
  453. add_node({"ethereal:fiery_dirt"}, 0.10, {"fiery"}, 1, 100, {"ethereal:dry_shrub"}, nil, nil, nil, ethereal.fiery)
  454. -- fire flower
  455. --add_node({"ethereal:fiery_dirt"}, 0.02, {"fiery"}, 1, 100, {"ethereal:fire_flower"}, nil, nil, nil, ethereal.fiery)
  456. -- snowy grass
  457. add_node({"ethereal:gray_dirt"}, 0.05, {"grayness"}, 1, 100, {"ethereal:snowygrass"}, nil, nil, nil, ethereal.grayness)
  458. add_node({"ethereal:cold_dirt", "default:dirt_with_coniferous_litter"}, 0.05, {"snowy"}, 1, 100, {"ethereal:snowygrass"}, nil, nil, nil, ethereal.snowy)
  459. -- cactus
  460. add_node({"default:sandstone"}, 0.0025, {"sandstone"}, 1, 100, {"default:cactus"}, 3, nil, nil, ethereal.sandstone)
  461. add_node({"default:desert_sand"}, 0.005, {"desert"}, 1, 100, {"default:cactus"}, 4, nil, nil, ethereal.desert)
  462. -- wild red mushroom
  463. add_node({"ethereal:mushroom_dirt"}, 0.01, {"mushroom"}, 1, 100, {"flowers:mushroom_fertile_red"}, nil, nil, nil, ethereal.mushroom)
  464. local list = {
  465. {"junglee", {"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"}, ethereal.junglee},
  466. {"grassy", {"default:dirt_with_grass"}, ethereal.grassy},
  467. {"grassytwo", {"default:dirt_with_grass"}, ethereal.grassytwo},
  468. {"prairie", {"ethereal:prairie_dirt"}, ethereal.prairie},
  469. {"mushroom", {"ethereal:mushroom_dirt"}, ethereal.mushroom},
  470. {"swamp", {"default:dirt_with_grass"}, ethereal.swamp},
  471. }
  472. -- wild red and brown mushrooms
  473. for _, row in pairs(list) do
  474. if row[3] == 1 then
  475. minetest.register_decoration({
  476. deco_type = "simple",
  477. place_on = row[2],
  478. sidelen = 16,
  479. noise_params = {
  480. offset = 0,
  481. scale = 0.009,
  482. spread = {x = 200, y = 200, z = 200},
  483. seed = 2,
  484. octaves = 3,
  485. persist = 0.66
  486. },
  487. biomes = {row[1]},
  488. y_min = 1,
  489. y_max = 120,
  490. decoration = {"flowers:mushroom_brown", "flowers:mushroom_red"},
  491. })
  492. end
  493. end
  494. -- jungle grass
  495. add_node({"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"}, 0.10, {"junglee"}, 1, 100, {"default:junglegrass"}, nil, nil, nil, ethereal.junglee)
  496. add_node({"default:dirt_with_grass"}, 0.15, {"jumble"}, 1, 100, {"default:junglegrass"}, nil, nil, nil, ethereal.jumble)
  497. add_node({"default:dirt_with_grass"}, 0.25, {"swamp"}, 1, 100, {"default:junglegrass"}, nil, nil, nil, ethereal.swamp)
  498. -- grass
  499. add_node({"default:dirt_with_grass"}, 0.35, {"grassy"}, 1, 100, {"default:grass_2", "default:grass_3",
  500. "default:grass_4", "default:grass_5"}, nil, nil, nil, ethereal.grassy)
  501. add_node({"default:dirt_with_grass"}, 0.35, {"grassytwo"}, 1, 100, {"default:grass_2", "default:grass_3",
  502. "default:grass_4", "default:grass_5"}, nil, nil, nil, ethereal.grassytwo)
  503. add_node({"default:dirt_with_grass"}, 0.35, {"jumble"}, 1, 100, {"default:grass_2", "default:grass_3",
  504. "default:grass_4", "default:grass_5"}, nil, nil, nil, ethereal.jumble)
  505. add_node({"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"}, 0.35, {"junglee"}, 1, 100, {"default:grass_2", "default:grass_3",
  506. "default:grass_4", "default:grass_5"}, nil, nil, nil, ethereal.junglee)
  507. add_node({"ethereal:prairie_dirt"}, 0.35, {"prairie"}, 1, 100, {"default:grass_2", "default:grass_3",
  508. "default:grass_4", "default:grass_5"}, nil, nil, nil, ethereal.prairie)
  509. add_node({"ethereal:grove_dirt"}, 0.35, {"grove"}, 1, 100, {"default:grass_2", "default:grass_3",
  510. "default:grass_4", "default:grass_5"}, nil, nil, nil, ethereal.grove)
  511. add_node({"ethereal:bamboo_dirt"}, 0.35, {"bamboo"}, 1, 100, {"default:grass_2", "default:grass_3",
  512. "default:grass_4", "default:grass_5"}, nil, nil, nil, ethereal.bamboo)
  513. add_node({"default:dirt_with_grass"}, 0.35, {"clearing", "swamp"}, 1, 100, {"default:grass_3",
  514. "default:grass_4"}, nil, nil, nil, 1)
  515. add_node({"ethereal:bamboo_dirt"}, 0.35, {"sakura"}, 1, 100, {"default:grass_2", "default:grass_3", "default:grass_4", "default:grass_5"}, nil, nil, nil, ethereal.sakura)
  516. -- grass on sand (and maybe blueberry bush)
  517. if minetest.registered_nodes["default:marram_grass_1"] then
  518. add_node({"default:sand"}, 0.25, {"sandclay"}, 3, 4, {"default:marram_grass_1",
  519. "default:marram_grass_2", "default:marram_grass_3"}, nil, nil, nil, ethereal.sandclay)
  520. -- Blueberry bush
  521. minetest.register_decoration({
  522. name = "default:blueberry_bush",
  523. deco_type = "schematic",
  524. place_on = {"default:dirt_with_coniferous_litter", "default:dirt_with_snow"},
  525. sidelen = 16,
  526. noise_params = {
  527. offset = -0.004,
  528. scale = 0.01,
  529. spread = {x = 100, y = 100, z = 100},
  530. seed = 697,
  531. octaves = 3,
  532. persist = 0.7,
  533. },
  534. biomes = {"snowy", "alpine"},
  535. y_max = 31000,
  536. y_min = 1,
  537. place_offset_y = 1,
  538. schematic = minetest.get_modpath("default")
  539. .. "/schematics/blueberry_bush.mts",
  540. flags = "place_center_x, place_center_z",
  541. })
  542. else
  543. add_node({"default:sand"}, 0.25, {"sandclay"}, 3, 4, {"default:grass_2", "default:grass_3"}, nil, nil, nil, ethereal.sandclay)
  544. end
  545. -- ferns
  546. add_node({"ethereal:grove_dirt"}, 0.2, {"grove"}, 1, 100, {"ethereal:fern"}, nil, nil, nil, ethereal.grove)
  547. add_node({"default:dirt_with_grass"}, 0.1, {"swamp"}, 1, 100, {"ethereal:fern"}, nil, nil, nil, ethereal.swamp)
  548. -- snow
  549. add_node({"ethereal:cold_dirt", "default:dirt_with_coniferous_litter"}, 0.8, {"snowy"}, 4, 40, {"default:snow"}, nil, nil, nil, ethereal.snowy)
  550. add_node({"default:dirt_with_snow"}, 0.8, {"alpine"}, 40, 140, {"default:snow"}, nil, nil, nil, ethereal.alpine)
  551. -- wild onion
  552. add_node({"default:dirt_with_grass"}, 0.25, {"grassy"}, 1, 100, {"ethereal:onion_4"}, nil, nil, nil, ethereal.grassy)
  553. add_node({"default:dirt_with_grass"}, 0.25, {"grassytwo"}, 1, 100, {"ethereal:onion_4"}, nil, nil, nil, ethereal.grassytwo)
  554. add_node({"default:dirt_with_grass"}, 0.25, {"jumble"}, 1, 100, {"ethereal:onion_4"}, nil, nil, nil, ethereal.jumble)
  555. add_node({"ethereal:prairie_dirt"}, 0.25, {"prairie"}, 1, 100, {"ethereal:onion_4"}, nil, nil, nil, ethereal.prairie)
  556. -- papyrus
  557. add_node({"default:dirt_with_grass"}, 0.1, {"grassy"}, 1, 1, {"default:papyrus"}, 4, "default:water_source", 1, ethereal.grassy)
  558. add_node({"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"}, 0.1, {"junglee"}, 1, 1, {"default:papyrus"}, 4, "default:water_source", 1, ethereal.junglee)
  559. add_node({"default:dirt_with_grass"}, 0.1, {"swamp"}, 1, 1, {"default:papyrus"}, 4, "default:water_source", 1, ethereal.swamp)
  560. --= Farming Redo plants
  561. if farming and farming.mod and farming.mod == "redo" then
  562. print ("[MOD] Ethereal - Farming Redo detected and in use")
  563. -- potato
  564. add_node({"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"}, 0.035, {"junglee"}, 1, 100, {"farming:potato_3"}, nil, nil, nil, ethereal.junglee)
  565. -- carrot, cucumber, potato, tomato, corn, coffee, raspberry, rhubarb
  566. add_node({"default:dirt_with_grass"}, 0.05, {"grassytwo"}, 1, 100, {"farming:carrot_7", "farming:cucumber_4",
  567. "farming:potato_3", "farming:tomato_7", "farming:corn_8", "farming:coffee_5",
  568. "farming:raspberry_4", "farming:rhubarb_3", "farming:blueberry_4"}, nil, nil, nil, ethereal.grassytwo)
  569. add_node({"default:dirt_with_grass"}, 0.05, {"grassy"}, 1, 100, {"farming:carrot_7", "farming:cucumber_4",
  570. "farming:potato_3", "farming:tomato_7", "farming:corn_8", "farming:coffee_5",
  571. "farming:raspberry_4", "farming:rhubarb_3", "farming:blueberry_4",
  572. "farming:beetroot_5"}, nil, nil, nil, ethereal.grassy)
  573. add_node({"default:dirt_with_grass"}, 0.05, {"jumble"}, 1, 100, {"farming:carrot_7", "farming:cucumber_4",
  574. "farming:potato_3", "farming:tomato_7", "farming:corn_8", "farming:coffee_5",
  575. "farming:raspberry_4", "farming:rhubarb_3", "farming:blueberry_4"}, nil, nil, nil, ethereal.jumble)
  576. add_node({"ethereal:prairie_dirt"}, 0.05, {"prairie"}, 1, 100, {"farming:carrot_7", "farming:cucumber_4",
  577. "farming:potato_3", "farming:tomato_7", "farming:corn_8", "farming:coffee_5",
  578. "farming:raspberry_4", "farming:rhubarb_3", "farming:blueberry_4",
  579. "farming:pea_5", "farming:beetroot_5"}, nil, nil, nil, ethereal.prairie)
  580. -- melon and pumpkin
  581. add_node({"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"}, 0.015, {"junglee"}, 1, 1, {"farming:melon_8", "farming:pumpkin_8"}, nil, "default:water_source", 1, ethereal.junglee)
  582. add_node({"default:dirt_with_grass"}, 0.015, {"grassy"}, 1, 1, {"farming:melon_8", "farming:pumpkin_8"}, nil, "default:water_source", 1, ethereal.grassy)
  583. add_node({"default:dirt_with_grass"}, 0.015, {"grassytwo"}, 1, 1, {"farming:melon_8", "farming:pumpkin_8"}, nil, "default:water_source", 1, ethereal.grassytwo)
  584. add_node({"default:dirt_with_grass"}, 0.015, {"jumble"}, 1, 1, {"farming:melon_8", "farming:pumpkin_8"}, nil, "default:water_source", 1, ethereal.jumble)
  585. -- green beans
  586. add_node({"default:dirt_with_grass"}, 0.035, {"grassytwo"}, 1, 100, {"farming:beanbush"}, nil, nil, nil, ethereal.grassytwo)
  587. -- grape bushel
  588. add_node({"default:dirt_with_grass"}, 0.025, {"grassytwo"}, 1, 100, {"farming:grapebush"}, nil, nil, nil, ethereal.grassytwo)
  589. add_node({"default:dirt_with_grass"}, 0.025, {"grassy"}, 1, 100, {"farming:grapebush"}, nil, nil, nil, ethereal.grassy)
  590. add_node({"ethereal:prairie_dirt"}, 0.025, {"prairie"}, 1, 100, {"farming:grapebush"}, nil, nil, nil, ethereal.prairie)
  591. minetest.register_decoration({
  592. deco_type = "simple",
  593. place_on = {
  594. "default:dirt_with_grass", "ethereal:prairie_dirt",
  595. "default:dirt_with_rainforest_litter",
  596. },
  597. sidelen = 16,
  598. noise_params = {
  599. offset = 0,
  600. scale = 0.06,
  601. spread = {x = 100, y = 100, z = 100},
  602. seed = 420,
  603. octaves = 3,
  604. persist = 0.6
  605. },
  606. y_min = 5,
  607. y_max = 35,
  608. decoration = "farming:hemp_7",
  609. spawn_by = "group:tree",
  610. num_spawn_by = 1,
  611. })
  612. minetest.register_decoration({
  613. deco_type = "simple",
  614. place_on = {"default:dirt_with_grass", "default:dirt_with_rainforest_litter"},
  615. sidelen = 16,
  616. noise_params = {
  617. offset = 0,
  618. scale = 0.09,
  619. spread = {x = 100, y = 100, z = 100},
  620. seed = 760,
  621. octaves = 3,
  622. persist = 0.6
  623. },
  624. y_min = 5,
  625. y_max = 35,
  626. decoration = {"farming:chili_8", "farming:garlic_5", "farming:pepper_5", "farming:onion_5"},
  627. spawn_by = "group:tree",
  628. num_spawn_by = 1,
  629. })
  630. minetest.register_decoration({
  631. deco_type = "simple",
  632. place_on = {"default:dirt_with_dry_grass"},
  633. sidelen = 16,
  634. noise_params = {
  635. offset = 0,
  636. scale = 0.06,
  637. spread = {x = 100, y = 100, z = 100},
  638. seed = 917,
  639. octaves = 3,
  640. persist = 0.6
  641. },
  642. y_min = 18,
  643. y_max = 30,
  644. decoration = {"farming:pineapple_8"},
  645. })
  646. end
  647. -- place waterlily in beach areas
  648. local list = {
  649. {"desert_ocean", ethereal.desert},
  650. {"plains_ocean", ethereal.plains},
  651. {"sandclay", ethereal.sandclay},
  652. {"sandstone_ocean", ethereal.sandstone},
  653. {"mesa_ocean", ethereal.mesa},
  654. {"grove_ocean", ethereal.grove},
  655. {"grassy_ocean", ethereal.grassy},
  656. {"swamp_ocean", ethereal.swamp},
  657. }
  658. for _, row in pairs(list) do
  659. if row[2] == 1 then
  660. minetest.register_decoration({
  661. deco_type = "schematic",
  662. place_on = {"default:sand"},
  663. sidelen = 16,
  664. noise_params = {
  665. offset = -0.12,
  666. scale = 0.3,
  667. spread = {x = 200, y = 200, z = 200},
  668. seed = 33,
  669. octaves = 3,
  670. persist = 0.7
  671. },
  672. biomes = {row[1]},
  673. y_min = 0,
  674. y_max = 0,
  675. schematic = ethereal.waterlily,
  676. rotation = "random",
  677. })
  678. end
  679. end
  680. local random = math.random
  681. -- Generate Illumishroom in caves next to coal
  682. minetest.register_on_generated(function(minp, maxp)
  683. if minp.y > -30 or maxp.y < -3000 then
  684. return
  685. end
  686. local bpos
  687. local coal = minetest.find_nodes_in_area_under_air(
  688. minp, maxp, "default:stone_with_coal")
  689. for n = 1, #coal do
  690. if random(1, 2) == 1 then
  691. bpos = {x = coal[n].x, y = coal[n].y + 1, z = coal[n].z }
  692. if bpos.y > -3000 and bpos.y < -2000 then
  693. minetest.swap_node(bpos, {name = "ethereal:illumishroom3"})
  694. elseif bpos.y > -2000 and bpos.y < -1000 then
  695. minetest.swap_node(bpos, {name = "ethereal:illumishroom2"})
  696. elseif bpos.y > -1000 and bpos.y < -30 then
  697. minetest.swap_node(bpos, {name = "ethereal:illumishroom"})
  698. end
  699. end
  700. end
  701. end)
  702. -- coral reef (0.4.15 only)
  703. if ethereal.reefs == 1 then
  704. -- override corals so crystal shovel can pick them up intact
  705. minetest.override_item("default:coral_skeleton", {groups = {crumbly = 3}})
  706. minetest.override_item("default:coral_orange", {groups = {crumbly = 3}})
  707. minetest.override_item("default:coral_brown", {groups = {crumbly = 3}})
  708. minetest.register_decoration({
  709. deco_type = "schematic",
  710. place_on = {"default:sand"},
  711. noise_params = {
  712. offset = -0.15,
  713. scale = 0.1,
  714. spread = {x = 100, y = 100, z = 100},
  715. seed = 7013,
  716. octaves = 3,
  717. persist = 1,
  718. },
  719. biomes = {
  720. "desert_ocean",
  721. "grove_ocean",
  722. },
  723. y_min = -8,
  724. y_max = -2,
  725. schematic = path .. "corals.mts",
  726. flags = "place_center_x, place_center_z",
  727. rotation = "random",
  728. })
  729. end
  730. -- is baked clay mod active? add new flowers if so
  731. if minetest.get_modpath("bakedclay") then
  732. minetest.register_decoration({
  733. deco_type = "simple",
  734. place_on = {
  735. "ethereal:prairie_grass", "default:dirt_with_grass",
  736. "ethereal:grove_dirt"
  737. },
  738. sidelen = 16,
  739. noise_params = {
  740. offset = 0,
  741. scale = 0.004,
  742. spread = {x = 100, y = 100, z = 100},
  743. seed = 7133,
  744. octaves = 3,
  745. persist = 0.6
  746. },
  747. y_min = 10,
  748. y_max = 90,
  749. decoration = "bakedclay:delphinium",
  750. })
  751. minetest.register_decoration({
  752. deco_type = "simple",
  753. place_on = {
  754. "ethereal:prairie_grass", "default:dirt_with_grass",
  755. "ethereal:grove_dirt", "ethereal:bamboo_dirt"
  756. },
  757. sidelen = 16,
  758. noise_params = {
  759. offset = 0,
  760. scale = 0.004,
  761. spread = {x = 100, y = 100, z = 100},
  762. seed = 7134,
  763. octaves = 3,
  764. persist = 0.6
  765. },
  766. y_min = 15,
  767. y_max = 90,
  768. decoration = "bakedclay:thistle",
  769. })
  770. minetest.register_decoration({
  771. deco_type = "simple",
  772. place_on = {"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"},
  773. sidelen = 16,
  774. noise_params = {
  775. offset = 0,
  776. scale = 0.01,
  777. spread = {x = 100, y = 100, z = 100},
  778. seed = 7135,
  779. octaves = 3,
  780. persist = 0.6
  781. },
  782. y_min = 1,
  783. y_max = 90,
  784. decoration = "bakedclay:lazarus",
  785. spawn_by = "default:jungletree",
  786. num_spawn_by = 1,
  787. })
  788. minetest.register_decoration({
  789. deco_type = "simple",
  790. place_on = {"default:dirt_with_grass", "default:sand"},
  791. sidelen = 16,
  792. noise_params = {
  793. offset = 0,
  794. scale = 0.009,
  795. spread = {x = 100, y = 100, z = 100},
  796. seed = 7136,
  797. octaves = 3,
  798. persist = 0.6
  799. },
  800. y_min = 1,
  801. y_max = 15,
  802. decoration = "bakedclay:mannagrass",
  803. spawn_by = "group:water",
  804. num_spawn_by = 1,
  805. })
  806. end
  807. if ethereal.desert and minetest.get_modpath("wine") then
  808. minetest.register_decoration({
  809. deco_type = "simple",
  810. place_on = {"default:desert_sand"},
  811. sidelen = 16,
  812. fill_ratio = 0.001,
  813. biomes = {"desert"},
  814. decoration = {"wine:blue_agave"},
  815. })
  816. end
  817. if ethereal.snowy and minetest.registered_nodes["default:fern_1"] then
  818. local function register_fern_decoration(seed, length)
  819. minetest.register_decoration({
  820. name = "default:fern_" .. length,
  821. deco_type = "simple",
  822. place_on = {
  823. "ethereal:cold_dirt", "default:dirt_with_coniferous_litter"},
  824. sidelen = 16,
  825. noise_params = {
  826. offset = 0,
  827. scale = 0.2,
  828. spread = {x = 100, y = 100, z = 100},
  829. seed = seed,
  830. octaves = 3,
  831. persist = 0.7
  832. },
  833. y_max = 31000,
  834. y_min = 6,
  835. decoration = "default:fern_" .. length,
  836. })
  837. end
  838. register_fern_decoration(14936, 3)
  839. register_fern_decoration(801, 2)
  840. register_fern_decoration(5, 1)
  841. end
  842. if ethereal.tundra and minetest.registered_nodes["default:permafrost"] then
  843. minetest.register_biome({
  844. name = "tundra_highland",
  845. node_dust = "default:snow",
  846. node_riverbed = "default:gravel",
  847. depth_riverbed = 2,
  848. y_max = 180,
  849. y_min = 47,
  850. heat_point = 0,
  851. humidity_point = 40,
  852. })
  853. minetest.register_biome({
  854. name = "tundra",
  855. node_top = "default:permafrost_with_stones",
  856. depth_top = 1,
  857. node_filler = "default:permafrost",
  858. depth_filler = 1,
  859. node_riverbed = "default:gravel",
  860. depth_riverbed = 2,
  861. vertical_blend = 4,
  862. y_max = 46,
  863. y_min = 2,
  864. heat_point = 0,
  865. humidity_point = 40,
  866. })
  867. minetest.register_biome({
  868. name = "tundra_beach",
  869. node_top = "default:gravel",
  870. depth_top = 1,
  871. node_filler = "default:gravel",
  872. depth_filler = 2,
  873. node_riverbed = "default:gravel",
  874. depth_riverbed = 2,
  875. vertical_blend = 1,
  876. y_max = 1,
  877. y_min = -3,
  878. heat_point = 0,
  879. humidity_point = 40,
  880. })
  881. minetest.register_biome({
  882. name = "tundra_ocean",
  883. node_top = "default:sand",
  884. depth_top = 1,
  885. node_filler = "default:sand",
  886. depth_filler = 3,
  887. node_riverbed = "default:gravel",
  888. depth_riverbed = 2,
  889. vertical_blend = 1,
  890. y_max = -4,
  891. y_min = -112,
  892. heat_point = 0,
  893. humidity_point = 40,
  894. })
  895. -- Tundra moss
  896. minetest.register_decoration({
  897. deco_type = "simple",
  898. place_on = {"default:permafrost_with_stones"},
  899. sidelen = 4,
  900. noise_params = {
  901. offset = -0.8,
  902. scale = 2.0,
  903. spread = {x = 100, y = 100, z = 100},
  904. seed = 53995,
  905. octaves = 3,
  906. persist = 1.0
  907. },
  908. biomes = {"tundra"},
  909. y_max = 50,
  910. y_min = 2,
  911. decoration = "default:permafrost_with_moss",
  912. place_offset_y = -1,
  913. flags = "force_placement",
  914. })
  915. -- Tundra patchy snow
  916. minetest.register_decoration({
  917. deco_type = "simple",
  918. place_on = {
  919. "default:permafrost_with_moss",
  920. "default:permafrost_with_stones",
  921. "default:stone",
  922. "default:gravel"
  923. },
  924. sidelen = 4,
  925. noise_params = {
  926. offset = 0,
  927. scale = 1.0,
  928. spread = {x = 100, y = 100, z = 100},
  929. seed = 172555,
  930. octaves = 3,
  931. persist = 1.0
  932. },
  933. biomes = {"tundra", "tundra_beach"},
  934. y_max = 50,
  935. y_min = 1,
  936. decoration = "default:snow",
  937. })
  938. end
  939. if minetest.get_modpath("butterflies") then
  940. minetest.register_decoration({
  941. name = "butterflies:butterfly",
  942. deco_type = "simple",
  943. place_on = {"default:dirt_with_grass", "ethereal:prairie_dirt"},
  944. place_offset_y = 2,
  945. sidelen = 80,
  946. fill_ratio = 0.005,
  947. biomes = {"grassy", "grassytwo", "prairie", "jumble"},
  948. y_max = 31000,
  949. y_min = 1,
  950. decoration = {
  951. "butterflies:butterfly_white",
  952. "butterflies:butterfly_red",
  953. "butterflies:butterfly_violet"
  954. },
  955. spawn_by = "group:flower",
  956. num_spawn_by = 1
  957. })
  958. end
  959. if minetest.get_modpath("fireflies") then
  960. minetest.register_decoration({
  961. name = "fireflies:firefly_low",
  962. deco_type = "simple",
  963. place_on = {
  964. "default:dirt_with_grass",
  965. "default:dirt_with_coniferous_litter",
  966. "default:dirt_with_rainforest_litter",
  967. "default:dirt",
  968. "ethereal:cold_dirt",
  969. },
  970. place_offset_y = 2,
  971. sidelen = 80,
  972. fill_ratio = 0.0005,
  973. biomes = {"grassy", "grassytwo", "snowy", "junglee", "swamp"},
  974. y_max = 31000,
  975. y_min = -1,
  976. decoration = "fireflies:hidden_firefly",
  977. })
  978. end
  979. -- Coral Reef (Minetest 5.0)
  980. if minetest.registered_nodes["default:coral_green"] then
  981. minetest.register_decoration({
  982. name = "default:corals",
  983. deco_type = "simple",
  984. place_on = {"default:sand"},
  985. place_offset_y = -1,
  986. sidelen = 4,
  987. noise_params = {
  988. offset = -4,
  989. scale = 4,
  990. spread = {x = 50, y = 50, z = 50},
  991. seed = 7013,
  992. octaves = 3,
  993. persist = 0.7,
  994. },
  995. biomes = {
  996. "desert_ocean",
  997. "savanna_ocean",
  998. "junglee_ocean",
  999. },
  1000. y_max = -2,
  1001. y_min = -8,
  1002. flags = "force_placement",
  1003. decoration = {
  1004. "default:coral_green", "default:coral_pink",
  1005. "default:coral_cyan", "default:coral_brown",
  1006. "default:coral_orange", "default:coral_skeleton",
  1007. },
  1008. })
  1009. -- Kelp
  1010. minetest.register_decoration({
  1011. name = "default:kelp",
  1012. deco_type = "simple",
  1013. place_on = {"default:sand"},
  1014. place_offset_y = -1,
  1015. sidelen = 16,
  1016. noise_params = {
  1017. offset = -0.04,
  1018. scale = 0.1,
  1019. spread = {x = 200, y = 200, z = 200},
  1020. seed = 87112,
  1021. octaves = 3,
  1022. persist = 0.7
  1023. },
  1024. biomes = {
  1025. "frost_ocean", "grassy_ocean", "sandstone_ocean", "swamp_ocean"},
  1026. y_max = -5,
  1027. y_min = -10,
  1028. flags = "force_placement",
  1029. decoration = "default:sand_with_kelp",
  1030. param2 = 48,
  1031. param2_max = 96,
  1032. })
  1033. end