mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2025-12-24 09:29:19 +00:00
Fix possible error
This commit is contained in:
@@ -51,6 +51,7 @@ public class WorldScheduler {
|
||||
thread.setName("customcrops-world-scheduler");
|
||||
return thread;
|
||||
});
|
||||
this.scheduler.setMaximumPoolSize(1);
|
||||
this.scheduler.setRemoveOnCancelPolicy(true);
|
||||
this.scheduler.setExecuteExistingDelayedTasksAfterShutdownPolicy(false);
|
||||
this.worker = new ForkJoinPool(PARALLELISM, new WorkerThreadFactory(), new ExceptionHandler(), false);
|
||||
|
||||
@@ -128,6 +128,7 @@ public abstract class AbstractWorldAdaptor<W> implements WorldAdaptor<W> {
|
||||
}
|
||||
|
||||
private int[] queueToIntArray(PriorityQueue<DelayedTickTask> queue) {
|
||||
queue.removeIf(Objects::isNull);
|
||||
int size = queue.size() * 2;
|
||||
int[] tasks = new int[size];
|
||||
int i = 0;
|
||||
|
||||
Reference in New Issue
Block a user