From de46bb6b526dcd7ed0ca8eb07e08340ce4c670f5 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 12 May 2016 02:03:56 -0400 Subject: [PATCH] Fix Chunk Unload Queue Issues Vanilla implemented similar logic as Paper had pre 1.9.4, but Spigot has not resolved all the bugs with the changes. This patch fixes known issues and really should be applied by Spigot team. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java index 2b7679f..44f576e 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -46,7 +46,7 @@ public class Chunk { private long w; private int x; private ConcurrentLinkedQueue y; - public boolean d; + public boolean d;public void setShouldUnload(boolean unload) { this.d = unload; } public boolean isUnloading() { return d; } // Paper // OBFHELPER protected gnu.trove.map.hash.TObjectIntHashMap entityCount = new gnu.trove.map.hash.TObjectIntHashMap(); // Spigot // Paper start diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java index cc8602e..a40a6a4 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -290,6 +290,7 @@ public class ChunkProviderServer implements IChunkProvider { if (chunk != null && chunk.d) { // CraftBukkit start - move unload logic to own method + chunk.setShouldUnload(false); // Paper if (!unloadChunk(chunk, true)) { continue; } -- 2.9.0