Add BukkitTask#isCancelled
By: blablubbabc <lukas@wirsindwir.de>
This commit is contained in:
parent
3fec810197
commit
587e93b11a
2 changed files with 5 additions and 4 deletions
|
@ -28,10 +28,6 @@ class CraftFuture<T> extends CraftTask implements Future<T> {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isCancelled() {
|
|
||||||
return getPeriod() == -2l;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isDone() {
|
public boolean isDone() {
|
||||||
final long period = this.getPeriod();
|
final long period = this.getPeriod();
|
||||||
return period != -1l && period != -3l;
|
return period != -1l && period != -3l;
|
||||||
|
|
|
@ -81,6 +81,11 @@ class CraftTask implements BukkitTask, Runnable {
|
||||||
return task.getClass();
|
return task.getClass();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isCancelled() {
|
||||||
|
return (period == -2l);
|
||||||
|
}
|
||||||
|
|
||||||
public void cancel() {
|
public void cancel() {
|
||||||
Bukkit.getScheduler().cancelTask(id);
|
Bukkit.getScheduler().cancelTask(id);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue