Fix tasks not cancelling correctly, close #412, close #413

This commit is contained in:
William278 committed 2023-05-25 19:12:46 +01:00
1 parent 474db95b1a
commit dd6c23168d
4 files changed
+15 -13

No files matched your search

@@ -81,12 +81,9 @@ public interface BukkitTaskRunner extends TaskRunner {
GracefulScheduling getScheduler();
@NotNull
@Override
ConcurrentHashMap<Integer, ScheduledTask> getTasks();
private int getNextTaskId() {
return getTasks().keySet().stream().max(Integer::compareTo).orElse(0) + 1;
}
@NotNull
default Duration getDurationTicks(long ticks) {
return Duration.of(ticks * 50, ChronoUnit.MILLIS);