aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0988-Moonrise-optimisation-patches.patch
diff options
context:
space:
mode:
authorNassim Jahnke <[email protected]>2024-07-19 13:50:38 +0200
committerNassim Jahnke <[email protected]>2024-07-19 13:50:38 +0200
commite71c1df54c8829d77f62751860e8906db7748139 (patch)
tree8aadf603cad7db2484c917e488e6a38b04db5a64 /patches/server/0988-Moonrise-optimisation-patches.patch
parent7ea403902b81e15ec54a93972d337c4531a56b1e (diff)
downloadPaper-e71c1df54c8829d77f62751860e8906db7748139.tar.gz
Paper-e71c1df54c8829d77f62751860e8906db7748139.zip
Call PlayerChunkUnloadEvent
Diffstat (limited to 'patches/server/0988-Moonrise-optimisation-patches.patch')
-rw-r--r--patches/server/0988-Moonrise-optimisation-patches.patch12
1 files changed, 9 insertions, 3 deletions
diff --git a/patches/server/0988-Moonrise-optimisation-patches.patch b/patches/server/0988-Moonrise-optimisation-patches.patch
index d247d377e2..9412139853 100644
--- a/patches/server/0988-Moonrise-optimisation-patches.patch
+++ b/patches/server/0988-Moonrise-optimisation-patches.patch
@@ -4780,10 +4780,10 @@ index 0000000000000000000000000000000000000000..003a857e70ead858e8437e3c1bfaf22f
+}
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/player/RegionizedPlayerChunkLoader.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/player/RegionizedPlayerChunkLoader.java
new file mode 100644
-index 0000000000000000000000000000000000000000..244674dc44d80ee5ce78d2ed2c6ab94fd5d3d07f
+index 0000000000000000000000000000000000000000..7249b78e21b12117480a18f2d07d0c978fe42e56
--- /dev/null
+++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/player/RegionizedPlayerChunkLoader.java
-@@ -0,0 +1,1076 @@
+@@ -0,0 +1,1082 @@
+package ca.spottedleaf.moonrise.patches.chunk_system.player;
+
+import ca.spottedleaf.concurrentutil.executor.standard.PrioritisedExecutor;
@@ -5216,7 +5216,13 @@ index 0000000000000000000000000000000000000000..244674dc44d80ee5ce78d2ed2c6ab94f
+ // Note: drop isAlive() check so that chunks properly unload client-side when the player dies
+ ((ChunkSystemChunkHolder)((ChunkSystemServerLevel)this.world).moonrise$getChunkTaskScheduler().chunkHolderManager
+ .getChunkHolder(chunkX, chunkZ).vanillaChunkHolder).moonrise$removeReceivedChunk(this.player);
-+ this.player.connection.send(new ClientboundForgetLevelChunkPacket(new ChunkPos(chunkX, chunkZ)));
++ final ChunkPos chunkPos = new ChunkPos(chunkX, chunkZ);
++ this.player.connection.send(new ClientboundForgetLevelChunkPacket(chunkPos));
++ // Paper start - PlayerChunkUnloadEvent
++ if (io.papermc.paper.event.packet.PlayerChunkUnloadEvent.getHandlerList().getRegisteredListeners().length > 0) {
++ new io.papermc.paper.event.packet.PlayerChunkUnloadEvent(this.world.getWorld().getChunkAt(chunkPos.longKey), this.player.getBukkitEntity()).callEvent();
++ }
++ // Paper end - PlayerChunkUnloadEvent
+ }
+
+ private final SingleUserAreaMap<PlayerChunkLoaderData> broadcastMap = new SingleUserAreaMap<>(this) {