mapgen.lua 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208
  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. add_node({"default:desert_stone"}, 0.005, {"caves"}, 5, 40, {"default:dry_grass_2",
  439. "default:dry_grass_3", "default:dry_shrub"}, nil, nil, nil, ethereal.caves)
  440. -- flowers & strawberry
  441. add_node({"default:dirt_with_grass"}, 0.025, {"grassy"}, 1, 100, {"flowers:dandelion_white",
  442. "flowers:dandelion_yellow", "flowers:geranium", "flowers:rose", "flowers:tulip",
  443. "flowers:viola", "ethereal:strawberry_7"}, nil, nil, nil, ethereal.grassy)
  444. add_node({"default:dirt_with_grass"}, 0.025, {"grassytwo"}, 1, 100, {"flowers:dandelion_white",
  445. "flowers:dandelion_yellow", "flowers:geranium", "flowers:rose", "flowers:tulip",
  446. "flowers:viola", "ethereal:strawberry_7"}, nil, nil, nil, ethereal.grassytwo)
  447. -- prairie flowers & strawberry
  448. add_node({"ethereal:prairie_dirt"}, 0.035, {"prairie"}, 1, 100, {"flowers:dandelion_white",
  449. "flowers:dandelion_yellow", "flowers:geranium", "flowers:rose", "flowers:tulip",
  450. "flowers:viola", "ethereal:strawberry_7", "flowers:chrysanthemum_green", "flowers:tulip_black"}, nil, nil, nil, ethereal.prairie)
  451. -- crystal spike & crystal grass
  452. add_node({"ethereal:crystal_dirt"}, 0.02, {"frost"}, 1, 100, {"ethereal:crystal_spike",
  453. "ethereal:crystalgrass"}, nil, nil, nil, ethereal.frost)
  454. -- red shrub
  455. add_node({"ethereal:fiery_dirt"}, 0.10, {"fiery"}, 1, 100, {"ethereal:dry_shrub"}, nil, nil, nil, ethereal.fiery)
  456. -- fire flower
  457. --add_node({"ethereal:fiery_dirt"}, 0.02, {"fiery"}, 1, 100, {"ethereal:fire_flower"}, nil, nil, nil, ethereal.fiery)
  458. -- snowy grass
  459. add_node({"ethereal:gray_dirt"}, 0.05, {"grayness"}, 1, 100, {"ethereal:snowygrass"}, nil, nil, nil, ethereal.grayness)
  460. add_node({"ethereal:cold_dirt", "default:dirt_with_coniferous_litter"}, 0.05, {"snowy"}, 1, 100, {"ethereal:snowygrass"}, nil, nil, nil, ethereal.snowy)
  461. -- cactus
  462. add_node({"default:sandstone"}, 0.0025, {"sandstone"}, 1, 100, {"default:cactus"}, 3, nil, nil, ethereal.sandstone)
  463. add_node({"default:desert_sand"}, 0.005, {"desert"}, 1, 100, {"default:cactus"}, 4, nil, nil, ethereal.desert)
  464. -- wild red mushroom
  465. add_node({"ethereal:mushroom_dirt"}, 0.01, {"mushroom"}, 1, 100, {"flowers:mushroom_fertile_red"}, nil, nil, nil, ethereal.mushroom)
  466. local list = {
  467. {"junglee", {"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"}, ethereal.junglee},
  468. {"grassy", {"default:dirt_with_grass"}, ethereal.grassy},
  469. {"grassytwo", {"default:dirt_with_grass"}, ethereal.grassytwo},
  470. {"prairie", {"ethereal:prairie_dirt"}, ethereal.prairie},
  471. {"mushroom", {"ethereal:mushroom_dirt"}, ethereal.mushroom},
  472. {"swamp", {"default:dirt_with_grass"}, ethereal.swamp},
  473. }
  474. -- wild red and brown mushrooms
  475. for _, row in pairs(list) do
  476. if row[3] == 1 then
  477. minetest.register_decoration({
  478. deco_type = "simple",
  479. place_on = row[2],
  480. sidelen = 16,
  481. noise_params = {
  482. offset = 0,
  483. scale = 0.009,
  484. spread = {x = 200, y = 200, z = 200},
  485. seed = 2,
  486. octaves = 3,
  487. persist = 0.66
  488. },
  489. biomes = {row[1]},
  490. y_min = 1,
  491. y_max = 120,
  492. decoration = {"flowers:mushroom_brown", "flowers:mushroom_red"},
  493. })
  494. end
  495. end
  496. -- jungle grass
  497. add_node({"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"}, 0.10, {"junglee"}, 1, 100, {"default:junglegrass"}, nil, nil, nil, ethereal.junglee)
  498. add_node({"default:dirt_with_grass"}, 0.15, {"jumble"}, 1, 100, {"default:junglegrass"}, nil, nil, nil, ethereal.jumble)
  499. add_node({"default:dirt_with_grass"}, 0.25, {"swamp"}, 1, 100, {"default:junglegrass"}, nil, nil, nil, ethereal.swamp)
  500. -- grass
  501. add_node({"default:dirt_with_grass"}, 0.35, {"grassy"}, 1, 100, {"default:grass_2", "default:grass_3",
  502. "default:grass_4", "default:grass_5"}, nil, nil, nil, ethereal.grassy)
  503. add_node({"default:dirt_with_grass"}, 0.35, {"grassytwo"}, 1, 100, {"default:grass_2", "default:grass_3",
  504. "default:grass_4", "default:grass_5"}, nil, nil, nil, ethereal.grassytwo)
  505. add_node({"default:dirt_with_grass"}, 0.35, {"jumble"}, 1, 100, {"default:grass_2", "default:grass_3",
  506. "default:grass_4", "default:grass_5"}, nil, nil, nil, ethereal.jumble)
  507. add_node({"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"}, 0.35, {"junglee"}, 1, 100, {"default:grass_2", "default:grass_3",
  508. "default:grass_4", "default:grass_5"}, nil, nil, nil, ethereal.junglee)
  509. add_node({"ethereal:prairie_dirt"}, 0.35, {"prairie"}, 1, 100, {"default:grass_2", "default:grass_3",
  510. "default:grass_4", "default:grass_5"}, nil, nil, nil, ethereal.prairie)
  511. add_node({"ethereal:grove_dirt"}, 0.35, {"grove"}, 1, 100, {"default:grass_2", "default:grass_3",
  512. "default:grass_4", "default:grass_5"}, nil, nil, nil, ethereal.grove)
  513. add_node({"ethereal:bamboo_dirt"}, 0.35, {"bamboo"}, 1, 100, {"default:grass_2", "default:grass_3",
  514. "default:grass_4", "default:grass_5"}, nil, nil, nil, ethereal.bamboo)
  515. add_node({"default:dirt_with_grass"}, 0.35, {"clearing", "swamp"}, 1, 100, {"default:grass_3",
  516. "default:grass_4"}, nil, nil, nil, 1)
  517. 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)
  518. -- grass on sand (and maybe blueberry bush)
  519. if minetest.registered_nodes["default:marram_grass_1"] then
  520. add_node({"default:sand"}, 0.25, {"sandclay"}, 3, 4, {"default:marram_grass_1",
  521. "default:marram_grass_2", "default:marram_grass_3"}, nil, nil, nil, ethereal.sandclay)
  522. -- Blueberry bush
  523. minetest.register_decoration({
  524. name = "default:blueberry_bush",
  525. deco_type = "schematic",
  526. place_on = {"default:dirt_with_coniferous_litter", "default:dirt_with_snow"},
  527. sidelen = 16,
  528. noise_params = {
  529. offset = -0.004,
  530. scale = 0.01,
  531. spread = {x = 100, y = 100, z = 100},
  532. seed = 697,
  533. octaves = 3,
  534. persist = 0.7,
  535. },
  536. biomes = {"snowy", "alpine"},
  537. y_max = 31000,
  538. y_min = 1,
  539. place_offset_y = 1,
  540. schematic = minetest.get_modpath("default")
  541. .. "/schematics/blueberry_bush.mts",
  542. flags = "place_center_x, place_center_z",
  543. })
  544. else
  545. add_node({"default:sand"}, 0.25, {"sandclay"}, 3, 4, {"default:grass_2", "default:grass_3"}, nil, nil, nil, ethereal.sandclay)
  546. end
  547. -- ferns
  548. add_node({"ethereal:grove_dirt"}, 0.2, {"grove"}, 1, 100, {"ethereal:fern"}, nil, nil, nil, ethereal.grove)
  549. add_node({"default:dirt_with_grass"}, 0.1, {"swamp"}, 1, 100, {"ethereal:fern"}, nil, nil, nil, ethereal.swamp)
  550. -- snow
  551. add_node({"ethereal:cold_dirt", "default:dirt_with_coniferous_litter"}, 0.8, {"snowy"}, 4, 40, {"default:snow"}, nil, nil, nil, ethereal.snowy)
  552. add_node({"default:dirt_with_snow"}, 0.8, {"alpine"}, 40, 140, {"default:snow"}, nil, nil, nil, ethereal.alpine)
  553. -- wild onion
  554. add_node({"default:dirt_with_grass"}, 0.25, {"grassy"}, 1, 100, {"ethereal:onion_4"}, nil, nil, nil, ethereal.grassy)
  555. add_node({"default:dirt_with_grass"}, 0.25, {"grassytwo"}, 1, 100, {"ethereal:onion_4"}, nil, nil, nil, ethereal.grassytwo)
  556. add_node({"default:dirt_with_grass"}, 0.25, {"jumble"}, 1, 100, {"ethereal:onion_4"}, nil, nil, nil, ethereal.jumble)
  557. add_node({"ethereal:prairie_dirt"}, 0.25, {"prairie"}, 1, 100, {"ethereal:onion_4"}, nil, nil, nil, ethereal.prairie)
  558. -- papyrus
  559. add_node({"default:dirt_with_grass"}, 0.1, {"grassy"}, 1, 1, {"default:papyrus"}, 4, "default:water_source", 1, ethereal.grassy)
  560. add_node({"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"}, 0.1, {"junglee"}, 1, 1, {"default:papyrus"}, 4, "default:water_source", 1, ethereal.junglee)
  561. add_node({"default:dirt_with_grass"}, 0.1, {"swamp"}, 1, 1, {"default:papyrus"}, 4, "default:water_source", 1, ethereal.swamp)
  562. --= Farming Redo plants
  563. if farming and farming.mod and farming.mod == "redo" then
  564. print ("[MOD] Ethereal - Farming Redo detected and in use")
  565. -- potato
  566. add_node({"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"}, 0.035, {"junglee"}, 1, 100, {"farming:potato_3"}, nil, nil, nil, ethereal.junglee)
  567. -- carrot, cucumber, potato, tomato, corn, coffee, raspberry, rhubarb
  568. add_node({"default:dirt_with_grass"}, 0.05, {"grassytwo"}, 1, 100, {"farming:carrot_7", "farming:cucumber_4",
  569. "farming:potato_3", "farming:tomato_7", "farming:corn_8", "farming:coffee_5",
  570. "farming:raspberry_4", "farming:rhubarb_3", "farming:blueberry_4"}, nil, nil, nil, ethereal.grassytwo)
  571. add_node({"default:dirt_with_grass"}, 0.05, {"grassy"}, 1, 100, {"farming:carrot_7", "farming:cucumber_4",
  572. "farming:potato_3", "farming:tomato_7", "farming:corn_8", "farming:coffee_5",
  573. "farming:raspberry_4", "farming:rhubarb_3", "farming:blueberry_4",
  574. "farming:beetroot_5"}, nil, nil, nil, ethereal.grassy)
  575. add_node({"default:dirt_with_grass"}, 0.05, {"jumble"}, 1, 100, {"farming:carrot_7", "farming:cucumber_4",
  576. "farming:potato_3", "farming:tomato_7", "farming:corn_8", "farming:coffee_5",
  577. "farming:raspberry_4", "farming:rhubarb_3", "farming:blueberry_4"}, nil, nil, nil, ethereal.jumble)
  578. add_node({"ethereal:prairie_dirt"}, 0.05, {"prairie"}, 1, 100, {"farming:carrot_7", "farming:cucumber_4",
  579. "farming:potato_3", "farming:tomato_7", "farming:corn_8", "farming:coffee_5",
  580. "farming:raspberry_4", "farming:rhubarb_3", "farming:blueberry_4",
  581. "farming:pea_5", "farming:beetroot_5"}, nil, nil, nil, ethereal.prairie)
  582. -- melon and pumpkin
  583. 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)
  584. add_node({"default:dirt_with_grass"}, 0.015, {"grassy"}, 1, 1, {"farming:melon_8", "farming:pumpkin_8"}, nil, "default:water_source", 1, ethereal.grassy)
  585. add_node({"default:dirt_with_grass"}, 0.015, {"grassytwo"}, 1, 1, {"farming:melon_8", "farming:pumpkin_8"}, nil, "default:water_source", 1, ethereal.grassytwo)
  586. add_node({"default:dirt_with_grass"}, 0.015, {"jumble"}, 1, 1, {"farming:melon_8", "farming:pumpkin_8"}, nil, "default:water_source", 1, ethereal.jumble)
  587. -- green beans
  588. add_node({"default:dirt_with_grass"}, 0.035, {"grassytwo"}, 1, 100, {"farming:beanbush"}, nil, nil, nil, ethereal.grassytwo)
  589. -- grape bushel
  590. add_node({"default:dirt_with_grass"}, 0.025, {"grassytwo"}, 1, 100, {"farming:grapebush"}, nil, nil, nil, ethereal.grassytwo)
  591. add_node({"default:dirt_with_grass"}, 0.025, {"grassy"}, 1, 100, {"farming:grapebush"}, nil, nil, nil, ethereal.grassy)
  592. add_node({"ethereal:prairie_dirt"}, 0.025, {"prairie"}, 1, 100, {"farming:grapebush"}, nil, nil, nil, ethereal.prairie)
  593. minetest.register_decoration({
  594. deco_type = "simple",
  595. place_on = {
  596. "default:dirt_with_grass", "ethereal:prairie_dirt",
  597. "default:dirt_with_rainforest_litter",
  598. },
  599. sidelen = 16,
  600. noise_params = {
  601. offset = 0,
  602. scale = 0.06,
  603. spread = {x = 100, y = 100, z = 100},
  604. seed = 420,
  605. octaves = 3,
  606. persist = 0.6
  607. },
  608. y_min = 5,
  609. y_max = 35,
  610. decoration = "farming:hemp_7",
  611. spawn_by = "group:tree",
  612. num_spawn_by = 1,
  613. })
  614. minetest.register_decoration({
  615. deco_type = "simple",
  616. place_on = {"default:dirt_with_grass", "default:dirt_with_rainforest_litter"},
  617. sidelen = 16,
  618. noise_params = {
  619. offset = 0,
  620. scale = 0.09,
  621. spread = {x = 100, y = 100, z = 100},
  622. seed = 760,
  623. octaves = 3,
  624. persist = 0.6
  625. },
  626. y_min = 5,
  627. y_max = 35,
  628. decoration = {"farming:chili_8", "farming:garlic_5", "farming:pepper_5", "farming:onion_5"},
  629. spawn_by = "group:tree",
  630. num_spawn_by = 1,
  631. })
  632. minetest.register_decoration({
  633. deco_type = "simple",
  634. place_on = {"default:dirt_with_dry_grass"},
  635. sidelen = 16,
  636. noise_params = {
  637. offset = 0,
  638. scale = 0.06,
  639. spread = {x = 100, y = 100, z = 100},
  640. seed = 917,
  641. octaves = 3,
  642. persist = 0.6
  643. },
  644. y_min = 18,
  645. y_max = 30,
  646. decoration = {"farming:pineapple_8"},
  647. })
  648. end
  649. -- place waterlily in beach areas
  650. local list = {
  651. {"desert_ocean", ethereal.desert},
  652. {"plains_ocean", ethereal.plains},
  653. {"sandclay", ethereal.sandclay},
  654. {"sandstone_ocean", ethereal.sandstone},
  655. {"mesa_ocean", ethereal.mesa},
  656. {"grove_ocean", ethereal.grove},
  657. {"grassy_ocean", ethereal.grassy},
  658. {"swamp_ocean", ethereal.swamp},
  659. }
  660. for _, row in pairs(list) do
  661. if row[2] == 1 then
  662. minetest.register_decoration({
  663. deco_type = "schematic",
  664. place_on = {"default:sand"},
  665. sidelen = 16,
  666. noise_params = {
  667. offset = -0.12,
  668. scale = 0.3,
  669. spread = {x = 200, y = 200, z = 200},
  670. seed = 33,
  671. octaves = 3,
  672. persist = 0.7
  673. },
  674. biomes = {row[1]},
  675. y_min = 0,
  676. y_max = 0,
  677. schematic = ethereal.waterlily,
  678. rotation = "random",
  679. })
  680. end
  681. end
  682. local random = math.random
  683. -- Generate Illumishroom in caves next to coal
  684. minetest.register_on_generated(function(minp, maxp)
  685. if minp.y > -30 or maxp.y < -3000 then
  686. return
  687. end
  688. local bpos
  689. local coal = minetest.find_nodes_in_area_under_air(
  690. minp, maxp, "default:stone_with_coal")
  691. for n = 1, #coal do
  692. if random(1, 2) == 1 then
  693. bpos = {x = coal[n].x, y = coal[n].y + 1, z = coal[n].z }
  694. if bpos.y > -3000 and bpos.y < -2000 then
  695. minetest.swap_node(bpos, {name = "ethereal:illumishroom3"})
  696. elseif bpos.y > -2000 and bpos.y < -1000 then
  697. minetest.swap_node(bpos, {name = "ethereal:illumishroom2"})
  698. elseif bpos.y > -1000 and bpos.y < -30 then
  699. minetest.swap_node(bpos, {name = "ethereal:illumishroom"})
  700. end
  701. end
  702. end
  703. end)
  704. -- coral reef (0.4.15 only)
  705. if ethereal.reefs == 1 then
  706. -- override corals so crystal shovel can pick them up intact
  707. minetest.override_item("default:coral_skeleton", {groups = {crumbly = 3}})
  708. minetest.override_item("default:coral_orange", {groups = {crumbly = 3}})
  709. minetest.override_item("default:coral_brown", {groups = {crumbly = 3}})
  710. minetest.register_decoration({
  711. deco_type = "schematic",
  712. place_on = {"default:sand"},
  713. noise_params = {
  714. offset = -0.15,
  715. scale = 0.1,
  716. spread = {x = 100, y = 100, z = 100},
  717. seed = 7013,
  718. octaves = 3,
  719. persist = 1,
  720. },
  721. biomes = {
  722. "desert_ocean",
  723. "grove_ocean",
  724. },
  725. y_min = -8,
  726. y_max = -2,
  727. schematic = path .. "corals.mts",
  728. flags = "place_center_x, place_center_z",
  729. rotation = "random",
  730. })
  731. end
  732. -- is baked clay mod active? add new flowers if so
  733. if minetest.get_modpath("bakedclay") then
  734. minetest.register_decoration({
  735. deco_type = "simple",
  736. place_on = {
  737. "ethereal:prairie_grass", "default:dirt_with_grass",
  738. "ethereal:grove_dirt"
  739. },
  740. sidelen = 16,
  741. noise_params = {
  742. offset = 0,
  743. scale = 0.004,
  744. spread = {x = 100, y = 100, z = 100},
  745. seed = 7133,
  746. octaves = 3,
  747. persist = 0.6
  748. },
  749. y_min = 10,
  750. y_max = 90,
  751. decoration = "bakedclay:delphinium",
  752. })
  753. minetest.register_decoration({
  754. deco_type = "simple",
  755. place_on = {
  756. "ethereal:prairie_grass", "default:dirt_with_grass",
  757. "ethereal:grove_dirt", "ethereal:bamboo_dirt"
  758. },
  759. sidelen = 16,
  760. noise_params = {
  761. offset = 0,
  762. scale = 0.004,
  763. spread = {x = 100, y = 100, z = 100},
  764. seed = 7134,
  765. octaves = 3,
  766. persist = 0.6
  767. },
  768. y_min = 15,
  769. y_max = 90,
  770. decoration = "bakedclay:thistle",
  771. })
  772. minetest.register_decoration({
  773. deco_type = "simple",
  774. place_on = {"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"},
  775. sidelen = 16,
  776. noise_params = {
  777. offset = 0,
  778. scale = 0.01,
  779. spread = {x = 100, y = 100, z = 100},
  780. seed = 7135,
  781. octaves = 3,
  782. persist = 0.6
  783. },
  784. y_min = 1,
  785. y_max = 90,
  786. decoration = "bakedclay:lazarus",
  787. spawn_by = "default:jungletree",
  788. num_spawn_by = 1,
  789. })
  790. minetest.register_decoration({
  791. deco_type = "simple",
  792. place_on = {"default:dirt_with_grass", "default:sand"},
  793. sidelen = 16,
  794. noise_params = {
  795. offset = 0,
  796. scale = 0.009,
  797. spread = {x = 100, y = 100, z = 100},
  798. seed = 7136,
  799. octaves = 3,
  800. persist = 0.6
  801. },
  802. y_min = 1,
  803. y_max = 15,
  804. decoration = "bakedclay:mannagrass",
  805. spawn_by = "group:water",
  806. num_spawn_by = 1,
  807. })
  808. end
  809. if ethereal.desert and minetest.get_modpath("wine") then
  810. minetest.register_decoration({
  811. deco_type = "simple",
  812. place_on = {"default:desert_sand"},
  813. sidelen = 16,
  814. fill_ratio = 0.001,
  815. biomes = {"desert"},
  816. decoration = {"wine:blue_agave"},
  817. })
  818. end
  819. if ethereal.snowy and minetest.registered_nodes["default:fern_1"] then
  820. local function register_fern_decoration(seed, length)
  821. minetest.register_decoration({
  822. name = "default:fern_" .. length,
  823. deco_type = "simple",
  824. place_on = {
  825. "ethereal:cold_dirt", "default:dirt_with_coniferous_litter"},
  826. sidelen = 16,
  827. noise_params = {
  828. offset = 0,
  829. scale = 0.2,
  830. spread = {x = 100, y = 100, z = 100},
  831. seed = seed,
  832. octaves = 3,
  833. persist = 0.7
  834. },
  835. y_max = 31000,
  836. y_min = 6,
  837. decoration = "default:fern_" .. length,
  838. })
  839. end
  840. register_fern_decoration(14936, 3)
  841. register_fern_decoration(801, 2)
  842. register_fern_decoration(5, 1)
  843. end
  844. if ethereal.tundra and minetest.registered_nodes["default:permafrost"] then
  845. minetest.register_biome({
  846. name = "tundra_highland",
  847. node_dust = "default:snow",
  848. node_riverbed = "default:gravel",
  849. depth_riverbed = 2,
  850. y_max = 180,
  851. y_min = 47,
  852. heat_point = 0,
  853. humidity_point = 40,
  854. })
  855. minetest.register_biome({
  856. name = "tundra",
  857. node_top = "default:permafrost_with_stones",
  858. depth_top = 1,
  859. node_filler = "default:permafrost",
  860. depth_filler = 1,
  861. node_riverbed = "default:gravel",
  862. depth_riverbed = 2,
  863. vertical_blend = 4,
  864. y_max = 46,
  865. y_min = 2,
  866. heat_point = 0,
  867. humidity_point = 40,
  868. })
  869. minetest.register_biome({
  870. name = "tundra_beach",
  871. node_top = "default:gravel",
  872. depth_top = 1,
  873. node_filler = "default:gravel",
  874. depth_filler = 2,
  875. node_riverbed = "default:gravel",
  876. depth_riverbed = 2,
  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. vertical_blend = 1,
  892. y_max = -4,
  893. y_min = -112,
  894. heat_point = 0,
  895. humidity_point = 40,
  896. })
  897. -- Tundra moss
  898. minetest.register_decoration({
  899. deco_type = "simple",
  900. place_on = {"default:permafrost_with_stones"},
  901. sidelen = 4,
  902. noise_params = {
  903. offset = -0.8,
  904. scale = 2.0,
  905. spread = {x = 100, y = 100, z = 100},
  906. seed = 53995,
  907. octaves = 3,
  908. persist = 1.0
  909. },
  910. biomes = {"tundra"},
  911. y_max = 50,
  912. y_min = 2,
  913. decoration = "default:permafrost_with_moss",
  914. place_offset_y = -1,
  915. flags = "force_placement",
  916. })
  917. -- Tundra patchy snow
  918. minetest.register_decoration({
  919. deco_type = "simple",
  920. place_on = {
  921. "default:permafrost_with_moss",
  922. "default:permafrost_with_stones",
  923. "default:stone",
  924. "default:gravel"
  925. },
  926. sidelen = 4,
  927. noise_params = {
  928. offset = 0,
  929. scale = 1.0,
  930. spread = {x = 100, y = 100, z = 100},
  931. seed = 172555,
  932. octaves = 3,
  933. persist = 1.0
  934. },
  935. biomes = {"tundra", "tundra_beach"},
  936. y_max = 50,
  937. y_min = 1,
  938. decoration = "default:snow",
  939. })
  940. end
  941. if minetest.get_modpath("butterflies") then
  942. minetest.register_decoration({
  943. name = "butterflies:butterfly",
  944. deco_type = "simple",
  945. place_on = {"default:dirt_with_grass", "ethereal:prairie_dirt"},
  946. place_offset_y = 2,
  947. sidelen = 80,
  948. fill_ratio = 0.005,
  949. biomes = {"grassy", "grassytwo", "prairie", "jumble"},
  950. y_max = 31000,
  951. y_min = 1,
  952. decoration = {
  953. "butterflies:butterfly_white",
  954. "butterflies:butterfly_red",
  955. "butterflies:butterfly_violet"
  956. },
  957. spawn_by = "group:flower",
  958. num_spawn_by = 1
  959. })
  960. end
  961. if minetest.get_modpath("fireflies") then
  962. minetest.register_decoration({
  963. name = "fireflies:firefly_low",
  964. deco_type = "simple",
  965. place_on = {
  966. "default:dirt_with_grass",
  967. "default:dirt_with_coniferous_litter",
  968. "default:dirt_with_rainforest_litter",
  969. "default:dirt",
  970. "ethereal:cold_dirt",
  971. },
  972. place_offset_y = 2,
  973. sidelen = 80,
  974. fill_ratio = 0.0005,
  975. biomes = {"grassy", "grassytwo", "snowy", "junglee", "swamp"},
  976. y_max = 31000,
  977. y_min = -1,
  978. decoration = "fireflies:hidden_firefly",
  979. })
  980. end
  981. -- Coral Reef (Minetest 5.0)
  982. if minetest.registered_nodes["default:coral_green"] then
  983. minetest.register_decoration({
  984. name = "default:corals",
  985. deco_type = "simple",
  986. place_on = {"default:sand"},
  987. place_offset_y = -1,
  988. sidelen = 4,
  989. noise_params = {
  990. offset = -4,
  991. scale = 4,
  992. spread = {x = 50, y = 50, z = 50},
  993. seed = 7013,
  994. octaves = 3,
  995. persist = 0.7,
  996. },
  997. biomes = {
  998. "desert_ocean",
  999. "savanna_ocean",
  1000. "junglee_ocean",
  1001. },
  1002. y_max = -2,
  1003. y_min = -8,
  1004. flags = "force_placement",
  1005. decoration = {
  1006. "default:coral_green", "default:coral_pink",
  1007. "default:coral_cyan", "default:coral_brown",
  1008. "default:coral_orange", "default:coral_skeleton",
  1009. },
  1010. })
  1011. -- Kelp
  1012. minetest.register_decoration({
  1013. name = "default:kelp",
  1014. deco_type = "simple",
  1015. place_on = {"default:sand"},
  1016. place_offset_y = -1,
  1017. sidelen = 16,
  1018. noise_params = {
  1019. offset = -0.04,
  1020. scale = 0.1,
  1021. spread = {x = 200, y = 200, z = 200},
  1022. seed = 87112,
  1023. octaves = 3,
  1024. persist = 0.7
  1025. },
  1026. biomes = {
  1027. "frost_ocean", "grassy_ocean", "sandstone_ocean", "swamp_ocean"},
  1028. y_max = -5,
  1029. y_min = -10,
  1030. flags = "force_placement",
  1031. decoration = "default:sand_with_kelp",
  1032. param2 = 48,
  1033. param2_max = 96,
  1034. })
  1035. end