From 126f6d7dc164ff12a2257c14780a72341a96f2f8 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Tue, 18 Jun 2024 12:51:40 -0700 Subject: [PATCH] Remove getUnloadingChunkHolder check It always returns null now. So it could NPE and is not useful. --- patches/server/1027-Fix-CraftWorld-isChunkGenerated.patch | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/patches/server/1027-Fix-CraftWorld-isChunkGenerated.patch b/patches/server/1027-Fix-CraftWorld-isChunkGenerated.patch index 5ed3807fd3..af6ad637a2 100644 --- a/patches/server/1027-Fix-CraftWorld-isChunkGenerated.patch +++ b/patches/server/1027-Fix-CraftWorld-isChunkGenerated.patch @@ -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; }