mcMMO/src/main/java/com/gmail/nossr50/runnables/MobStoreCleaner.java

38 lines
799 B
Java
Raw Normal View History

package com.gmail.nossr50.runnables;
import org.bukkit.Bukkit;
import org.bukkit.scheduler.BukkitScheduler;
import com.gmail.nossr50.mcMMO;
2013-01-26 23:01:55 +01:00
public class MobStoreCleaner implements Runnable {
private int taskID;
2013-01-26 23:01:55 +01:00
public MobStoreCleaner() {
taskID = -1;
start();
}
2013-01-26 23:01:55 +01:00
public void start() {
if (taskID >= 0) {
return;
2013-01-26 23:01:55 +01:00
}
BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
taskID = scheduler.scheduleSyncRepeatingTask(mcMMO.p, this, 12000, 12000);
}
2013-01-26 23:01:55 +01:00
public void stop() {
if (taskID < 0) {
return;
2013-01-26 23:01:55 +01:00
}
Bukkit.getServer().getScheduler().cancelTask(taskID);
taskID = -1;
}
@Override
2013-01-26 23:01:55 +01:00
public void run() {
2013-01-14 06:27:30 +01:00
mcMMO.placeStore.cleanMobLists();
}
}