From 41380ad281f904fcc504dcb4e8895bda84db675d Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 17 Aug 2017 01:09:32 +0200 Subject: [PATCH] Save portal noise --- mods/MAPGEN/mcl_portals/portal_end.lua | 6 ++++-- mods/MAPGEN/mcl_portals/portal_nether.lua | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/mods/MAPGEN/mcl_portals/portal_end.lua b/mods/MAPGEN/mcl_portals/portal_end.lua index c5d4d5b2..0a8c5c8c 100644 --- a/mods/MAPGEN/mcl_portals/portal_end.lua +++ b/mods/MAPGEN/mcl_portals/portal_end.lua @@ -116,11 +116,13 @@ end local function find_end_target3_y2(target3_x, target3_z) 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 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 air = air + 1 diff --git a/mods/MAPGEN/mcl_portals/portal_nether.lua b/mods/MAPGEN/mcl_portals/portal_nether.lua index 7070f249..9705e289 100644 --- a/mods/MAPGEN/mcl_portals/portal_nether.lua +++ b/mods/MAPGEN/mcl_portals/portal_nether.lua @@ -118,11 +118,13 @@ end local function find_nether_target_y(target_x, target_z) 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 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 air = air + 1