diff --git a/Spigot-Server-Patches/Don-t-create-a-chunk-just-to-unload-it.patch b/Spigot-Server-Patches/Don-t-create-a-chunk-just-to-unload-it.patch index a25fecb8e9..a7383e0793 100644 --- a/Spigot-Server-Patches/Don-t-create-a-chunk-just-to-unload-it.patch +++ b/Spigot-Server-Patches/Don-t-create-a-chunk-just-to-unload-it.patch @@ -9,9 +9,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -0,0 +0,0 @@ public class CraftWorld implements World { - return false; - } + } + private boolean unloadChunk0(int x, int z, boolean save, boolean safe) { - net.minecraft.server.Chunk chunk = world.getChunkProviderServer().getChunkAt(x, z); + // Paper start - Don't create a chunk just to unload it + net.minecraft.server.Chunk chunk = world.getChunkProviderServer().getChunkIfLoaded(x, z); @@ -19,6 +19,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return false; + } + // Paper end ++ if (chunk.mustSave) { // If chunk had previously been queued to save, must do save to avoid loss of that data save = true; } diff --git a/Spigot-Server-Patches/Optimize-Chunk-Unload-Queue.patch b/Spigot-Server-Patches/Optimize-Chunk-Unload-Queue.patch index eba2190660..3094587be1 100644 --- a/Spigot-Server-Patches/Optimize-Chunk-Unload-Queue.patch +++ b/Spigot-Server-Patches/Optimize-Chunk-Unload-Queue.patch @@ -276,8 +276,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -0,0 +0,0 @@ public class CraftWorld implements World { - } + private boolean unloadChunk0(int x, int z, boolean save, boolean safe) { // Paper start - Don't create a chunk just to unload it - net.minecraft.server.Chunk chunk = world.getChunkProviderServer().getChunkIfLoaded(x, z); + net.minecraft.server.Chunk chunk = world.getChunkProviderServer().getChunkIfActive(x, z); // Paper diff --git a/work/CraftBukkit b/work/CraftBukkit index f01861f80b..f326992b8b 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit f01861f80bc8d903f72210e7d79c90c35473aa74 +Subproject commit f326992b8b4df295dc35b06e8c3701c7b4397c9b diff --git a/work/Spigot b/work/Spigot index a1b8bf3530..f6feaaae5b 160000 --- a/work/Spigot +++ b/work/Spigot @@ -1 +1 @@ -Subproject commit a1b8bf3530b3f83fbd94cc8624d05426b0d9de5f +Subproject commit f6feaaae5b036bd574632a98c684b2fddf4454b9