Browse Source

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.
master
Sam 9 years ago
parent
commit
8526b71e13
  1. 10
      patches/net/minecraft/world/gen/ChunkProviderServer.java.patch

10
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 + // 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"); + CauldronHooks.logChunkUnload(this, chunk.xPosition, chunk.zPosition, "** Chunk kept from unloading due to recent activity");
+ continue; + continue;
+ }*/ + }
+ // Cauldron end + // Cauldron end
- this.chunksToUnload.remove(olong); - this.chunksToUnload.remove(olong);
@ -500,10 +500,10 @@
+ return loadedChunkHashMap_KC.get(chunkHash).lastAccessedTick; + return loadedChunkHashMap_KC.get(chunkHash).lastAccessedTick;
+ } + }
+ +
+ /*private boolean shouldUnloadChunk(Chunk chunk) + private boolean shouldUnloadChunk(Chunk chunk)
+ { + {
+ if (chunk == null) return false; + 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 + // Cauldron end
} }

Loading…
Cancel
Save