From c42528f4f1af6e187eacf7ecdecebe4489ee6abf Mon Sep 17 00:00:00 2001 From: Sotr Date: Mon, 30 Jul 2018 00:54:50 +0800 Subject: [PATCH] Acutally fixed it --- .../server/mixin/cps/MixinChunkProviderServer.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/sources/src/main/java/io/akarin/server/mixin/cps/MixinChunkProviderServer.java b/sources/src/main/java/io/akarin/server/mixin/cps/MixinChunkProviderServer.java index b20f80b43..06e45da06 100644 --- a/sources/src/main/java/io/akarin/server/mixin/cps/MixinChunkProviderServer.java +++ b/sources/src/main/java/io/akarin/server/mixin/cps/MixinChunkProviderServer.java @@ -54,19 +54,16 @@ public abstract class MixinChunkProviderServer { if (chunk.isUnloading()) { if (chunk.scheduledForUnload != null) { if (now - chunk.scheduledForUnload > unloadAfter) { - chunk.scheduledForUnload = null; + if (unloadChunk(chunk, true)) { + chunk.scheduledForUnload = null; + it.remove(); + } + chunk.setShouldUnload(false); } else { continue; } } - if (!unloadChunk(chunk, true)) { // Event cancelled - // If a plugin cancelled it, we shouldn't trying unload it for a while - chunk.setShouldUnload(false); - } else { - it.remove(); - } - if (--remainingChunks <= targetSize || activityAccountant.activityTimeIsExhausted()) break; // more slack since the target size not work as intended } }