diff options
author | Travis Watkins <amaranth@ubuntu.com> | 2014-02-11 20:48:50 -0600 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2014-02-12 02:05:12 -0500 |
commit | afb3511a4a5a63007217f2dbbbbc753f3bee0aed (patch) | |
tree | dc7b962a1d3f4adf3a594d167f176611bc06e8a1 /src/main/java/org/bukkit | |
parent | f6f0cf338a48736b484060607705880ad53d428b (diff) | |
download | craftbukkit-afb3511a4a5a63007217f2dbbbbc753f3bee0aed.tar craftbukkit-afb3511a4a5a63007217f2dbbbbc753f3bee0aed.tar.gz craftbukkit-afb3511a4a5a63007217f2dbbbbc753f3bee0aed.tar.lz craftbukkit-afb3511a4a5a63007217f2dbbbbc753f3bee0aed.tar.xz craftbukkit-afb3511a4a5a63007217f2dbbbbc753f3bee0aed.zip |
Remove chunks from queue if we don't need them anymore.
Diffstat (limited to 'src/main/java/org/bukkit')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOExecutor.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOExecutor.java b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOExecutor.java index afcf764b..e4fd9bc6 100644 --- a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOExecutor.java +++ b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOExecutor.java @@ -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); |