mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 03:34:43 +02:00
Converting entity tracking to use Bukkit metadata. Should greatly reduce lag on chunk loading and unloading.
This commit is contained in:
@ -1,38 +0,0 @@
|
||||
package com.gmail.nossr50.runnables;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.scheduler.BukkitScheduler;
|
||||
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
|
||||
public class MobStoreCleaner implements Runnable {
|
||||
private int taskID;
|
||||
|
||||
public MobStoreCleaner() {
|
||||
taskID = -1;
|
||||
start();
|
||||
}
|
||||
|
||||
public void start() {
|
||||
if (taskID >= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
|
||||
taskID = scheduler.scheduleSyncRepeatingTask(mcMMO.p, this, 12000, 12000);
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
if (taskID < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
Bukkit.getServer().getScheduler().cancelTask(taskID);
|
||||
taskID = -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
mcMMO.placeStore.cleanMobLists();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user