schems.lua 8.7 KB

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