diff options
author | blablubbabc <lukas@wirsindwir.de> | 2017-08-29 13:46:18 +0200 |
---|---|---|
committer | md_5 <git@md-5.net> | 2017-09-02 17:04:29 +1000 |
commit | bde2a93cfec0d4715df51ca101b9e97cd3be8762 (patch) | |
tree | f96a354f458d32ce0431a5e3bc1ed6d1b72ca017 /src/main/java | |
parent | 8bf06d6cbff1e1d492ffe213c11d476623ab0754 (diff) | |
download | craftbukkit-bde2a93cfec0d4715df51ca101b9e97cd3be8762.tar craftbukkit-bde2a93cfec0d4715df51ca101b9e97cd3be8762.tar.gz craftbukkit-bde2a93cfec0d4715df51ca101b9e97cd3be8762.tar.lz craftbukkit-bde2a93cfec0d4715df51ca101b9e97cd3be8762.tar.xz craftbukkit-bde2a93cfec0d4715df51ca101b9e97cd3be8762.zip |
Add BukkitTask#isCancelled
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/scheduler/CraftFuture.java | 4 | ||||
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftFuture.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftFuture.java index 1baec564..191a1c13 100644 --- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftFuture.java +++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftFuture.java @@ -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; diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java index 55db3ff8..9cb666bb 100644 --- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java +++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java @@ -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); } |