13
0
geforkt von Mirrors/Paper

Add deprecated BukkitRunnable overloads in the scheduler. Adds BUKKIT-5752

By: Wesley Wolfe <wesley.d.wolfe+git@gmail.com>
Dieser Commit ist enthalten in:
Bukkit/Spigot 2014-08-07 19:26:52 -05:00
Ursprung 7396e8f7c4
Commit e5b1ff6d1d
2 geänderte Dateien mit 60 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -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));
}
/**

Datei anzeigen

@ -19,6 +19,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>
@ -30,6 +36,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>
@ -43,6 +55,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>
@ -188,6 +206,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>
@ -202,6 +226,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.
@ -215,6 +245,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>
@ -231,6 +267,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.
@ -245,6 +287,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>
@ -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;
}