From f4ddd4ac24fef012bc259460dc02b4a97cba329b Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Wed, 19 Jun 2024 10:42:48 -0700 Subject: [PATCH] Fix ChunkHolder#getFullChunkNow returning non-null when it should not In the new chunk system, the chunk is only at FULL when either the FULL callbacks have been invoked or during the FULL callbacks. --- .../server/0991-Chunk-System-Starlight-from-Moonrise.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/server/0991-Chunk-System-Starlight-from-Moonrise.patch b/patches/server/0991-Chunk-System-Starlight-from-Moonrise.patch index cde583319b..6e5ca00913 100644 --- a/patches/server/0991-Chunk-System-Starlight-from-Moonrise.patch +++ b/patches/server/0991-Chunk-System-Starlight-from-Moonrise.patch @@ -22722,7 +22722,7 @@ index e14c0e1ccf526f81e28db5545d9e2351641e1bc8..3c230ae060998bfb79d5812fef21a80a public boolean isDebugging() { return false; diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java -index c643bb0daa5cd264fd6ebab7acf0a2bdd7fe7029..0048077dedd19adc6c5a88e7d916d88a71662115 100644 +index c643bb0daa5cd264fd6ebab7acf0a2bdd7fe7029..9bc59697fc71d4e3c226aa7fe958f57193fc4bd4 100644 --- a/src/main/java/net/minecraft/server/level/ChunkHolder.java +++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java @@ -32,28 +32,20 @@ import net.minecraft.world.level.lighting.LevelLightEngine; @@ -22899,7 +22899,7 @@ index c643bb0daa5cd264fd6ebab7acf0a2bdd7fe7029..0048077dedd19adc6c5a88e7d916d88a public LevelChunk getFullChunkNow() { // Note: We use the oldTicketLevel for isLoaded checks. - if (!ChunkLevel.fullStatus(this.oldTicketLevel).isOrAfter(FullChunkStatus.FULL)) return null; -+ if (!ChunkLevel.fullStatus(this.newChunkHolder.oldTicketLevel).isOrAfter(FullChunkStatus.FULL)) return null; // Paper - rewrite chunk system ++ if (!this.newChunkHolder.isFullChunkReady()) return null; // Paper - rewrite chunk system return this.getFullChunkNowUnchecked(); }