Cooperate with underworlds mod.

This commit is contained in:
Duane Robertson 2017-01-29 19:43:17 -06:00
parent bdca26220d
commit 2186b24632
5 changed files with 161 additions and 97 deletions

View file

@ -176,21 +176,21 @@ local function generate(p_minp, p_maxp, seed)
local csize = vector.add(vector.subtract(maxp, minp), 1)
local write
if underworlds_mod and underworlds_mod.underzones then
local avg = (minp.y + maxp.y) / 2
for _, uz in pairs(underworlds_mod.underzones) do
if avg <= uz.upper_bound and avg >= uz.lower_bound then
return
end
end
end
if fun_caves_mod.use_bi_hi then
heightmap = minetest.get_mapgen_object("heightmap")
end
-- use the same seed (based on perlin noise).
--do
-- local seed = minetest.get_perlin(seed_noise):get2d({x=minp.x, y=minp.z})
-- if not (seed and type(seed) == 'number') then
-- return
-- end
-- math.randomseed(seed)
--end
-- Correct heightmap.
if maxp.y < -300 or minp.y > 300 then
for i = 1, #heightmap do