schems.lua 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. local path = minetest.get_modpath("ethereal") .. "/schematics/"
  2. local dpath = minetest.get_modpath("default") .. "/schematics/"
  3. -- load schematic tables
  4. dofile(path .. "orange_tree.lua")
  5. dofile(path .. "banana_tree.lua")
  6. dofile(path .. "bamboo_tree.lua")
  7. dofile(path .. "birch_tree.lua")
  8. dofile(path .. "bush.lua")
  9. dofile(path .. "waterlily.lua")
  10. dofile(path .. "volcanom.lua")
  11. dofile(path .. "volcanol.lua")
  12. dofile(path .. "frosttrees.lua")
  13. dofile(path .. "palmtree.lua")
  14. dofile(path .. "pinetree.lua")
  15. dofile(path .. "yellowtree.lua")
  16. dofile(path .. "mushroomone.lua")
  17. dofile(path .. "willow.lua")
  18. dofile(path .. "bigtree.lua")
  19. dofile(path .. "redwood_tree.lua")
  20. dofile(path .. "vinetree.lua")
  21. dofile(path .. "sakura.lua")
  22. dofile(path .. "igloo.lua")
  23. -- helper function
  24. local add_schem = function(a, b, c, d, e, f, g, h, i, j, k)
  25. -- if not 1 then biome disabled, don't add
  26. if g ~= 1 then return end
  27. minetest.register_decoration({
  28. deco_type = "schematic",
  29. place_on = a,
  30. sidelen = 80,
  31. fill_ratio = b,
  32. biomes = c,
  33. y_min = d,
  34. y_max = e,
  35. schematic = f,
  36. flags = "place_center_x, place_center_z",
  37. replacements = h,
  38. spawn_by = i,
  39. num_spawn_by = j,
  40. rotation = k,
  41. })
  42. end
  43. -- igloo
  44. add_schem("default:snowblock", 0.0005, {"glacier"}, 3, 50,
  45. ethereal.igloo, ethereal.glacier, nil, "default:snowblock", 8, "random")
  46. -- sakura tree
  47. add_schem({"ethereal:bamboo_dirt"}, 0.01, {"sakura"}, 7, 100,
  48. ethereal.sakura_tree, ethereal.sakura, nil,
  49. "ethereal:bamboo_dirt", 6)
  50. -- redwood tree
  51. add_schem({"default:dirt_with_dry_grass"}, 0.0025, {"mesa"}, 1, 100,
  52. ethereal.redwood_tree, ethereal.mesa, nil,
  53. "default:dirt_with_dry_grass", 8)
  54. -- banana tree
  55. add_schem({"ethereal:grove_dirt"}, 0.015, {"grove"}, 1, 100,
  56. ethereal.bananatree, ethereal.grove)
  57. -- healing tree
  58. add_schem({"default:dirt_with_snow"}, 0.01, {"alpine"}, 120, 140,
  59. ethereal.yellowtree, ethereal.alpine)
  60. -- crystal frost tree
  61. add_schem({"ethereal:crystal_dirt"}, 0.01, {"frost"}, 1, 100,
  62. ethereal.frosttrees, ethereal.frost, nil,
  63. "ethereal:crystal_dirt", 6)
  64. -- giant mushroom
  65. add_schem("ethereal:mushroom_dirt", 0.02, {"mushroom"}, 1, 100,
  66. ethereal.mushroomone, ethereal.mushroom, nil,
  67. "ethereal:mushroom_dirt", 8)
  68. -- small lava crater
  69. add_schem("ethereal:fiery_dirt", 0.01, {"fiery"}, 1, 100,
  70. ethereal.volcanom, ethereal.fiery, nil, "ethereal:fiery_dirt", 8)
  71. -- large lava crater
  72. add_schem("ethereal:fiery_dirt", 0.003, {"fiery"}, 1, 100,
  73. ethereal.volcanol, ethereal.fiery, nil, "ethereal:fiery_dirt", 8, "random")
  74. -- default jungle tree
  75. add_schem({"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"},
  76. 0.08, {"junglee"}, 1, 100, dpath .. "jungle_tree.mts", ethereal.junglee)
  77. -- willow tree
  78. add_schem({"ethereal:gray_dirt"}, 0.02, {"grayness"}, 1, 100,
  79. ethereal.willow, ethereal.grayness, nil,
  80. "ethereal:gray_dirt", 6)
  81. -- default large pine tree for lower elevation
  82. add_schem({"ethereal:cold_dirt", "default:dirt_with_coniferous_litter"},
  83. 0.025, {"snowy"}, 10, 40, ethereal.pinetree, ethereal.snowy)
  84. -- small pine for higher elevation
  85. add_schem({"default:dirt_with_snow"}, 0.025, {"alpine"}, 40, 140,
  86. ethereal.pinetree, ethereal.alpine)
  87. -- default apple tree
  88. add_schem({"default:dirt_with_grass"}, 0.025, {"jumble", "grassy"}, 1, 100,
  89. dpath .. "apple_tree.mts", ethereal.grassy)
  90. -- big old tree
  91. add_schem({"default:dirt_with_grass"}, 0.001, {"jumble"}, 1, 100,
  92. ethereal.bigtree, ethereal.jumble, nil,
  93. "default:dirt_with_grass", 8)
  94. -- default aspen tree
  95. add_schem({"default:dirt_with_grass"}, 0.02, {"grassytwo"}, 1, 50,
  96. dpath .. "aspen_tree.mts", ethereal.jumble)
  97. -- birch tree
  98. add_schem({"default:dirt_with_grass"}, 0.02, {"grassytwo"}, 50, 100,
  99. ethereal.birchtree, ethereal.grassytwo)
  100. -- orange tree
  101. add_schem({"ethereal:prairie_dirt"}, 0.01, {"prairie"}, 1, 100,
  102. ethereal.orangetree, ethereal.prairie)
  103. -- default acacia tree
  104. add_schem({"default:dry_dirt_with_dry_grass",
  105. "default:dirt_with_dry_grass"}, 0.004, {"savanna"}, 1, 100,
  106. dpath .. "acacia_tree.mts", ethereal.savanna)
  107. -- palm tree
  108. add_schem("default:sand", 0.0025, {"desert_ocean", "plains_ocean", "sandclay",
  109. "sandstone_ocean", "mesa_ocean", "grove_ocean", "grassy_ocean"}, 1, 1,
  110. ethereal.palmtree, 1)
  111. -- bamboo tree
  112. add_schem({"ethereal:bamboo_dirt"}, 0.025, {"bamboo"}, 1, 100,
  113. ethereal.bambootree, ethereal.bamboo)
  114. -- bush
  115. add_schem({"ethereal:bamboo_dirt"}, 0.08, {"bamboo"}, 1, 100, ethereal.bush,
  116. ethereal.bamboo)
  117. -- vine tree
  118. add_schem({"default:dirt_with_grass"}, 0.02, {"swamp"}, 1, 100,
  119. ethereal.vinetree, ethereal.swamp)
  120. -- default large cactus
  121. if ethereal.desert == 1 then
  122. minetest.register_decoration({
  123. deco_type = "schematic",
  124. place_on = {"default:desert_sand"},
  125. sidelen = 80,
  126. noise_params = {
  127. offset = -0.0005,
  128. scale = 0.0015,
  129. spread = {x = 200, y = 200, z = 200},
  130. seed = 230,
  131. octaves = 3,
  132. persist = 0.6
  133. },
  134. biomes = {"desert"},
  135. y_min = 5,
  136. y_max = 31000,
  137. schematic = dpath .. "large_cactus.mts",
  138. flags = "place_center_x",
  139. rotation = "random",
  140. })
  141. end
  142. -- default bush
  143. minetest.register_decoration({
  144. deco_type = "schematic",
  145. place_on = {"default:dirt_with_grass", "default:dirt_with_snow"},
  146. sidelen = 16,
  147. noise_params = {
  148. offset = -0.004,
  149. scale = 0.01,
  150. spread = {x = 100, y = 100, z = 100},
  151. seed = 137,
  152. octaves = 3,
  153. persist = 0.7,
  154. },
  155. biomes = {"grassy", "grassytwo", "jumble"},
  156. y_min = 1,
  157. y_max = 31000,
  158. schematic = dpath .. "bush.mts",
  159. flags = "place_center_x, place_center_z"
  160. })
  161. -- default acacia bush
  162. minetest.register_decoration({
  163. deco_type = "schematic",
  164. place_on = {
  165. "default:dirt_with_dry_grass", "default:dry_dirt_with_dry_grass"},
  166. sidelen = 16,
  167. noise_params = {
  168. offset = -0.004,
  169. scale = 0.01,
  170. spread = {x = 100, y = 100, z = 100},
  171. seed = 90155,
  172. octaves = 3,
  173. persist = 0.7,
  174. },
  175. biomes = {"savanna", "mesa"},
  176. y_min = 1,
  177. y_max = 31000,
  178. schematic = dpath .. "acacia_bush.mts",
  179. flags = "place_center_x, place_center_z"
  180. })
  181. -- default pine bush
  182. if minetest.registered_nodes["default:pine_bush"] then
  183. minetest.register_decoration({
  184. name = "default:pine_bush",
  185. deco_type = "schematic",
  186. place_on = {"default:dirt_with_snow"},
  187. sidelen = 16,
  188. noise_params = {
  189. offset = -0.004,
  190. scale = 0.01,
  191. spread = {x = 100, y = 100, z = 100},
  192. seed = 137,
  193. octaves = 3,
  194. persist = 0.7,
  195. },
  196. biomes = {"alpine"},
  197. y_max = 31000,
  198. y_min = 4,
  199. schematic = dpath .. "pine_bush.mts",
  200. flags = "place_center_x, place_center_z"
  201. })
  202. end
  203. -- default blueberry bush
  204. if minetest.registered_nodes["default:blueberry_bush_leaves"] then
  205. minetest.register_decoration({
  206. name = "default:blueberry_bush",
  207. deco_type = "schematic",
  208. place_on = {
  209. "default:dirt_with_coniferous_litter", "default:dirt_with_snow"},
  210. sidelen = 16,
  211. noise_params = {
  212. offset = -0.004,
  213. scale = 0.01,
  214. spread = {x = 100, y = 100, z = 100},
  215. seed = 697,
  216. octaves = 3,
  217. persist = 0.7,
  218. },
  219. biomes = {"snowy", "alpine"},
  220. y_max = 31000,
  221. y_min = 1,
  222. place_offset_y = 1,
  223. schematic = dpath .. "blueberry_bush.mts",
  224. flags = "place_center_x, place_center_z"
  225. })
  226. end
  227. -- place waterlily in beach areas
  228. minetest.register_decoration({
  229. deco_type = "schematic",
  230. place_on = {"default:sand"},
  231. sidelen = 16,
  232. noise_params = {
  233. offset = -0.12,
  234. scale = 0.3,
  235. spread = {x = 200, y = 200, z = 200},
  236. seed = 33,
  237. octaves = 3,
  238. persist = 0.7
  239. },
  240. biomes = {"desert_ocean", "plains_ocean", "sandclay",
  241. "mesa_ocean", "grove_ocean", "grassy_ocean", "swamp_ocean"},
  242. y_min = 0,
  243. y_max = 0,
  244. schematic = ethereal.waterlily,
  245. rotation = "random"
  246. })
  247. -- coral reef
  248. if ethereal.reefs == 1 then
  249. -- override corals so crystal shovel can pick them up intact
  250. minetest.override_item("default:coral_skeleton", {groups = {crumbly = 3}})
  251. minetest.override_item("default:coral_orange", {groups = {crumbly = 3}})
  252. minetest.override_item("default:coral_brown", {groups = {crumbly = 3}})
  253. minetest.register_decoration({
  254. deco_type = "schematic",
  255. place_on = {"default:sand"},
  256. noise_params = {
  257. offset = -0.15,
  258. scale = 0.1,
  259. spread = {x = 100, y = 100, z = 100},
  260. seed = 7013,
  261. octaves = 3,
  262. persist = 1,
  263. },
  264. biomes = {"desert_ocean", "grove_ocean"},
  265. y_min = -8,
  266. y_max = -2,
  267. schematic = path .. "corals.mts",
  268. flags = "place_center_x, place_center_z",
  269. rotation = "random"
  270. })
  271. end