Browse Source

Merge pull request #5 from Robotia/patch-3

Reintroduce Chunk Unload Stopping Part 2
master
Yive 9 years ago
parent
commit
2294e17d41
  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
+ /*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
}

Loading…
Cancel
Save