From 73a66676b80b85ce66c2fb365c6c361a219a0491 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 aaa65582b..8ecdf7a5b 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -58,7 +58,7 @@ public class Chunk implements IChunkAccess { private long A; public long getInhabitedTime() { return A; } // Paper - OBFHELPER private int B; private final ConcurrentLinkedQueue C; - public boolean d; + public boolean d; public void setShouldUnload(boolean unload) { this.d = unload; } public boolean isUnloading() { return d; } // Paper - OBFHELPER private ChunkStatus D; private int E; private final AtomicInteger F; diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java index bb96a7392..7825dc91b 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -302,6 +302,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.17.1