From b10a1585f476564f058f9a031948a95a28e979ed Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Mon, 28 Mar 2016 19:41:08 -0500 Subject: [PATCH] Add workaround for Spigot 1.9 problem with unloadChunk(safe=false) --- src/main/java/org/dynmap/bukkit/NewMapChunkCache.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/dynmap/bukkit/NewMapChunkCache.java b/src/main/java/org/dynmap/bukkit/NewMapChunkCache.java index de128ebc..8a139b10 100644 --- a/src/main/java/org/dynmap/bukkit/NewMapChunkCache.java +++ b/src/main/java/org/dynmap/bukkit/NewMapChunkCache.java @@ -922,11 +922,15 @@ public class NewMapChunkCache extends MapChunkCache { * while the actual in-use chunk area for a player where the chunks are managed * by the MC base server is 21x21 (or about a 160 block radius). * Also, if we did generate it, need to save it */ - helper.unloadChunkNoSave(w, c, chunk.x, chunk.z); + if (w.isChunkInUse(chunk.x, chunk.z) == false) { + helper.unloadChunkNoSave(w, c, chunk.x, chunk.z); + } endChunkLoad(startTime, ChunkStats.UNLOADED_CHUNKS); } else if (isunloadpending) { /* Else, if loaded and unload is pending */ - w.unloadChunkRequest(chunk.x, chunk.z); /* Request new unload */ + if (w.isChunkInUse(chunk.x, chunk.z) == false) { + w.unloadChunkRequest(chunk.x, chunk.z); /* Request new unload */ + } endChunkLoad(startTime, ChunkStats.LOADED_CHUNKS); } else {