From 8526b71e1325ff69bacda1b79b7e09e05b28d6b8 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 1 Jan 2016 21:11:03 -0500 Subject: [PATCH] Reintroduce Chunk Unload Stopping Part #2 of pull that actually reintroduces chunk unload stopping for recent activity. Again sorry I don't know how to make a pull request with multiple files from browser. --- .../minecraft/world/gen/ChunkProviderServer.java.patch | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/patches/net/minecraft/world/gen/ChunkProviderServer.java.patch b/patches/net/minecraft/world/gen/ChunkProviderServer.java.patch index f4b1663..1bc3731 100644 --- a/patches/net/minecraft/world/gen/ChunkProviderServer.java.patch +++ b/patches/net/minecraft/world/gen/ChunkProviderServer.java.patch @@ -429,11 +429,11 @@ - } - } + // Cauldron static - check if the chunk was accessed recently and keep it loaded if there are players in world -+ /*if (!shouldUnloadChunk(chunk) && this.worldObj.playerEntities.size() > 0) ++ if (!shouldUnloadChunk(chunk) && this.worldObj.playerEntities.size() > 0) + { + CauldronHooks.logChunkUnload(this, chunk.xPosition, chunk.zPosition, "** Chunk kept from unloading due to recent activity"); + continue; -+ }*/ ++ } + // Cauldron end - this.chunksToUnload.remove(olong); @@ -500,10 +500,10 @@ + return loadedChunkHashMap_KC.get(chunkHash).lastAccessedTick; + } + -+ /*private boolean shouldUnloadChunk(Chunk chunk) ++ private boolean shouldUnloadChunk(Chunk chunk) + { + if (chunk == null) return false; -+ return MinecraftServer.getServer().getTickCounter() - chunk.lastAccessedTick > CauldronConfig.chunkGCGracePeriod.getValue(); -+ }*/ ++ return MinecraftServer.getServer().getTickCounter() - chunk.lastAccessedTick > MinecraftServer.getServer().cauldronConfig.chunkGCGracePeriod.getValue(); ++ } + // Cauldron end }