decor.lua 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799
  1. if minetest.registered_nodes["farming:cotton_wild"] then
  2. minetest.register_decoration({
  3. name = "farming:cotton_wild",
  4. deco_type = "simple",
  5. place_on = {"default:dry_dirt_with_dry_grass"},
  6. sidelen = 16,
  7. noise_params = {
  8. offset = -0.1,
  9. scale = 0.1,
  10. spread = {x = 50, y = 50, z = 50},
  11. seed = 4242,
  12. octaves = 3,
  13. persist = 0.7
  14. },
  15. biomes = {"savanna"},
  16. y_max = 31000,
  17. y_min = 1,
  18. decoration = "farming:cotton_wild"
  19. })
  20. end
  21. -- water pools in swamp areas if 5.0 detected
  22. if minetest.registered_nodes["default:permafrost"] then
  23. minetest.register_decoration({
  24. deco_type = "simple",
  25. place_on = {"default:dirt_with_grass"},
  26. place_offset_y = -1,
  27. sidelen = 16,
  28. fill_ratio = 0.01,
  29. biomes = {"swamp"},
  30. y_max = 2,
  31. y_min = 1,
  32. flags = "force_placement",
  33. decoration = "default:water_source",
  34. spawn_by = "default:dirt_with_grass",
  35. num_spawn_by = 8
  36. })
  37. minetest.register_decoration({
  38. deco_type = "simple",
  39. place_on = {"default:dirt_with_grass"},
  40. place_offset_y = -1,
  41. sidelen = 16,
  42. fill_ratio = 0.1,
  43. biomes = {"swamp"},
  44. y_max = 2,
  45. y_min = 1,
  46. flags = "force_placement",
  47. decoration = "default:water_source",
  48. spawn_by = {"default:dirt_with_grass", "default:water_source"},
  49. num_spawn_by = 8
  50. })
  51. end
  52. if minetest.registered_nodes["default:dry_dirt_with_dry_grass"] then
  53. minetest.register_decoration({
  54. deco_type = "simple",
  55. place_on = {"default:dry_dirt_with_dry_grass"},
  56. sidelen = 4,
  57. noise_params = {
  58. offset = -1.5,
  59. scale = -1.5,
  60. spread = {x = 200, y = 200, z = 200},
  61. seed = 329,
  62. octaves = 4,
  63. persist = 1.0
  64. },
  65. biomes = {"savanna"},
  66. y_max = 31000,
  67. y_min = 1,
  68. decoration = "default:dry_dirt",
  69. place_offset_y = -1,
  70. flags = "force_placement"
  71. })
  72. end
  73. -- helper string
  74. local tmp
  75. -- helper function
  76. local add_node = function(a, b, c, d, e, f, g, h, i, j)
  77. if j ~= 1 then return end
  78. minetest.register_decoration({
  79. deco_type = "simple",
  80. place_on = a,
  81. sidelen = 80,
  82. fill_ratio = b,
  83. biomes = c,
  84. y_min = d,
  85. y_max = e,
  86. decoration = f,
  87. height_max = g,
  88. spawn_by = h,
  89. num_spawn_by = i
  90. })
  91. end
  92. --firethorn shrub
  93. add_node({"default:snowblock"}, 0.001, {"glacier"}, 1, 30,
  94. {"ethereal:firethorn"}, nil, nil, nil, ethereal.glacier)
  95. -- scorched tree
  96. add_node({"ethereal:dry_dirt"}, 0.006, {"plains"}, 1, 100,
  97. {"ethereal:scorched_tree"}, 6, nil, nil, ethereal.plains)
  98. -- dry shrub
  99. add_node({"ethereal:dry_dirt"}, 0.015, {"plains"}, 1, 100,
  100. {"default:dry_shrub"}, nil, nil, nil, ethereal.plains)
  101. add_node({"default:sand"}, 0.015, {"deciduous_forest_ocean"}, 1, 100,
  102. {"default:dry_shrub"}, nil, nil, nil, ethereal.grassy)
  103. add_node({"default:desert_sand"}, 0.015, {"desert"}, 1, 100,
  104. {"default:dry_shrub"}, nil, nil, nil, ethereal.desert)
  105. add_node({"default:sandstone"}, 0.015, {"sandstone"}, 1, 100,
  106. {"default:dry_shrub"}, nil, nil, nil, ethereal.sandstone)
  107. add_node({"bakedclay:red", "bakedclay:orange"}, 0.015, {"mesa"}, 1, 100,
  108. {"default:dry_shrub"}, nil, nil, nil, ethereal.mesa)
  109. -- dry grass
  110. add_node({"default:dry_dirt_with_dry_grass",
  111. "default:dirt_with_dry_grass"}, 0.25, {"savanna"}, 1, 100,
  112. {"default:dry_grass_2", "default:dry_grass_3", "default:dry_grass_4",
  113. "default:dry_grass_5"}, nil, nil, nil, ethereal.savanna)
  114. add_node({"default:dirt_with_dry_grass"}, 0.10, {"mesa"}, 1, 100,
  115. {"default:dry_grass_2", "default:dry_grass_3", "default:dry_grass_4",
  116. "default:dry_grass_5"}, nil, nil, nil, ethereal.mesa)
  117. add_node({"default:desert_stone"}, 0.005, {"caves"}, 5, 40,
  118. {"default:dry_grass_2", "default:dry_grass_3", "default:dry_shrub"},
  119. nil, nil, nil, ethereal.caves)
  120. -- flowers & strawberry
  121. add_node({"default:dirt_with_grass"}, 0.025, {"deciduous_forest"}, 1, 100,
  122. {"flowers:dandelion_white", "flowers:dandelion_yellow",
  123. "flowers:geranium", "flowers:rose", "flowers:tulip",
  124. "flowers:viola", "ethereal:strawberry_7"}, nil, nil, nil,
  125. ethereal.grassy)
  126. add_node({"default:dirt_with_grass"}, 0.025, {"grassytwo"}, 1, 100,
  127. {"flowers:dandelion_white", "flowers:dandelion_yellow",
  128. "flowers:geranium", "flowers:rose", "flowers:tulip",
  129. "flowers:viola", "ethereal:strawberry_7"}, nil, nil, nil,
  130. ethereal.grassytwo)
  131. -- prairie flowers & strawberry
  132. add_node({"ethereal:prairie_dirt"}, 0.035, {"prairie"}, 1, 100,
  133. {"flowers:dandelion_white", "flowers:dandelion_yellow",
  134. "flowers:geranium", "flowers:rose", "flowers:tulip",
  135. "flowers:viola", "ethereal:strawberry_7",
  136. "flowers:chrysanthemum_green", "flowers:tulip_black"}, nil, nil, nil,
  137. ethereal.prairie)
  138. -- crystal spike & crystal grass
  139. add_node({"ethereal:crystal_dirt"}, 0.02, {"frost", "frost_floatland"}, 1, 1750,
  140. {"ethereal:crystal_spike", "ethereal:crystalgrass"}, nil, nil, nil,
  141. ethereal.frost)
  142. -- red shrub
  143. add_node({"ethereal:fiery_dirt"}, 0.10, {"fiery"}, 1, 100,
  144. {"ethereal:dry_shrub"}, nil, nil, nil, ethereal.fiery)
  145. -- snowy grass
  146. add_node({"ethereal:gray_dirt"}, 0.05, {"grayness"}, 1, 100,
  147. {"ethereal:snowygrass"}, nil, nil, nil, ethereal.grayness)
  148. add_node({"ethereal:cold_dirt", "default:dirt_with_coniferous_litter"}, 0.05,
  149. {"coniferous_forest"}, 1, 100, {"ethereal:snowygrass"}, nil, nil, nil, ethereal.snowy)
  150. -- cactus
  151. add_node({"default:sandstone"}, 0.0025, {"sandstone"}, 1, 100,
  152. {"default:cactus"}, 3, nil, nil, ethereal.sandstone)
  153. add_node({"default:desert_sand"}, 0.005, {"desert"}, 1, 100,
  154. {"default:cactus"}, 4, nil, nil, ethereal.desert)
  155. -- wild red mushroom
  156. add_node({"ethereal:mushroom_dirt"}, 0.01, {"mushroom"}, 1, 100,
  157. {"flowers:mushroom_red"}, nil, nil, nil, ethereal.mushroom)
  158. local list = {
  159. {"junglee", {"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"}, ethereal.junglee},
  160. {"deciduous_forest", {"default:dirt_with_grass"}, ethereal.grassy},
  161. {"grassytwo", {"default:dirt_with_grass"}, ethereal.grassytwo},
  162. {"prairie", {"ethereal:prairie_dirt"}, ethereal.prairie},
  163. {"mushroom", {"ethereal:mushroom_dirt"}, ethereal.mushroom},
  164. {"swamp", {"default:dirt_with_grass"}, ethereal.swamp}
  165. }
  166. -- wild red and brown mushrooms
  167. for _, row in pairs(list) do
  168. if row[3] == 1 then
  169. minetest.register_decoration({
  170. deco_type = "simple",
  171. place_on = row[2],
  172. sidelen = 16,
  173. noise_params = {
  174. offset = 0,
  175. scale = 0.009,
  176. spread = {x = 200, y = 200, z = 200},
  177. seed = 2,
  178. octaves = 3,
  179. persist = 0.66
  180. },
  181. biomes = {row[1]},
  182. y_min = 1,
  183. y_max = 120,
  184. decoration = {"flowers:mushroom_brown", "flowers:mushroom_red"}
  185. })
  186. end
  187. end
  188. -- jungle grass
  189. add_node({"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"},
  190. 0.10, {"junglee"}, 1, 100, {"default:junglegrass"}, nil, nil, nil,
  191. ethereal.junglee)
  192. add_node({"default:dirt_with_grass"}, 0.15, {"jumble"}, 1, 100,
  193. {"default:junglegrass"}, nil, nil, nil, ethereal.jumble)
  194. add_node({"default:dirt_with_grass"}, 0.25, {"swamp"}, 1, 100,
  195. {"default:junglegrass"}, nil, nil, nil, ethereal.swamp)
  196. -- grass
  197. add_node({"default:dirt_with_grass"}, 0.35, {"deciduous_forest"}, 1, 100,
  198. {"default:grass_2", "default:grass_3", "default:grass_4",
  199. "default:grass_5"}, nil, nil, nil, ethereal.grassy)
  200. add_node({"default:dirt_with_grass"}, 0.35, {"grassytwo"}, 1, 100,
  201. {"default:grass_2", "default:grass_3", "default:grass_4",
  202. "default:grass_5"}, nil, nil, nil, ethereal.grassytwo)
  203. add_node({"default:dirt_with_grass"}, 0.35, {"jumble"}, 1, 100,
  204. {"default:grass_2", "default:grass_3", "default:grass_4",
  205. "default:grass_5"}, nil, nil, nil, ethereal.jumble)
  206. add_node({"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"},
  207. 0.35, {"junglee"}, 1, 100, {"default:grass_2", "default:grass_3",
  208. "default:grass_4", "default:grass_5"}, nil, nil, nil, ethereal.junglee)
  209. add_node({"ethereal:prairie_dirt"}, 0.35, {"prairie"}, 1, 100,
  210. {"default:grass_2", "default:grass_3", "default:grass_4",
  211. "default:grass_5"}, nil, nil, nil, ethereal.prairie)
  212. add_node({"ethereal:grove_dirt"}, 0.35, {"grove"}, 1, 100,
  213. {"default:grass_2", "default:grass_3", "default:grass_4",
  214. "default:grass_5"}, nil, nil, nil, ethereal.grove)
  215. add_node({"ethereal:grove_dirt"}, 0.35, {"mediterranean"}, 1, 100,
  216. {"default:grass_2", "default:grass_3", "default:grass_4",
  217. "default:grass_5"}, nil, nil, nil, ethereal.mediterranean)
  218. add_node({"ethereal:bamboo_dirt"}, 0.35, {"bamboo"}, 1, 100,
  219. {"default:grass_2", "default:grass_3", "default:grass_4",
  220. "default:grass_5"}, nil, nil, nil, ethereal.bamboo)
  221. add_node({"default:dirt_with_grass"}, 0.35, {"grassland", "swamp"},
  222. 1, 100, {"default:grass_3", "default:grass_4"}, nil, nil, nil, 1)
  223. add_node({"ethereal:bamboo_dirt"}, 0.35, {"sakura"}, 1, 100,
  224. {"default:grass_2", "default:grass_3", "default:grass_4",
  225. "default:grass_5"}, nil, nil, nil, ethereal.sakura)
  226. -- grass on sand
  227. if minetest.registered_nodes["default:marram_grass_1"] then
  228. add_node({"default:sand"}, 0.25, {"sandclay"}, 3, 4, {"default:marram_grass_1",
  229. "default:marram_grass_2", "default:marram_grass_3"}, nil, nil, nil,
  230. ethereal.sandclay)
  231. else
  232. add_node({"default:sand"}, 0.25, {"sandclay"}, 3, 4, {"default:grass_2",
  233. "default:grass_3"}, nil, nil, nil, ethereal.sandclay)
  234. end
  235. -- ferns
  236. add_node({"ethereal:grove_dirt"}, 0.2, {"grove"}, 1, 100, {"ethereal:fern"},
  237. nil, nil, nil, ethereal.grove)
  238. add_node({"default:dirt_with_grass"}, 0.1, {"swamp"}, 1, 100,
  239. {"ethereal:fern"}, nil, nil, nil, ethereal.swamp)
  240. add_node({"ethereal:crystal_dirt"}, 0.001, {"frost_floatlands"}, 1025, 1750,
  241. {"ethereal:fern"}, nil, nil, nil, ethereal.frost)
  242. -- snow
  243. add_node({"ethereal:cold_dirt", "default:dirt_with_coniferous_litter"},
  244. 0.8, {"coniferous_forest"}, 4, 40, {"default:snow"}, nil, nil, nil, ethereal.snowy)
  245. add_node({"default:dirt_with_snow"}, 0.8, {"taiga"}, 40, 140,
  246. {"default:snow"}, nil, nil, nil, ethereal.alpine)
  247. -- wild onion
  248. add_node({"default:dirt_with_grass", "ethereal:prairie_dirt"}, 0.025,
  249. {"deciduous_forest", "grassytwo", "jumble", "prairie"}, 1, 100,
  250. {"ethereal:onion_4"}, nil, nil, nil, 1)
  251. -- papyrus
  252. add_node({"default:dirt_with_grass"}, 0.1, {"deciduous_forest"}, 1, 1,
  253. {"default:papyrus"}, 4, "default:water_source", 1, ethereal.grassy)
  254. add_node({"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"},
  255. 0.1, {"junglee"}, 1, 1, {"default:papyrus"}, 4, "default:water_source",
  256. 1, ethereal.junglee)
  257. add_node({"default:dirt_with_grass"}, 0.1, {"swamp"}, 1, 1,
  258. {"default:papyrus"}, 4, "default:water_source", 1, ethereal.swamp)
  259. --= Farming Redo plants
  260. if farming and farming.mod and farming.mod == "redo" then
  261. print ("[MOD] Ethereal - Farming Redo detected and in use")
  262. -- potato
  263. add_node({"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"},
  264. 0.002, {"junglee"}, 1, 100, {"farming:potato_3"}, nil, nil, nil,
  265. ethereal.junglee)
  266. -- carrot, cucumber, potato, tomato, corn, coffee, raspberry, rhubarb
  267. add_node({"default:dirt_with_grass"}, 0.002, {"grassytwo"}, 1, 100,
  268. {"farming:carrot_7", "farming:cucumber_4", "farming:potato_3", "farming:vanilla_7",
  269. "farming:tomato_7", "farming:corn_8", "farming:coffee_5", "farming:blackberry_4",
  270. "farming:raspberry_4", "farming:rhubarb_3", "farming:blueberry_4",
  271. "farming:cabbage_6", "farming:lettuce_5", "farming:sunflower_8",
  272. "farming:asparagus"}, nil, nil, nil,
  273. ethereal.grassytwo)
  274. add_node({"default:dirt_with_grass"}, 0.002, {"deciduous_forest"}, 1, 100,
  275. {"farming:carrot_7", "farming:cucumber_4", "farming:potato_3", "farming:vanilla_7",
  276. "farming:tomato_7", "farming:corn_8", "farming:coffee_5", "farming:blackberry_4",
  277. "farming:raspberry_4", "farming:rhubarb_3", "farming:blueberry_4",
  278. "farming:beetroot_5", "farming:sunflower_8",
  279. "farming:eggplant_3"}, nil, nil, nil, ethereal.grassy)
  280. add_node({"default:dirt_with_grass"}, 0.002, {"jumble"}, 1, 100,
  281. {"farming:carrot_7", "farming:cucumber_4", "farming:potato_3", "farming:vanilla_7",
  282. "farming:tomato_7", "farming:corn_8", "farming:coffee_5", "farming:blackberry_4",
  283. "farming:raspberry_4", "farming:rhubarb_3", "farming:blueberry_4",
  284. "farming:cabbage_6", "farming:lettuce_5",
  285. "farming:spinach_3"}, nil, nil, nil, ethereal.jumble)
  286. add_node({"ethereal:prairie_dirt"}, 0.025, {"prairie"}, 1, 100,
  287. {"farming:carrot_7", "farming:cucumber_4", "farming:potato_3", "farming:parsley_3",
  288. "farming:tomato_7", "farming:corn_8", "farming:coffee_5", "farming:blackberry_4",
  289. "farming:raspberry_4", "farming:rhubarb_3", "farming:blueberry_4",
  290. "farming:pea_5", "farming:beetroot_5", "farming:sunflower_8"}, nil, nil, nil,
  291. ethereal.prairie)
  292. add_node({"ethereal:grove_dirt"}, 0.002, {"mediterranean"}, 1, 100,
  293. {"farming:parsley_3"}, nil, nil, nil, ethereal.mediterranean)
  294. -- melon and pumpkin
  295. add_node({"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"},
  296. 0.001, {"junglee"}, 1, 1, {"farming:melon_8", "farming:pumpkin_8"},
  297. nil, "default:water_source", 1, ethereal.junglee)
  298. add_node({"default:dirt_with_grass"}, 0.001, {"deciduous_forest"}, 1, 1,
  299. {"farming:melon_8", "farming:pumpkin_8"}, nil, "default:water_source",
  300. 1, ethereal.grassy)
  301. add_node({"default:dirt_with_grass"}, 0.001, {"grassytwo"}, 1, 1,
  302. {"farming:melon_8", "farming:pumpkin_8"}, nil, "default:water_source",
  303. 1, ethereal.grassytwo)
  304. add_node({"default:dirt_with_grass"}, 0.001, {"jumble"}, 1, 1,
  305. {"farming:melon_8", "farming:pumpkin_8"}, nil, "default:water_source",
  306. 1, ethereal.jumble)
  307. -- mint
  308. add_node({"default:dirt_with_grass", "default:dirt_with_coniferous_litter",
  309. "ethereal:bamboo_dirt"}, 0.005, nil, 1, 75, "farming:mint_4", nil,
  310. {"group:water", "group:sand"}, 1, 1)
  311. -- green beans
  312. add_node({"default:dirt_with_grass"}, 0.001, {"grassytwo"}, 1, 100,
  313. {"farming:beanbush"}, nil, nil, nil, ethereal.grassytwo)
  314. -- grape bushel
  315. add_node({"default:dirt_with_grass"}, 0.001, {"grassytwo"}, 1, 100,
  316. {"farming:grapebush"}, nil, nil, nil, ethereal.grassytwo)
  317. add_node({"default:dirt_with_grass"}, 0.001, {"deciduous_forest"}, 1, 100,
  318. {"farming:grapebush"}, nil, nil, nil, ethereal.grassy)
  319. add_node({"ethereal:prairie_dirt"}, 0.001, {"prairie"}, 1, 100,
  320. {"farming:grapebush"}, nil, nil, nil, ethereal.prairie)
  321. minetest.register_decoration({
  322. deco_type = "simple",
  323. place_on = {"default:dirt_with_grass", "ethereal:prairie_dirt",
  324. "default:dirt_with_rainforest_litter"},
  325. sidelen = 16,
  326. noise_params = {
  327. offset = 0,
  328. scale = 0.002,
  329. spread = {x = 100, y = 100, z = 100},
  330. seed = 760,
  331. octaves = 3,
  332. persist = 0.6
  333. },
  334. y_min = 5,
  335. y_max = 35,
  336. decoration = {
  337. "farming:chili_8", "farming:garlic_5", "farming:pepper_5", "farming:pepper_6",
  338. "farming:onion_5", "farming:hemp_7", "farming:pepper_7", "farming:soy_5",
  339. "farming:ginger"
  340. },
  341. spawn_by = "group:tree",
  342. num_spawn_by = 1
  343. })
  344. minetest.register_decoration({
  345. deco_type = "simple",
  346. place_on = {"default:dirt_with_dry_grass"},
  347. sidelen = 16,
  348. noise_params = {
  349. offset = 0,
  350. scale = 0.002,
  351. spread = {x = 100, y = 100, z = 100},
  352. seed = 917,
  353. octaves = 3,
  354. persist = 0.6
  355. },
  356. y_min = 18,
  357. y_max = 30,
  358. decoration = {"farming:pineapple_8", "farming:soy_5"}
  359. })
  360. minetest.register_decoration({
  361. deco_type = "simple",
  362. place_on = {"ethereal:grove_dirt"},
  363. sidelen = 16,
  364. noise_params = {
  365. offset = 0,
  366. scale = 0.002,
  367. spread = {x = 100, y = 100, z = 100},
  368. seed = 448,
  369. octaves = 3,
  370. persist = 0.6
  371. },
  372. y_min = 15,
  373. y_max = 40,
  374. decoration = {"farming:artichoke_5"},
  375. spawn_by = "group:tree",
  376. num_spawn_by = 1
  377. })
  378. end
  379. -- is baked clay mod active? add new flowers if so
  380. if minetest.get_modpath("bakedclay") then
  381. minetest.register_decoration({
  382. deco_type = "simple",
  383. place_on = {
  384. "ethereal:prairie_dirt", "default:dirt_with_grass",
  385. "ethereal:grove_dirt"
  386. },
  387. sidelen = 16,
  388. noise_params = {
  389. offset = 0,
  390. scale = 0.004,
  391. spread = {x = 100, y = 100, z = 100},
  392. seed = 7133,
  393. octaves = 3,
  394. persist = 0.6
  395. },
  396. y_min = 10,
  397. y_max = 90,
  398. decoration = "bakedclay:delphinium"
  399. })
  400. minetest.register_decoration({
  401. deco_type = "simple",
  402. place_on = {
  403. "ethereal:prairie_dirt", "default:dirt_with_grass",
  404. "ethereal:grove_dirt", "ethereal:bamboo_dirt"
  405. },
  406. sidelen = 16,
  407. noise_params = {
  408. offset = 0,
  409. scale = 0.004,
  410. spread = {x = 100, y = 100, z = 100},
  411. seed = 7134,
  412. octaves = 3,
  413. persist = 0.6
  414. },
  415. y_min = 15,
  416. y_max = 90,
  417. decoration = "bakedclay:thistle"
  418. })
  419. minetest.register_decoration({
  420. deco_type = "simple",
  421. place_on = {"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"},
  422. sidelen = 16,
  423. noise_params = {
  424. offset = 0,
  425. scale = 0.01,
  426. spread = {x = 100, y = 100, z = 100},
  427. seed = 7135,
  428. octaves = 3,
  429. persist = 0.6
  430. },
  431. y_min = 1,
  432. y_max = 90,
  433. decoration = "bakedclay:lazarus",
  434. spawn_by = "default:jungletree",
  435. num_spawn_by = 1
  436. })
  437. minetest.register_decoration({
  438. deco_type = "simple",
  439. place_on = {"default:dirt_with_grass", "default:sand"},
  440. sidelen = 16,
  441. noise_params = {
  442. offset = 0,
  443. scale = 0.009,
  444. spread = {x = 100, y = 100, z = 100},
  445. seed = 7136,
  446. octaves = 3,
  447. persist = 0.6
  448. },
  449. y_min = 1,
  450. y_max = 15,
  451. decoration = "bakedclay:mannagrass",
  452. spawn_by = "group:water",
  453. num_spawn_by = 1
  454. })
  455. end
  456. if ethereal.desert == 1 and minetest.get_modpath("wine") then
  457. minetest.register_decoration({
  458. deco_type = "simple",
  459. place_on = {"default:desert_sand"},
  460. sidelen = 16,
  461. fill_ratio = 0.001,
  462. biomes = {"desert"},
  463. decoration = {"wine:blue_agave"}
  464. })
  465. end
  466. if ethereal.snowy == 1 and minetest.registered_nodes["default:fern_1"] then
  467. local function register_fern_decoration(seed, length)
  468. minetest.register_decoration({
  469. name = "default:fern_" .. length,
  470. deco_type = "simple",
  471. place_on = {
  472. "ethereal:cold_dirt", "default:dirt_with_coniferous_litter"},
  473. sidelen = 16,
  474. noise_params = {
  475. offset = 0,
  476. scale = 0.2,
  477. spread = {x = 100, y = 100, z = 100},
  478. seed = seed,
  479. octaves = 3,
  480. persist = 0.7
  481. },
  482. y_max = 31000,
  483. y_min = 6,
  484. decoration = "default:fern_" .. length
  485. })
  486. end
  487. register_fern_decoration(14936, 3)
  488. register_fern_decoration(801, 2)
  489. register_fern_decoration(5, 1)
  490. end
  491. if ethereal.tundra == 1 and minetest.registered_nodes["default:permafrost"] then
  492. -- Tundra moss
  493. minetest.register_decoration({
  494. deco_type = "simple",
  495. place_on = {"default:permafrost_with_stones"},
  496. sidelen = 4,
  497. noise_params = {
  498. offset = -0.8,
  499. scale = 2.0,
  500. spread = {x = 100, y = 100, z = 100},
  501. seed = 53995,
  502. octaves = 3,
  503. persist = 1.0
  504. },
  505. biomes = {"tundra"},
  506. y_max = 50,
  507. y_min = 2,
  508. decoration = "default:permafrost_with_moss",
  509. place_offset_y = -1,
  510. flags = "force_placement"
  511. })
  512. -- Tundra patchy snow
  513. minetest.register_decoration({
  514. deco_type = "simple",
  515. place_on = {
  516. "default:permafrost_with_moss",
  517. "default:permafrost_with_stones",
  518. "default:stone",
  519. "default:gravel"
  520. },
  521. sidelen = 4,
  522. noise_params = {
  523. offset = 0,
  524. scale = 1.0,
  525. spread = {x = 100, y = 100, z = 100},
  526. seed = 172555,
  527. octaves = 3,
  528. persist = 1.0
  529. },
  530. biomes = {"tundra", "tundra_beach"},
  531. y_max = 50,
  532. y_min = 1,
  533. decoration = "default:snow"
  534. })
  535. end
  536. if minetest.get_modpath("butterflies") then
  537. minetest.register_decoration({
  538. name = "butterflies:butterfly",
  539. deco_type = "simple",
  540. place_on = {"default:dirt_with_grass", "ethereal:prairie_dirt"},
  541. place_offset_y = 2,
  542. sidelen = 80,
  543. fill_ratio = 0.005,
  544. biomes = {"deciduous_forest", "grassytwo", "prairie", "jumble"},
  545. y_max = 31000,
  546. y_min = 1,
  547. decoration = {
  548. "butterflies:butterfly_white",
  549. "butterflies:butterfly_red",
  550. "butterflies:butterfly_violet"
  551. },
  552. spawn_by = "group:flower",
  553. num_spawn_by = 1
  554. })
  555. -- restart butterfly timers
  556. minetest.register_lbm({
  557. name = ":butterflies:butterfly_timer",
  558. nodenames = {
  559. "butterflies:butterfly_white", "butterflies:butterfly_red",
  560. "butterflies:butterfly_violet"
  561. },
  562. run_at_every_load = true,
  563. action = function(pos)
  564. minetest.get_node_timer(pos):start(5)
  565. end
  566. })
  567. end
  568. if minetest.get_modpath("fireflies") then
  569. minetest.register_decoration({
  570. name = "fireflies:firefly_low",
  571. deco_type = "simple",
  572. place_on = {
  573. "default:dirt_with_grass",
  574. "default:dirt_with_coniferous_litter",
  575. "default:dirt_with_rainforest_litter",
  576. "default:dirt",
  577. "ethereal:cold_dirt", "prairie"
  578. },
  579. place_offset_y = 2,
  580. sidelen = 80,
  581. fill_ratio = 0.0005,
  582. biomes = {
  583. "deciduous_forest", "grassytwo", "coniferous_forest", "junglee", "swamp"},
  584. y_max = 31000,
  585. y_min = -1,
  586. decoration = "fireflies:hidden_firefly"
  587. })
  588. -- restart firefly timers
  589. minetest.register_lbm({
  590. name = ":fireflies:firefly_timer",
  591. nodenames = {"fireflies:firefly", "fireflies:hidden_firefly"},
  592. run_at_every_load = true,
  593. action = function(pos)
  594. minetest.get_node_timer(pos):start(5)
  595. end
  596. })
  597. end
  598. -- Coral Reef (Minetest 5.0)
  599. if minetest.registered_nodes["default:coral_green"] then
  600. minetest.register_decoration({
  601. name = "default:corals",
  602. deco_type = "simple",
  603. place_on = {"default:sand"},
  604. place_offset_y = -1,
  605. sidelen = 4,
  606. noise_params = {
  607. offset = -4,
  608. scale = 4,
  609. spread = {x = 50, y = 50, z = 50},
  610. seed = 7013,
  611. octaves = 3,
  612. persist = 0.7,
  613. },
  614. biomes = {"desert_ocean", "savanna_ocean", "junglee_ocean"},
  615. y_max = -2,
  616. y_min = -8,
  617. flags = "force_placement",
  618. decoration = {
  619. "default:coral_green", "default:coral_pink",
  620. "default:coral_cyan", "default:coral_brown",
  621. "default:coral_orange", "default:coral_skeleton"
  622. }
  623. })
  624. -- Kelp
  625. minetest.register_decoration({
  626. name = "default:kelp",
  627. deco_type = "simple",
  628. place_on = {"default:sand"},
  629. place_offset_y = -1,
  630. sidelen = 16,
  631. noise_params = {
  632. offset = -0.04,
  633. scale = 0.1,
  634. spread = {x = 200, y = 200, z = 200},
  635. seed = 87112,
  636. octaves = 3,
  637. persist = 0.7
  638. },
  639. biomes = {
  640. "frost_ocean", "deciduous_forest_ocean", "sandstone_ocean", "swamp_ocean"},
  641. y_max = -5,
  642. y_min = -10,
  643. flags = "force_placement",
  644. decoration = "default:sand_with_kelp",
  645. param2 = 48,
  646. param2_max = 96
  647. })
  648. end
  649. local random = math.random
  650. -- Generate Illumishroom in caves on top of coal
  651. minetest.register_on_generated(function(minp, maxp)
  652. if minp.y > -30 or maxp.y < -3000 then
  653. return
  654. end
  655. local bpos
  656. local coal = minetest.find_nodes_in_area_under_air(
  657. minp, maxp, "default:stone_with_coal")
  658. for n = 1, #coal do
  659. if random(2) == 1 then
  660. bpos = {x = coal[n].x, y = coal[n].y + 1, z = coal[n].z}
  661. if bpos.y > -3000 and bpos.y < -2000 then
  662. minetest.swap_node(bpos, {name = "ethereal:illumishroom3"})
  663. elseif bpos.y > -2000 and bpos.y < -1000 then
  664. minetest.swap_node(bpos, {name = "ethereal:illumishroom2"})
  665. elseif bpos.y > -1000 and bpos.y < -30 then
  666. minetest.swap_node(bpos, {name = "ethereal:illumishroom"})
  667. end
  668. end
  669. end
  670. end)