mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-09-16 00:47:27 +02:00
Explicitly cancel data-man task.
This commit is contained in:
parent
1cd04e58a8
commit
54fd0d6bff
@ -250,6 +250,8 @@ public class NoCheatPlus extends JavaPlugin implements NoCheatPlusAPI {
|
|||||||
protected Set<Object> allComponents = new LinkedHashSet<Object>(50);
|
protected Set<Object> allComponents = new LinkedHashSet<Object>(50);
|
||||||
|
|
||||||
protected Metrics metrics = null;
|
protected Metrics metrics = null;
|
||||||
|
|
||||||
|
private int dataManTaskId = -1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interfaces checked for managed listeners: IHaveMethodOrder (method), ComponentWithName (tag)<br>
|
* Interfaces checked for managed listeners: IHaveMethodOrder (method), ComponentWithName (tag)<br>
|
||||||
@ -350,6 +352,9 @@ public class NoCheatPlus extends JavaPlugin implements NoCheatPlusAPI {
|
|||||||
}
|
}
|
||||||
listenerManager.setRegisterDirectly(false);
|
listenerManager.setRegisterDirectly(false);
|
||||||
listenerManager.clear();
|
listenerManager.clear();
|
||||||
|
|
||||||
|
// Stop data-man task.
|
||||||
|
if (dataManTaskId != -1) getServer().getScheduler().cancelTask(dataManTaskId);
|
||||||
|
|
||||||
// Stop the tickTask.
|
// Stop the tickTask.
|
||||||
if (verbose) LogUtil.logInfo("[NoCheatPlus] Stop TickTask...");
|
if (verbose) LogUtil.logInfo("[NoCheatPlus] Stop TickTask...");
|
||||||
@ -523,7 +528,7 @@ public class NoCheatPlus extends JavaPlugin implements NoCheatPlusAPI {
|
|||||||
// Set up the tick task.
|
// Set up the tick task.
|
||||||
TickTask.start(this);
|
TickTask.start(this);
|
||||||
|
|
||||||
Bukkit.getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
|
this.dataManTaskId = Bukkit.getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
dataMan.checkExpiration();
|
dataMan.checkExpiration();
|
||||||
|
Loading…
Reference in New Issue
Block a user