Repository for the time_travel mod.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

dimensions.lua 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  1. multidimensions.clear_dimensions() -- clear all dimensions
  2. local ores={
  3. ["default:stone_with_coal"]=200,
  4. ["default:stone_with_iron"]=400,
  5. ["default:stone_with_copper"]=500,
  6. ["default:stone_with_gold"]=2000,
  7. ["default:stone_with_mese"]=10000,
  8. ["default:stone_with_diamond"]=20000,
  9. ["default:mese"]=40000,
  10. ["default:stone_with_metamese"]=40000,
  11. ["default:gravel"]={chance=3000,chunk=2,}
  12. }
  13. --Dinosaur Age Dimension
  14. multidimensions.register_dimension("dinosaur_age",{
  15. ground_ores = {
  16. ["default:fern_1"] = 2,
  17. ["default:fern_2"] = 4,
  18. ["default:fern_3"] = 8,
  19. ["default:junglegrass"] = 16,
  20. ["default:grass_5"] = 16,
  21. ["paleotest:Cycad"] = 32,
  22. ["paleotest:Horsetails"] = 32,
  23. ["time_travel:jungle_tree"] = 256,
  24. },
  25. stone_ores = table.copy(ores), -- works as above, but in stone
  26. dirt_ores = {},
  27. grass_ores = {},
  28. air_ores = {},
  29. water_ores = {},
  30. sand_ores = {},
  31. self = {}, -- can contain everything, var like dirt="default:dirt" will be remade to dirt=content_id
  32. dim_y = 2000, -- dimension start (don't change if you don't know what you're doing)
  33. dim_height = 999, -- dimension height
  34. dirt_start = 501, -- when dirt begins to appear (default is 501)
  35. dirt_depth = 3, -- dirt depth
  36. ground_limit = 530, -- ground y limit (ground ends here)
  37. water_depth = 8, -- depth fron ground and down
  38. enable_water = nil, -- (nil = true)
  39. terrain_density = 0.4, -- or ground density
  40. flatland = nil, -- (nil = false)
  41. teleporter = false, -- (nil = true) dimension teleporter
  42. gravity = 1, -- (1 = default) dimension gravity
  43. stone = "default:stone",
  44. dirt = "default:dirt",
  45. grass = "default:dirt_with_coniferous_litter",
  46. air = "air",
  47. water = "default:water_source",
  48. sand = "default:sand",
  49. bedrock = "multidimensions:bedrock", -- at dimension edges
  50. map = {
  51. offset = 0,
  52. scale = 1,
  53. spread = {x=100,y=18,z=100},
  54. seeddiff = 24,
  55. octaves = 5,
  56. persist = 0.7,
  57. lacunarity = 1,
  58. flags = "absvalue",
  59. },
  60. --[[
  61. craft = { -- teleport craft recipe
  62. {"default:obsidianbrick", "default:steel_ingot", "default:obsidianbrick"},
  63. {"default:wood","default:mese","default:wood",},
  64. {"default:obsidianbrick", "default:steel_ingot", "default:obsidianbrick"},
  65. },
  66. ]]
  67. --[[
  68. on_generate=function(self,data,id,area,x,y,z)
  69. if y <= self.dirt_start+5 then
  70. data[id] = self.air
  71. else
  72. return
  73. end
  74. return data -- to return changes
  75. end,
  76. ]]
  77. -- data: active generating area (VoxelArea)
  78. -- index: data index
  79. -- self: {dim_start, dim_end, dim_height, ground_limit, heat, humidity, dirt, stone, grass, air, water, sand, bedrock ... and your inputs
  80. ----area: (VoxelArea:new({MinEd...})
  81. sky = {{r=79, g=165, b=92},"plain",{}}, -- same as:set_sky()
  82. on_enter=function(player) --on enter dimension
  83. --pos = player:get_pos()
  84. ----pos.y = pos.y - 1
  85. --if minetest.get_node({pos.x, pos.y-1, pos.z}) ~= "multidimensions:teleporter0" and minetest.get_node(pos) ~= "multidimensions:teleporter0" then
  86. -- minetest.set_node(pos, {name="multidimensions:teleporter0"})
  87. --end
  88. end,
  89. on_leave=function(player) --on leave dimension
  90. end,
  91. })
  92. --Ice Age Dimension
  93. multidimensions.register_dimension("ice_age",{
  94. ground_ores = {
  95. ["default:snow"] = 100,
  96. ["time_travel:snowy_pine_tree"] = 8000,
  97. },
  98. stone_ores = table.copy(ores), -- works as above, but in stone
  99. dirt_ores = {},
  100. grass_ores = {},
  101. air_ores = {},
  102. water_ores = {},
  103. sand_ores = {},
  104. self = {}, -- can contain everything, var like dirt="default:dirt" will be remade to dirt=content_id
  105. dim_y = 3000, -- dimension start (don't change if you don't know what you're doing)
  106. dim_height = 999, -- dimension height
  107. dirt_start = 501, -- when dirt begins to appear (default is 501)
  108. dirt_depth = 3, -- dirt depth
  109. ground_limit = 530, -- ground y limit (ground ends here)
  110. water_depth = 8, -- depth fron ground and down
  111. enable_water = nil, -- (nil = true)
  112. terrain_density = 0.4, -- or ground density
  113. flatland = nil, -- (nil = false)
  114. teleporter = false, -- (nil = true) dimension teleporter
  115. gravity = 1, -- (1 = default) dimension gravity
  116. stone = "default:stone",
  117. dirt = "default:dirt",
  118. grass = "default:dirt_with_snow",
  119. air = "air",
  120. water = "default:ice",
  121. sand = "default:gravel",
  122. bedrock = "multidimensions:bedrock", -- at dimension edges
  123. map = {
  124. offset = 0,
  125. scale = 1,
  126. spread = {x=100,y=18,z=100},
  127. seeddiff = 24,
  128. octaves = 5,
  129. persist = 0.7,
  130. lacunarity = 1,
  131. flags = "absvalue",
  132. },
  133. --[[
  134. craft = { -- teleport craft recipe
  135. {"default:obsidianbrick", "default:steel_ingot", "default:obsidianbrick"},
  136. {"default:wood","default:mese","default:wood",},
  137. {"default:obsidianbrick", "default:steel_ingot", "default:obsidianbrick"},
  138. },
  139. ]]
  140. --[[
  141. on_generate=function(self,data,id,area,x,y,z)
  142. if y <= self.dirt_start+5 then
  143. data[id] = self.air
  144. else
  145. return
  146. end
  147. return data -- to return changes
  148. end,
  149. ]]
  150. -- data: active generating area (VoxelArea)
  151. -- index: data index
  152. -- self: {dim_start, dim_end, dim_height, ground_limit, heat, humidity, dirt, stone, grass, air, water, sand, bedrock ... and your inputs
  153. ----area: (VoxelArea:new({MinEd...})
  154. --sky = {{r=219, g=168, b=117},"plain",{}}, -- same as:set_sky()
  155. on_enter=function(player) --on enter dimension
  156. end,
  157. on_leave=function(player) --on leave dimension
  158. end,
  159. })
  160. --Prehistoric Australia Dimension
  161. multidimensions.register_dimension("prehistoric_australia",{
  162. ground_ores = {
  163. ["default:dry_grass_1"] = 25,
  164. ["time_travel:tree"] = 30000,
  165. },
  166. stone_ores = table.copy(ores), -- works as above, but in stone
  167. dirt_ores = {},
  168. grass_ores = {
  169. ["time_travel:australia_red_dirt"] = 100,
  170. },
  171. air_ores = {},
  172. water_ores = {},
  173. sand_ores = {
  174. ["default:water_source"] = 300,
  175. },
  176. self = {}, -- can contain everything, var like dirt="default:dirt" will be remade to dirt=content_id
  177. dim_y = 4000, -- dimension start (don't change if you don't know what you're doing)
  178. dim_height = 999, -- dimension height
  179. dirt_start = 501, -- when dirt begins to appear (default is 501)
  180. dirt_depth = 3, -- dirt depth
  181. ground_limit = 530, -- ground y limit (ground ends here)
  182. water_depth = 8, -- depth fron ground and down
  183. enable_water = nil, -- (nil = true)
  184. terrain_density = 0.4, -- or ground density
  185. flatland = nil, -- (nil = false)
  186. teleporter = false, -- (nil = true) dimension teleporter
  187. gravity = 1, -- (1 = default) dimension gravity
  188. stone = "default:stone",
  189. dirt = "time_travel:australia_red_stone",
  190. grass = "time_travel:australia_red_gravel",
  191. air = "air",
  192. water = "air",
  193. sand = "time_travel:australia_red_sand",
  194. bedrock = "multidimensions:bedrock", -- at dimension edges
  195. map = {
  196. offset = 0,
  197. scale = 1,
  198. spread = {x=100,y=18,z=100},
  199. seeddiff = 24,
  200. octaves = 5,
  201. persist = 0.7,
  202. lacunarity = 1,
  203. flags = "absvalue",
  204. },
  205. --[[
  206. craft = { -- teleport craft recipe
  207. {"default:obsidianbrick", "default:steel_ingot", "default:obsidianbrick"},
  208. {"default:wood","default:mese","default:wood",},
  209. {"default:obsidianbrick", "default:steel_ingot", "default:obsidianbrick"},
  210. },
  211. ]]
  212. --[[
  213. on_generate=function(self,data,id,area,x,y,z)
  214. if y <= self.dirt_start+5 then
  215. data[id] = self.air
  216. else
  217. return
  218. end
  219. return data -- to return changes
  220. end,
  221. ]]
  222. -- data: active generating area (VoxelArea)
  223. -- index: data index
  224. -- self: {dim_start, dim_end, dim_height, ground_limit, heat, humidity, dirt, stone, grass, air, water, sand, bedrock ... and your inputs
  225. ----area: (VoxelArea:new({MinEd...})
  226. --sky = {{r=219, g=168, b=117},"plain",{}}, -- same as:set_sky()
  227. on_enter=function(player) --on enter dimension
  228. end,
  229. on_leave=function(player) --on leave dimension
  230. end,
  231. })
  232. --Water Age Dimension
  233. minetest.register_ore({
  234. ore_type = "stratum",
  235. ore = "multidimensions:bedrock",
  236. wherein = "air",
  237. --clust_scarcity = 9 * 9 * 9,
  238. --clust_num_ores = 12,
  239. --clust_size = 3,
  240. y_min = 5000,
  241. y_max = 5000,
  242. --biomes = {},
  243. np_stratum_thickness = {
  244. offset = 8,
  245. scale = 4,
  246. spread = {x = 100, y = 100, z = 100},
  247. seed = 17,
  248. octaves = 3,
  249. persist = 0.7
  250. },
  251. stratum_thickness = 1,
  252. })
  253. minetest.register_ore({
  254. ore_type = "stratum",
  255. ore = "default:stone",
  256. wherein = "air",
  257. --clust_scarcity = 9 * 9 * 9,
  258. --clust_num_ores = 12,
  259. --clust_size = 3,
  260. y_min = 5001,
  261. y_max = 5500,
  262. --biomes = {},
  263. np_stratum_thickness = {
  264. offset = 8,
  265. scale = 4,
  266. spread = {x = 100, y = 100, z = 100},
  267. seed = 17,
  268. octaves = 3,
  269. persist = 0.7
  270. },
  271. stratum_thickness = 500,
  272. })
  273. minetest.register_ore({
  274. ore_type = "stratum",
  275. ore = "default:sand",
  276. wherein = "air",
  277. --clust_scarcity = 9 * 9 * 9,
  278. --clust_num_ores = 12,
  279. --clust_size = 3,
  280. y_min = 5501,
  281. y_max = 5501,
  282. --biomes = {},
  283. np_stratum_thickness = {
  284. offset = 8,
  285. scale = 4,
  286. spread = {x = 100, y = 100, z = 100},
  287. seed = 17,
  288. octaves = 3,
  289. persist = 0.7
  290. },
  291. stratum_thickness = 1,
  292. })
  293. minetest.register_ore({
  294. ore_type = "stratum",
  295. ore = "default:water_source",
  296. wherein = "air",
  297. --clust_scarcity = 9 * 9 * 9,
  298. --clust_num_ores = 12,
  299. --clust_size = 3,
  300. y_min = 5502,
  301. y_max = 5511,
  302. --biomes = {},
  303. np_stratum_thickness = {
  304. offset = 8,
  305. scale = 4,
  306. spread = {x = 100, y = 100, z = 100},
  307. seed = 17,
  308. octaves = 3,
  309. persist = 0.7
  310. },
  311. stratum_thickness = 10,
  312. })
  313. --[[
  314. minetest.register_ore({
  315. ore_type = "scatter",
  316. ore = "time_travel:coral_reef",
  317. wherein = "default:water_source",
  318. clust_scarcity = 7 * 7 * 7,
  319. clust_num_ores = 5,
  320. clust_size = 1,
  321. y_min = 5501,
  322. y_max = 5502,
  323. })
  324. ]]
  325. minetest.register_ore({
  326. ore_type = "scatter",
  327. ore = "default:coral_orange",
  328. wherein = "default:water_source",
  329. clust_scarcity = 7 * 7 * 7,
  330. clust_num_ores = 5,
  331. clust_size = 1,
  332. y_min = 5501,
  333. y_max = 5502,
  334. })
  335. minetest.register_ore({
  336. ore_type = "scatter",
  337. ore = "default:coral_brown",
  338. wherein = "default:water_source",
  339. clust_scarcity = 7 * 7 * 7,
  340. clust_num_ores = 5,
  341. clust_size = 1,
  342. y_min = 5501,
  343. y_max = 5502,
  344. })
  345. --LBMs and ABMs
  346. minetest.register_lbm({
  347. name = "time_travel:tree_lbm",
  348. run_at_every_load = true,
  349. nodenames = {"time_travel:jungle_tree", "time_travel:snowy_pine_tree", "time_travel:tree"},
  350. action = function(pos, node)
  351. minetest.set_node(pos, {name = "air"})
  352. local tree=""
  353. if node.name=="time_travel:jungle_tree" then
  354. tree=minetest.get_modpath("default") .. "/schematics/jungle_tree.mts"
  355. elseif node.name=="time_travel:snowy_pine_tree" then
  356. tree=minetest.get_modpath("default") .. "/schematics/snowy_pine_tree_from_sapling.mts"
  357. elseif node.name=="time_travel:tree" then
  358. tree=minetest.get_modpath("default") .. "/schematics/apple_tree.mts"
  359. end
  360. minetest.place_schematic({x=pos.x,y=pos.y,z=pos.z}, tree, "random", {}, true)
  361. end,
  362. })
  363. --[[
  364. minetest.register_lbm({
  365. name = "time_travel:coral_reef_lbm",
  366. run_at_every_load = true,
  367. nodenames = {"time_travel:coral_reef"},
  368. action = function(pos, node)
  369. minetest.set_node(pos, {name = "default:water_source"})
  370. local coral_reef=""
  371. --if node.name=="time_travel:coral_reef" then
  372. coral_reef=minetest.get_modpath("default") .. "/schematics/corals.mts"
  373. --end
  374. minetest.place_schematic(pos, coral_reef, "random", {}, true)
  375. end
  376. })
  377. ]]
  378. minetest.register_abm({
  379. nodenames = {"time_travel:australia_red_dirt"},
  380. neighbors = {"default:water_source", "default:water_flowing"},
  381. interval = 5.0,
  382. chance = 1,
  383. action = function(pos, node, active_object_count,
  384. active_object_count_wider)
  385. local pos = {x = pos.x, y = pos.y, z = pos.z}
  386. minetest.set_node(pos, {name = "default:dirt"})
  387. end
  388. })