mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-23 08:46:44 +01:00
Remove chunks from queue if we don't need them anymore.
By: Travis Watkins <amaranth@ubuntu.com>
This commit is contained in:
parent
ec79a70954
commit
d6c0b864b8
1 changed files with 5 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue