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.

448 lines
12KB

  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. ["default:dry_shrub"] = 30000,
  165. ["time_travel:tree"] = 30000,
  166. },
  167. stone_ores = table.copy(ores), -- works as above, but in stone
  168. dirt_ores = {},
  169. grass_ores = {
  170. ["time_travel:australia_red_dirt"] = 100,
  171. },
  172. air_ores = {},
  173. water_ores = {},
  174. sand_ores = {
  175. ["default:water_source"] = 300,
  176. },
  177. self = {}, -- can contain everything, var like dirt="default:dirt" will be remade to dirt=content_id
  178. dim_y = 4000, -- dimension start (don't change if you don't know what you're doing)
  179. dim_height = 999, -- dimension height
  180. dirt_start = 501, -- when dirt begins to appear (default is 501)
  181. dirt_depth = 3, -- dirt depth
  182. ground_limit = 530, -- ground y limit (ground ends here)
  183. water_depth = 8, -- depth fron ground and down
  184. enable_water = nil, -- (nil = true)
  185. terrain_density = 0.4, -- or ground density
  186. flatland = nil, -- (nil = false)
  187. teleporter = false, -- (nil = true) dimension teleporter
  188. gravity = 1, -- (1 = default) dimension gravity
  189. stone = "default:stone",
  190. dirt = "time_travel:australia_red_stone",
  191. grass = "time_travel:australia_red_gravel",
  192. air = "air",
  193. water = "air",
  194. sand = "time_travel:australia_red_sand",
  195. bedrock = "multidimensions:bedrock", -- at dimension edges
  196. map = {
  197. offset = 0,
  198. scale = 1,
  199. spread = {x=100,y=18,z=100},
  200. seeddiff = 24,
  201. octaves = 5,
  202. persist = 0.7,
  203. lacunarity = 1,
  204. flags = "absvalue",
  205. },
  206. --[[
  207. craft = { -- teleport craft recipe
  208. {"default:obsidianbrick", "default:steel_ingot", "default:obsidianbrick"},
  209. {"default:wood","default:mese","default:wood",},
  210. {"default:obsidianbrick", "default:steel_ingot", "default:obsidianbrick"},
  211. },
  212. ]]
  213. --[[
  214. on_generate=function(self,data,id,area,x,y,z)
  215. if y <= self.dirt_start+5 then
  216. data[id] = self.air
  217. else
  218. return
  219. end
  220. return data -- to return changes
  221. end,
  222. ]]
  223. -- data: active generating area (VoxelArea)
  224. -- index: data index
  225. -- self: {dim_start, dim_end, dim_height, ground_limit, heat, humidity, dirt, stone, grass, air, water, sand, bedrock ... and your inputs
  226. ----area: (VoxelArea:new({MinEd...})
  227. --sky = {{r=219, g=168, b=117},"plain",{}}, -- same as:set_sky()
  228. on_enter=function(player) --on enter dimension
  229. end,
  230. on_leave=function(player) --on leave dimension
  231. end,
  232. })
  233. --Water Age Dimension
  234. minetest.register_ore({
  235. ore_type = "stratum",
  236. ore = "multidimensions:bedrock",
  237. wherein = "air",
  238. --clust_scarcity = 9 * 9 * 9,
  239. --clust_num_ores = 12,
  240. --clust_size = 3,
  241. y_min = 5000,
  242. y_max = 5000,
  243. --biomes = {},
  244. np_stratum_thickness = {
  245. offset = 8,
  246. scale = 4,
  247. spread = {x = 100, y = 100, z = 100},
  248. seed = 17,
  249. octaves = 3,
  250. persist = 0.7
  251. },
  252. stratum_thickness = 1,
  253. })
  254. minetest.register_ore({
  255. ore_type = "stratum",
  256. ore = "default:stone",
  257. wherein = "air",
  258. --clust_scarcity = 9 * 9 * 9,
  259. --clust_num_ores = 12,
  260. --clust_size = 3,
  261. y_min = 5001,
  262. y_max = 5500,
  263. --biomes = {},
  264. np_stratum_thickness = {
  265. offset = 8,
  266. scale = 4,
  267. spread = {x = 100, y = 100, z = 100},
  268. seed = 17,
  269. octaves = 3,
  270. persist = 0.7
  271. },
  272. stratum_thickness = 500,
  273. })
  274. minetest.register_ore({
  275. ore_type = "stratum",
  276. ore = "default:sand",
  277. wherein = "air",
  278. --clust_scarcity = 9 * 9 * 9,
  279. --clust_num_ores = 12,
  280. --clust_size = 3,
  281. y_min = 5501,
  282. y_max = 5501,
  283. --biomes = {},
  284. np_stratum_thickness = {
  285. offset = 8,
  286. scale = 4,
  287. spread = {x = 100, y = 100, z = 100},
  288. seed = 17,
  289. octaves = 3,
  290. persist = 0.7
  291. },
  292. stratum_thickness = 1,
  293. })
  294. minetest.register_ore({
  295. ore_type = "stratum",
  296. ore = "default:water_source",
  297. wherein = "air",
  298. --clust_scarcity = 9 * 9 * 9,
  299. --clust_num_ores = 12,
  300. --clust_size = 3,
  301. y_min = 5502,
  302. y_max = 5511,
  303. --biomes = {},
  304. np_stratum_thickness = {
  305. offset = 8,
  306. scale = 4,
  307. spread = {x = 100, y = 100, z = 100},
  308. seed = 17,
  309. octaves = 3,
  310. persist = 0.7
  311. },
  312. stratum_thickness = 10,
  313. })
  314. --[[
  315. minetest.register_ore({
  316. ore_type = "scatter",
  317. ore = "time_travel:coral_reef",
  318. wherein = "default:water_source",
  319. clust_scarcity = 7 * 7 * 7,
  320. clust_num_ores = 5,
  321. clust_size = 1,
  322. y_min = 5501,
  323. y_max = 5502,
  324. })
  325. ]]
  326. minetest.register_ore({
  327. ore_type = "scatter",
  328. ore = "default:coral_orange",
  329. wherein = "default:water_source",
  330. clust_scarcity = 7 * 7 * 7,
  331. clust_num_ores = 5,
  332. clust_size = 1,
  333. y_min = 5501,
  334. y_max = 5502,
  335. })
  336. minetest.register_ore({
  337. ore_type = "scatter",
  338. ore = "default:coral_brown",
  339. wherein = "default:water_source",
  340. clust_scarcity = 7 * 7 * 7,
  341. clust_num_ores = 5,
  342. clust_size = 1,
  343. y_min = 5501,
  344. y_max = 5502,
  345. })
  346. --LBMs and ABMs
  347. minetest.register_lbm({
  348. name = "time_travel:tree_lbm",
  349. run_at_every_load = true,
  350. nodenames = {"time_travel:jungle_tree", "time_travel:snowy_pine_tree", "time_travel:tree"},
  351. action = function(pos, node)
  352. minetest.set_node(pos, {name = "air"})
  353. local tree=""
  354. if node.name=="time_travel:jungle_tree" then
  355. tree=minetest.get_modpath("default") .. "/schematics/jungle_tree.mts"
  356. elseif node.name=="time_travel:snowy_pine_tree" then
  357. tree=minetest.get_modpath("default") .. "/schematics/snowy_pine_tree_from_sapling.mts"
  358. elseif node.name=="time_travel:tree" then
  359. tree=minetest.get_modpath("default") .. "/schematics/apple_tree.mts"
  360. end
  361. minetest.place_schematic({x=pos.x,y=pos.y,z=pos.z}, tree, "random", {}, true)
  362. end,
  363. })
  364. --[[
  365. minetest.register_lbm({
  366. name = "time_travel:coral_reef_lbm",
  367. run_at_every_load = true,
  368. nodenames = {"time_travel:coral_reef"},
  369. action = function(pos, node)
  370. minetest.set_node(pos, {name = "default:water_source"})
  371. local coral_reef=""
  372. --if node.name=="time_travel:coral_reef" then
  373. coral_reef=minetest.get_modpath("default") .. "/schematics/corals.mts"
  374. --end
  375. minetest.place_schematic(pos, coral_reef, "random", {}, true)
  376. end
  377. })
  378. ]]
  379. minetest.register_abm({
  380. nodenames = {"time_travel:australia_red_dirt"},
  381. neighbors = {"default:water_source", "default:water_flowing"},
  382. interval = 5.0,
  383. chance = 1,
  384. action = function(pos, node, active_object_count,
  385. active_object_count_wider)
  386. local pos = {x = pos.x, y = pos.y, z = pos.z}
  387. minetest.set_node(pos, {name = "default:dirt"})
  388. end
  389. })