mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-15 12:13:54 -07:00
Remove chunks after calling ChunkUnloadEvent (Fixes #2919)
This commit is contained in:
@@ -1700,7 +1700,7 @@ index c88a62f6b..5dbd3e60f 100644
|
|||||||
this.d = i;
|
this.d = i;
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||||
index 55373cae0..a263f60d4 100644
|
index 55373cae0..517014d21 100644
|
||||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||||
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger;
|
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger;
|
||||||
@@ -1786,13 +1786,13 @@ index 55373cae0..a263f60d4 100644
|
|||||||
/*
|
/*
|
||||||
* If it's a new world, the first few chunks are generated inside
|
* If it's a new world, the first few chunks are generated inside
|
||||||
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
|
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
|
||||||
}
|
|
||||||
|
|
||||||
public void unloadCallback() {
|
|
||||||
+ ((WorldServer)this.world).getChunkProvider().removeLoadedChunk(this); // Paper
|
|
||||||
org.bukkit.Server server = this.world.getServer();
|
|
||||||
org.bukkit.event.world.ChunkUnloadEvent unloadEvent = new org.bukkit.event.world.ChunkUnloadEvent(this.bukkitChunk, this.isNeedsSaving());
|
|
||||||
server.getPluginManager().callEvent(unloadEvent);
|
server.getPluginManager().callEvent(unloadEvent);
|
||||||
|
// note: saving can be prevented, but not forced if no saving is actually required
|
||||||
|
this.mustNotSave = !unloadEvent.isSaveChunk();
|
||||||
|
+ ((WorldServer)this.world).getChunkProvider().removeLoadedChunk(this); // Paper
|
||||||
|
}
|
||||||
|
// CraftBukkit end
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/ChunkCache.java b/src/main/java/net/minecraft/server/ChunkCache.java
|
diff --git a/src/main/java/net/minecraft/server/ChunkCache.java b/src/main/java/net/minecraft/server/ChunkCache.java
|
||||||
index 11c4d23ba..53c15c1c0 100644
|
index 11c4d23ba..53c15c1c0 100644
|
||||||
--- a/src/main/java/net/minecraft/server/ChunkCache.java
|
--- a/src/main/java/net/minecraft/server/ChunkCache.java
|
||||||
|
Reference in New Issue
Block a user