Remove getUnloadingChunkHolder check

It always returns null now. So it could NPE and is not useful.
This commit is contained in:
Jason Penilla 2024-06-18 12:51:40 -07:00
parent 7bbe6820c2
commit 126f6d7dc1
No known key found for this signature in database
GPG Key ID: 0E75A301420E48F8

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Fix CraftWorld#isChunkGenerated
The upstream implementation is returning true for non-full chunks.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index fe9e8d1d4ae1f7a4e8f4cf5688004fc969422b3c..b466a1edaa6c1123dedda8376eabc3be0a011874 100644
index fe9e8d1d4ae1f7a4e8f4cf5688004fc969422b3c..95de729f0a02a202632ea85a4061607d632588e9 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -367,11 +367,30 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -367,11 +367,27 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public boolean isChunkGenerated(int x, int z) {
@ -24,9 +24,6 @@ index fe9e8d1d4ae1f7a4e8f4cf5688004fc969422b3c..b466a1edaa6c1123dedda8376eabc3be
+ }, world.getChunkSource().mainThreadProcessor).join();
+ }
+ ChunkAccess chunk = world.getChunkSource().getChunkAtImmediately(x, z);
+ if (chunk == null) {
+ chunk = world.getChunkSource().chunkMap.getUnloadingChunkHolder(x, z).getLatestChunk();
+ }
+ if (chunk != null) {
+ return chunk instanceof ImposterProtoChunk || chunk instanceof net.minecraft.world.level.chunk.LevelChunk;
}