mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-23 11:06:29 +01:00
Add BukkitTask#isCancelled
This commit is contained in:
parent
8bf06d6cbf
commit
bde2a93cfe
@ -28,10 +28,6 @@ class CraftFuture<T> extends CraftTask implements Future<T> {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return getPeriod() == -2l;
|
||||
}
|
||||
|
||||
public boolean isDone() {
|
||||
final long period = this.getPeriod();
|
||||
return period != -1l && period != -3l;
|
||||
|
@ -81,6 +81,11 @@ class CraftTask implements BukkitTask, Runnable {
|
||||
return task.getClass();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return (period == -2l);
|
||||
}
|
||||
|
||||
public void cancel() {
|
||||
Bukkit.getScheduler().cancelTask(id);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user