fix portal linking in upgraded chunks (fixes #7419) (#7438)

This commit is contained in:
Jason 2022-02-03 12:28:39 -07:00 committed by GitHub
parent 9940bcabcc
commit 46ed080d3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -939,10 +939,10 @@ index ff6cadec530dedf9efc5d6226e48a096a1073ad6..d73b99d7fde724da4503b5176c3ad7b0
return Optional.empty(); return Optional.empty();
} else { } 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 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 --- a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java
+++ b/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; // int i = flag ? 16 : 128;
// CraftBukkit end // CraftBukkit end
@ -968,7 +968,8 @@ index ed79058696eb26a89b9d4116821840dbad9ea449..d990d1652b71205816d678618bf360a6
+ }, + },
+ (BlockPos pos) -> { + (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); + 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? + // why would we generate the chunk?
+ return false; + return false;
+ } + }