diff options
author | Wesley Wolfe <wesley.d.wolfe+git@gmail.com> | 2014-08-07 19:26:52 -0500 |
---|---|---|
committer | Wesley Wolfe <wesley.d.wolfe+git@gmail.com> | 2014-08-07 19:26:52 -0500 |
commit | 246c53f5a2ae3a3a4d3dcdd6ffff0530278e59d6 (patch) | |
tree | 1ed1327ae133408c16c93023deb779bbe240bc95 /src/main | |
parent | f9e3bf24a8104f070b3fc4d57e7bbd3d7532be75 (diff) | |
download | bukkit-246c53f5a2ae3a3a4d3dcdd6ffff0530278e59d6.tar bukkit-246c53f5a2ae3a3a4d3dcdd6ffff0530278e59d6.tar.gz bukkit-246c53f5a2ae3a3a4d3dcdd6ffff0530278e59d6.tar.lz bukkit-246c53f5a2ae3a3a4d3dcdd6ffff0530278e59d6.tar.xz bukkit-246c53f5a2ae3a3a4d3dcdd6ffff0530278e59d6.zip |
Add deprecated BukkitRunnable overloads in the scheduler. Adds BUKKIT-5752
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/bukkit/scheduler/BukkitRunnable.java | 12 | ||||
-rw-r--r-- | src/main/java/org/bukkit/scheduler/BukkitScheduler.java | 54 |
2 files changed, 60 insertions, 6 deletions
diff --git a/src/main/java/org/bukkit/scheduler/BukkitRunnable.java b/src/main/java/org/bukkit/scheduler/BukkitRunnable.java index 03519443..c146ec7a 100644 --- a/src/main/java/org/bukkit/scheduler/BukkitRunnable.java +++ b/src/main/java/org/bukkit/scheduler/BukkitRunnable.java @@ -29,7 +29,7 @@ public abstract class BukkitRunnable implements Runnable { */ public synchronized BukkitTask runTask(Plugin plugin) throws IllegalArgumentException, IllegalStateException { checkState(); - return setupId(Bukkit.getScheduler().runTask(plugin, this)); + return setupId(Bukkit.getScheduler().runTask(plugin, (Runnable) this)); } /** @@ -46,7 +46,7 @@ public abstract class BukkitRunnable implements Runnable { */ public synchronized BukkitTask runTaskAsynchronously(Plugin plugin) throws IllegalArgumentException, IllegalStateException { checkState(); - return setupId(Bukkit.getScheduler().runTaskAsynchronously(plugin, this)); + return setupId(Bukkit.getScheduler().runTaskAsynchronously(plugin, (Runnable) this)); } /** @@ -61,7 +61,7 @@ public abstract class BukkitRunnable implements Runnable { */ public synchronized BukkitTask runTaskLater(Plugin plugin, long delay) throws IllegalArgumentException, IllegalStateException { checkState(); - return setupId(Bukkit.getScheduler().runTaskLater(plugin, this, delay)); + return setupId(Bukkit.getScheduler().runTaskLater(plugin, (Runnable) this, delay)); } /** @@ -80,7 +80,7 @@ public abstract class BukkitRunnable implements Runnable { */ public synchronized BukkitTask runTaskLaterAsynchronously(Plugin plugin, long delay) throws IllegalArgumentException, IllegalStateException { checkState(); - return setupId(Bukkit.getScheduler().runTaskLaterAsynchronously(plugin, this, delay)); + return setupId(Bukkit.getScheduler().runTaskLaterAsynchronously(plugin, (Runnable) this, delay)); } /** @@ -97,7 +97,7 @@ public abstract class BukkitRunnable implements Runnable { */ public synchronized BukkitTask runTaskTimer(Plugin plugin, long delay, long period) throws IllegalArgumentException, IllegalStateException { checkState(); - return setupId(Bukkit.getScheduler().runTaskTimer(plugin, this, delay, period)); + return setupId(Bukkit.getScheduler().runTaskTimer(plugin, (Runnable) this, delay, period)); } /** @@ -119,7 +119,7 @@ public abstract class BukkitRunnable implements Runnable { */ public synchronized BukkitTask runTaskTimerAsynchronously(Plugin plugin, long delay, long period) throws IllegalArgumentException, IllegalStateException { checkState(); - return setupId(Bukkit.getScheduler().runTaskTimerAsynchronously(plugin, this, delay, period)); + return setupId(Bukkit.getScheduler().runTaskTimerAsynchronously(plugin, (Runnable) this, delay, period)); } /** diff --git a/src/main/java/org/bukkit/scheduler/BukkitScheduler.java b/src/main/java/org/bukkit/scheduler/BukkitScheduler.java index 44d94f08..dfecafa7 100644 --- a/src/main/java/org/bukkit/scheduler/BukkitScheduler.java +++ b/src/main/java/org/bukkit/scheduler/BukkitScheduler.java @@ -20,6 +20,12 @@ public interface BukkitScheduler { public int scheduleSyncDelayedTask(Plugin plugin, Runnable task, long delay); /** + * @deprecated Use {@link BukkitRunnable#runTaskLater(Plugin, long)} + */ + @Deprecated + public int scheduleSyncDelayedTask(Plugin plugin, BukkitRunnable task, long delay); + + /** * Schedules a once off task to occur as soon as possible. * <p> * This task will be executed by the main server thread. @@ -31,6 +37,12 @@ public interface BukkitScheduler { public int scheduleSyncDelayedTask(Plugin plugin, Runnable task); /** + * @deprecated Use {@link BukkitRunnable#runTask(Plugin)} + */ + @Deprecated + public int scheduleSyncDelayedTask(Plugin plugin, BukkitRunnable task); + + /** * Schedules a repeating task. * <p> * This task will be executed by the main server thread. @@ -44,6 +56,12 @@ public interface BukkitScheduler { public int scheduleSyncRepeatingTask(Plugin plugin, Runnable task, long delay, long period); /** + * @deprecated Use {@link BukkitRunnable#runTaskTimer(Plugin, long, long)} + */ + @Deprecated + public int scheduleSyncRepeatingTask(Plugin plugin, BukkitRunnable task, long delay, long period); + + /** * <b>Asynchronous tasks should never access any API in Bukkit. Great care * should be taken to assure the thread-safety of asynchronous tasks.</b> * <p> @@ -189,6 +207,12 @@ public interface BukkitScheduler { public BukkitTask runTask(Plugin plugin, Runnable task) throws IllegalArgumentException; /** + * @deprecated Use {@link BukkitRunnable#runTask(Plugin)} + */ + @Deprecated + public BukkitTask runTask(Plugin plugin, BukkitRunnable task) throws IllegalArgumentException; + + /** * <b>Asynchronous tasks should never access any API in Bukkit. Great care * should be taken to assure the thread-safety of asynchronous tasks.</b> * <p> @@ -203,6 +227,12 @@ public interface BukkitScheduler { public BukkitTask runTaskAsynchronously(Plugin plugin, Runnable task) throws IllegalArgumentException; /** + * @deprecated Use {@link BukkitRunnable#runTaskAsynchronously(Plugin)} + */ + @Deprecated + public BukkitTask runTaskAsynchronously(Plugin plugin, BukkitRunnable task) throws IllegalArgumentException; + + /** * Returns a task that will run after the specified number of server * ticks. * @@ -216,6 +246,12 @@ public interface BukkitScheduler { public BukkitTask runTaskLater(Plugin plugin, Runnable task, long delay) throws IllegalArgumentException; /** + * @deprecated Use {@link BukkitRunnable#runTaskLater(Plugin, long)} + */ + @Deprecated + public BukkitTask runTaskLater(Plugin plugin, BukkitRunnable task, long delay) throws IllegalArgumentException; + + /** * <b>Asynchronous tasks should never access any API in Bukkit. Great care * should be taken to assure the thread-safety of asynchronous tasks.</b> * <p> @@ -232,6 +268,12 @@ public interface BukkitScheduler { public BukkitTask runTaskLaterAsynchronously(Plugin plugin, Runnable task, long delay) throws IllegalArgumentException; /** + * @deprecated Use {@link BukkitRunnable#runTaskLaterAsynchronously(Plugin, long)} + */ + @Deprecated + public BukkitTask runTaskLaterAsynchronously(Plugin plugin, BukkitRunnable task, long delay) throws IllegalArgumentException; + + /** * Returns a task that will repeatedly run until cancelled, starting after * the specified number of server ticks. * @@ -246,6 +288,12 @@ public interface BukkitScheduler { public BukkitTask runTaskTimer(Plugin plugin, Runnable task, long delay, long period) throws IllegalArgumentException; /** + * @deprecated Use {@link BukkitRunnable#runTaskTimer(Plugin, long, long)} + */ + @Deprecated + public BukkitTask runTaskTimer(Plugin plugin, BukkitRunnable task, long delay, long period) throws IllegalArgumentException; + + /** * <b>Asynchronous tasks should never access any API in Bukkit. Great care * should be taken to assure the thread-safety of asynchronous tasks.</b> * <p> @@ -262,4 +310,10 @@ public interface BukkitScheduler { * @throws IllegalArgumentException if task is null */ public BukkitTask runTaskTimerAsynchronously(Plugin plugin, Runnable task, long delay, long period) throws IllegalArgumentException; + + /** + * @deprecated Use {@link BukkitRunnable#runTaskTimerAsynchronously(Plugin, long, long)} + */ + @Deprecated + public BukkitTask runTaskTimerAsynchronously(Plugin plugin, BukkitRunnable task, long delay, long period) throws IllegalArgumentException; } |