From 5e912befc0b42d8b6068fa7c9dcd370577f6252f Mon Sep 17 00:00:00 2001 From: Sotr Date: Sat, 7 Jul 2018 15:58:26 +0800 Subject: [PATCH] Akarin 1.12.2 0.3.2 LTS Release --- .../server/mixin/core/MixinMinecraftServer.java | 2 +- .../server/mixin/cps/MixinChunkProviderServer.java | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/sources/src/main/java/io/akarin/server/mixin/core/MixinMinecraftServer.java b/sources/src/main/java/io/akarin/server/mixin/core/MixinMinecraftServer.java index b546cd866..078d46e7d 100644 --- a/sources/src/main/java/io/akarin/server/mixin/core/MixinMinecraftServer.java +++ b/sources/src/main/java/io/akarin/server/mixin/core/MixinMinecraftServer.java @@ -119,7 +119,7 @@ protected void l() throws InterruptedException { } for (WorldServer world : this.worlds) { - executor.take(); + if (world.getWorld().getKeepSpawnInMemory()) executor.take(); this.server.getPluginManager().callEvent(new WorldLoadEvent(world.getWorld())); } 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 02e650fd6..c2c1d36de 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 @@ -1,7 +1,5 @@ package io.akarin.server.mixin.cps; -import java.util.Iterator; - import org.spigotmc.SlackActivityAccountant; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; @@ -64,7 +62,7 @@ public boolean unloadChunks() { continue; } - it.remove(); // Life is strange + it.remove(); if (--remainingChunks <= targetSize || activityAccountant.activityTimeIsExhausted()) break; // more slack since the target size not work as intended } } @@ -74,6 +72,14 @@ public boolean unloadChunks() { return false; } + @Redirect(method = "unloadChunk", at = @At( + value = "INVOKE", + target = "it/unimi/dsi/fastutil/longs/Long2ObjectOpenHashMap.remove(J)Ljava/lang/Object;" + )) + private Object remove(Long2ObjectOpenHashMap chunks, long chunkHash) { + return null; + } + @Overwrite public String getName() { return "ServerChunkCache: " + chunks.size();