From 46ed080d3b6b6d2a5358cc13c050876ec3880bad Mon Sep 17 00:00:00 2001 From: Jason <11360596+jpenilla@users.noreply.github.com> Date: Thu, 3 Feb 2022 12:28:39 -0700 Subject: [PATCH] fix portal linking in upgraded chunks (fixes #7419) (#7438) --- patches/server/0744-Optimise-general-POI-access.patch | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/patches/server/0744-Optimise-general-POI-access.patch b/patches/server/0744-Optimise-general-POI-access.patch index c920f51774..9f914bbfda 100644 --- a/patches/server/0744-Optimise-general-POI-access.patch +++ b/patches/server/0744-Optimise-general-POI-access.patch @@ -939,10 +939,10 @@ index ff6cadec530dedf9efc5d6226e48a096a1073ad6..d73b99d7fde724da4503b5176c3ad7b0 return Optional.empty(); } else { diff --git a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java -index ed79058696eb26a89b9d4116821840dbad9ea449..d990d1652b71205816d678618bf360a60f309ad2 100644 +index ed79058696eb26a89b9d4116821840dbad9ea449..8f147cd9798779eb2a72f444bf7fcb6c3cdc4971 100644 --- a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java +++ b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java -@@ -51,18 +51,40 @@ public class PortalForcer { +@@ -51,18 +51,41 @@ public class PortalForcer { // int i = flag ? 16 : 128; // CraftBukkit end @@ -968,7 +968,8 @@ index ed79058696eb26a89b9d4116821840dbad9ea449..d990d1652b71205816d678618bf360a6 + }, + (BlockPos pos) -> { + net.minecraft.world.level.chunk.ChunkAccess lowest = this.level.getChunk(pos.getX() >> 4, pos.getZ() >> 4, net.minecraft.world.level.chunk.ChunkStatus.EMPTY); -+ if (!lowest.getStatus().isOrAfter(net.minecraft.world.level.chunk.ChunkStatus.FULL)) { ++ if (!lowest.getStatus().isOrAfter(net.minecraft.world.level.chunk.ChunkStatus.FULL) ++ && (lowest.getBelowZeroRetrogen() == null || !lowest.getBelowZeroRetrogen().targetStatus().isOrAfter(net.minecraft.world.level.chunk.ChunkStatus.HEIGHTMAPS))) { + // why would we generate the chunk? + return false; + }