From 133e66ad38389b4c500e7f90a2b548624ef5fa3e Mon Sep 17 00:00:00 2001 From: Milan* Date: Fri, 17 Mar 2017 21:31:17 +0100 Subject: [PATCH] adjust depth levels, don't disable caves --- cavegen.lua | 9 ++++++--- deco.lua | 9 +++++---- init.lua | 2 +- mapgen.lua | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/cavegen.lua b/cavegen.lua index 5966bf2..c6c72cd 100644 --- a/cavegen.lua +++ b/cavegen.lua @@ -4,7 +4,7 @@ fun_caves_mod.cave_width = 0.05 -- figurative width -local max_depth = 31000 +local max_depth = -28000 fun_caves_mod.cave_noise_1 = {offset = 0, scale = 1, seed = 3901, spread = {x = 40, y = 10, z = 40}, octaves = 3, persist = 1, lacunarity = 2} @@ -16,8 +16,11 @@ fun_caves_mod.cavegen = function(minp, maxp, data, area, node, heightmap) if not (minp and maxp and data and area and node and type(data) == 'table') then return end - - local csize = vector.add(vector.subtract(maxp, minp), 1) + + local temp_y = (minp.y+maxp.y)/2 + if temp_y > -28000 or temp_y < -30999 then return end + + local csize = vector.add(vector.subtract(maxp, minp), 1) local map_max = {x = csize.x, y = csize.y + 2, z = csize.z} local map_min = {x = minp.x, y = minp.y - 1, z = minp.z} diff --git a/deco.lua b/deco.lua index efde596..520bb70 100644 --- a/deco.lua +++ b/deco.lua @@ -7,11 +7,10 @@ dofile(fun_caves_mod.path .. "/nodes.lua") dofile(fun_caves_mod.path .. "/fungal_tree.lua") -local deco_depth = -30 -- place cave stuff this far beneath the surface +local deco_depth = -5 -- place cave stuff this far beneath the surface local water_level = 1 -local fluid_compression = -200 -- the depth to start planting lava/water -local max_depth = 31000 - +local fluid_compression = -22000 -- the depth to start planting lava/water +local max_depth = -27960 local csize local node_match_cache = {} @@ -25,6 +24,8 @@ fun_caves_mod.decogen = function(minp, maxp, data, area, node, heightmap) if not (minp and maxp and data and area and node and type(data) == 'table' and fun_caves_mod.cave_biomes and fun_caves_mod.make_fungal_tree) then return end + local temp_y = (minp.y+maxp.y)/2 + if temp_y > -28000 or temp_y < -30999 then return end csize = vector.add(vector.subtract(maxp, minp), 1) diff --git a/init.lua b/init.lua index 39a38a2..6a34159 100644 --- a/init.lua +++ b/init.lua @@ -24,7 +24,7 @@ end minetest.register_on_mapgen_init(function(mgparams) --minetest.set_mapgen_setting('mg_flags', "nocaves, nodungeons", true) - minetest.set_mapgen_setting('mg_flags', "nocaves", true) + --minetest.set_mapgen_setting('mg_flags', "nocaves", true) end) diff --git a/mapgen.lua b/mapgen.lua index f14d6a4..5afce72 100644 --- a/mapgen.lua +++ b/mapgen.lua @@ -4,7 +4,7 @@ local DEBUG -local max_depth = 31000 +local max_depth = -28000 local seed_noise = {offset = 0, scale = 32768, seed = 5202, spread = {x = 80, y = 80, z = 80}, octaves = 2, persist = 0.4, lacunarity = 2} fun_caves_mod.use_bi_hi = true