Allow to teleport back to overworld
This commit is contained in:
parent
54dc6e8ffb
commit
acad50ae5f
|
@ -1,6 +1,5 @@
|
||||||
-- Parameters
|
-- Parameters
|
||||||
|
|
||||||
local END_DEPTH = mcl_vars.mg_end_min
|
|
||||||
local TCAVE = 0.6
|
local TCAVE = 0.6
|
||||||
local nobj_cave = nil
|
local nobj_cave = nil
|
||||||
-- 3D noise
|
-- 3D noise
|
||||||
|
@ -118,7 +117,7 @@ local function build_end_portal(pos, target3)
|
||||||
end
|
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 = mcl_vars.mg_end_min + math.random(20, 120) -- Search start
|
||||||
if not nobj_cave then
|
if not nobj_cave then
|
||||||
nobj_cave = minetest.get_perlin(np_cave)
|
nobj_cave = minetest.get_perlin(np_cave)
|
||||||
end
|
end
|
||||||
|
@ -229,8 +228,8 @@ local function make_end_portal(pos)
|
||||||
|
|
||||||
local target3 = {x = p1.x, y = p1.y, z = p1.z}
|
local target3 = {x = p1.x, y = p1.y, z = p1.z}
|
||||||
target3.x = target3.x + 1
|
target3.x = target3.x + 1
|
||||||
if target3.y < END_DEPTH then
|
if target3.y < mcl_vars.mg_end_max and target3.y > mcl_vars.mg_end_min then
|
||||||
target3.y = math.random(-52, 100)
|
target3.y = math.random(mcl_vars.mg_overworld_min + 40, mcl_vars.mg_overworld_min + 96)
|
||||||
else
|
else
|
||||||
target3.y = find_end_target3_y2(target3.x, target3.z)
|
target3.y = find_end_target3_y2(target3.x, target3.z)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
-- Parameters
|
-- Parameters
|
||||||
|
|
||||||
local NETHER_DEPTH = mcl_vars.mg_nether_min
|
|
||||||
local TCAVE = 0.6
|
local TCAVE = 0.6
|
||||||
local nobj_cave = nil
|
local nobj_cave = nil
|
||||||
|
|
||||||
|
@ -117,7 +116,7 @@ local function build_portal(pos, target)
|
||||||
end
|
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 = mcl_vars.mg_nether_min + math.random(38, 117) -- Search start
|
||||||
if not nobj_cave then
|
if not nobj_cave then
|
||||||
nobj_cave = minetest.get_perlin(np_cave)
|
nobj_cave = minetest.get_perlin(np_cave)
|
||||||
end
|
end
|
||||||
|
@ -228,8 +227,8 @@ local function make_portal(pos)
|
||||||
|
|
||||||
local target = {x = p1.x, y = p1.y, z = p1.z}
|
local target = {x = p1.x, y = p1.y, z = p1.z}
|
||||||
target.x = target.x + 1
|
target.x = target.x + 1
|
||||||
if target.y < NETHER_DEPTH then
|
if target.y < mcl_vars.mg_nether_max and target.y > mcl_vars.mg_nether_min then
|
||||||
target.y = math.random(-52, 100)
|
target.y = math.random(mcl_vars.mg_overworld_min + 40, mcl_vars.mg_overworld_min + 96)
|
||||||
else
|
else
|
||||||
target.y = find_nether_target_y(target.x, target.z)
|
target.y = find_nether_target_y(target.x, target.z)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user