3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-15 11:00:06 +01:00

Remove getUnloadingChunkHolder check

It always returns null now. So it could NPE and is not useful.
Dieser Commit ist enthalten in:
Jason Penilla 2024-06-18 12:51:40 -07:00
Ursprung 7bbe6820c2
Commit 126f6d7dc1
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 0E75A301420E48F8

Datei anzeigen

@ -6,10 +6,10 @@ Subject: [PATCH] Fix CraftWorld#isChunkGenerated
The upstream implementation is returning true for non-full chunks. 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 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 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/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 @Override
public boolean isChunkGenerated(int x, int z) { public boolean isChunkGenerated(int x, int z) {
@ -24,9 +24,6 @@ index fe9e8d1d4ae1f7a4e8f4cf5688004fc969422b3c..b466a1edaa6c1123dedda8376eabc3be
+ }, world.getChunkSource().mainThreadProcessor).join(); + }, world.getChunkSource().mainThreadProcessor).join();
+ } + }
+ ChunkAccess chunk = world.getChunkSource().getChunkAtImmediately(x, z); + ChunkAccess chunk = world.getChunkSource().getChunkAtImmediately(x, z);
+ if (chunk == null) {
+ chunk = world.getChunkSource().chunkMap.getUnloadingChunkHolder(x, z).getLatestChunk();
+ }
+ if (chunk != null) { + if (chunk != null) {
+ return chunk instanceof ImposterProtoChunk || chunk instanceof net.minecraft.world.level.chunk.LevelChunk; + return chunk instanceof ImposterProtoChunk || chunk instanceof net.minecraft.world.level.chunk.LevelChunk;
} }