Save portal noise

This commit is contained in:
Wuzzy 2017-08-17 01:09:32 +02:00
parent bcee6a0c6a
commit 41380ad281
2 changed files with 8 additions and 4 deletions

View File

@ -116,11 +116,13 @@ end
local function find_end_target3_y2(target3_x, target3_z) local function find_end_target3_y2(target3_x, target3_z)
local start_y = END_DEPTH + math.random(20, 120) -- Search start local start_y = END_DEPTH + math.random(20, 120) -- Search start
local nobj_cave_point = minetest.get_perlin(np_cave) if not nobj_cave then
nobj_cave = minetest.get_perlin(np_cave)
end
local air = 0 -- Consecutive air nodes found local air = 0 -- Consecutive air nodes found
for y = start_y, start_y - 120, -1 do for y = start_y, start_y - 120, -1 do
local nval_cave = nobj_cave_point:get3d({x = target3_x, y = y, z = target3_z}) local nval_cave = nobj_cave:get3d({x = target3_x, y = y, z = target3_z})
if nval_cave > TCAVE then -- Cavern if nval_cave > TCAVE then -- Cavern
air = air + 1 air = air + 1

View File

@ -118,11 +118,13 @@ end
local function find_nether_target_y(target_x, target_z) local function find_nether_target_y(target_x, target_z)
local start_y = NETHER_DEPTH + math.random(38, 117) -- Search start local start_y = NETHER_DEPTH + math.random(38, 117) -- Search start
local nobj_cave_point = minetest.get_perlin(np_cave) if not nobj_cave then
nobj_cave = minetest.get_perlin(np_cave)
end
local air = 4 local air = 4
for y = start_y, start_y -117, -1 do for y = start_y, start_y -117, -1 do
local nval_cave = nobj_cave_point:get3d({x = target_x, y = y, z = target_z}) local nval_cave = nobj_cave:get3d({x = target_x, y = y, z = target_z})
if nval_cave > TCAVE then -- Cavern if nval_cave > TCAVE then -- Cavern
air = air + 1 air = air + 1