Prevent task scheduling on disable.

This commit is contained in:
garbagemule 2013-07-30 13:31:11 +02:00
parent 859baf7b71
commit a5fb96a880

View File

@ -8,6 +8,7 @@ import com.garbagemule.MobArena.framework.Arena;
public class Delays public class Delays
{ {
public static void douse(MobArena plugin, final Player p, long delay) { public static void douse(MobArena plugin, final Player p, long delay) {
if (!plugin.isEnabled()) return;
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() { plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
public void run() { public void run() {
if (p.isOnline()) { if (p.isOnline()) {
@ -18,6 +19,7 @@ public class Delays
} }
public static void revivePlayer(MobArena plugin, final Arena arena, final Player p) { public static void revivePlayer(MobArena plugin, final Arena arena, final Player p) {
if (!plugin.isEnabled()) return;
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() { plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
public void run() { public void run() {
if (p.isOnline()) { if (p.isOnline()) {