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