Remove chunks from queue if we don't need them anymore.

This commit is contained in:
Travis Watkins authored and EvilSeph committed 2014-02-12 02:05:12 -05:00
1 parent f6f0cf338a
commit afb3511a4a
2 files changed
+45 -10

No files matched your search

@@ -20,6 +20,11 @@ public class ChunkIOExecutor {
instance.add(new QueuedChunk(x, z, loader, world, provider), runnable);
}
// Abuses the fact that hashCode and equals for QueuedChunk only use world and coords
public static void dropQueuedChunkLoad(World world, int x, int z, Runnable runnable) {
instance.drop(new QueuedChunk(x, z, null, world, null), runnable);
}
public static void adjustPoolSize(int players) {
int size = Math.max(BASE_THREADS, (int) Math.ceil(players / PLAYERS_PER_THREAD));
instance.setActiveThreads(size);