mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-16 18:31:53 +01:00
Fix recursive chunk loading in chunk unload event
Since the chunk may not even be at a loaded ticket level, the getChunk call may invoke a sync load. To prevent this, we can retrieve the full loaded chunk first which is guaranteed to be non-null when unloading.
This commit is contained in:
parent
76d8369ad4
commit
ed3350e66e
1 changed files with 13 additions and 0 deletions
|
@ -29481,6 +29481,19 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/jav
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
|
||||
@@ -0,0 +0,0 @@ public class CraftChunk implements Chunk {
|
||||
}
|
||||
|
||||
public ChunkAccess getHandle(ChunkStatus chunkStatus) {
|
||||
+ // Paper start - rewrite chunk system
|
||||
+ net.minecraft.world.level.chunk.LevelChunk full = this.worldServer.getChunkIfLoaded(this.x, this.z);
|
||||
+ if (full != null) {
|
||||
+ return full;
|
||||
+ }
|
||||
+ // Paper end - rewrite chunk system
|
||||
ChunkAccess chunkAccess = this.worldServer.getChunk(this.x, this.z, chunkStatus);
|
||||
|
||||
// SPIGOT-7332: Get unwrapped extension
|
||||
@@ -0,0 +0,0 @@ public class CraftChunk implements Chunk {
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Reference in a new issue