From 3d06377b24681c64301bffc3f81816166c6a8688 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Sat, 10 Jun 2023 08:27:23 -0700 Subject: [PATCH] Allow double removal from player chunk loader Unlike Folia, players may be incorrectly be double-removed Fixes https://github.com/PaperMC/Paper/issues/9299 --- patches/server/0019-Rewrite-chunk-system.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/server/0019-Rewrite-chunk-system.patch b/patches/server/0019-Rewrite-chunk-system.patch index 74ade3784..59092bf1f 100644 --- a/patches/server/0019-Rewrite-chunk-system.patch +++ b/patches/server/0019-Rewrite-chunk-system.patch @@ -2310,7 +2310,7 @@ index 95eac2e12a16938d81ab512b00e90c5234b42834..8f7bf1f0400aeab8b7801d113d244d07 private ChunkSystem() { diff --git a/src/main/java/io/papermc/paper/chunk/system/RegionizedPlayerChunkLoader.java b/src/main/java/io/papermc/paper/chunk/system/RegionizedPlayerChunkLoader.java new file mode 100644 -index 0000000000000000000000000000000000000000..a642b02694eb50e21dee1c3dc0bc397c1712c71e +index 0000000000000000000000000000000000000000..a495d692841c1a6056ca82519ee9b9c66f1ff5cd --- /dev/null +++ b/src/main/java/io/papermc/paper/chunk/system/RegionizedPlayerChunkLoader.java @@ -0,0 +1,1418 @@ @@ -2471,7 +2471,7 @@ index 0000000000000000000000000000000000000000..a642b02694eb50e21dee1c3dc0bc397c + final PlayerChunkLoaderData loader = player.chunkLoader; + + if (loader == null) { -+ throw new IllegalStateException("Player is already removed from player chunk loader"); ++ return; + } + + loader.remove();