TickTask changes applied to plugin.

This commit is contained in:
asofold 2012-12-02 17:03:43 +01:00
parent a156d1117b
commit 8082b3d33d

View File

@ -302,6 +302,7 @@ public class NoCheatPlus extends JavaPlugin implements NoCheatPlusAPI {
final PluginDescriptionFile pdfFile = getDescription(); final PluginDescriptionFile pdfFile = getDescription();
// Stop the tickTask. // Stop the tickTask.
TickTask.setLocked(true);
TickTask.cancel(); TickTask.cancel();
// Stop the lag measuring task. // Stop the lag measuring task.
@ -330,6 +331,9 @@ public class NoCheatPlus extends JavaPlugin implements NoCheatPlusAPI {
// Remove listener references. // Remove listener references.
listenerManager.setRegisterDirectly(false); listenerManager.setRegisterDirectly(false);
listenerManager.clear(); listenerManager.clear();
// More cleanup.
TickTask.purge();
// Tell the server administrator the we finished unloading NoCheatPlus. // Tell the server administrator the we finished unloading NoCheatPlus.
LogUtil.logInfo("[NoCheatPlus] Version " + pdfFile.getVersion() + " is disabled."); LogUtil.logInfo("[NoCheatPlus] Version " + pdfFile.getVersion() + " is disabled.");
@ -371,8 +375,11 @@ public class NoCheatPlus extends JavaPlugin implements NoCheatPlusAPI {
// Read the configuration files. // Read the configuration files.
ConfigManager.init(this); ConfigManager.init(this);
final ConfigFile config = ConfigManager.getConfigFile(); // Allow entries to TickTask (just in case).
TickTask.setLocked(false);
//
final ConfigFile config = ConfigManager.getConfigFile();
BlockProperties.applyConfig(config, ConfPaths.COMPATIBILITY_BLOCKS); // Temp probably, BlockProperties.applyConfig(config, ConfPaths.COMPATIBILITY_BLOCKS); // Temp probably,
// List the events listeners and register. // List the events listeners and register.