Fix logging task (sync) not registering. Shuffle init order.

This commit is contained in:
asofold 2014-11-19 23:09:14 +01:00
parent 4544e1da7b
commit 3364d487cf
2 changed files with 25 additions and 22 deletions

View File

@ -35,6 +35,7 @@ public class BukkitLogNodeDispatcher extends AbstractLogNodeDispatcher { // TODO
public void startTasks() {
// TODO: This is a temporary solution. Needs on-demand scheduling [or a wrapper task].
TickTask.addTickListener(taskPrimary);
scheduleAsynchronous(); // Just in case.
}
@Override

View File

@ -732,36 +732,23 @@ public class NoCheatPlus extends JavaPlugin implements NoCheatPlusAPI {
TickTask.cancel();
TickTask.reset();
// Start logger task(s).
logManager.startTasks();
// Register some generic stuff.
// Counters: debugging purposes, maybe integrated for statistics later.
registerGenericInstance(new Counters());
// Allow entries to TickTask (just in case).
TickTask.setLocked(false);
// Initialize configuration, if needed.
if (!ConfigManager.isInitialized()) {
// Read the configuration files (should only happen on reloading).
ConfigManager.init(this);
}
final ConfigFile config = ConfigManager.getConfigFile();
useSubscriptions = config.getBoolean(ConfPaths.LOGGING_BACKEND_INGAMECHAT_SUBSCRIPTIONS);
// Initialize MCAccess.
initMCAccess(config);
// Initialize BlockProperties.
initBlockProperties(config);
// Initialize data manager.
disableListeners.add(0, dataMan);
dataMan.onEnable();
// Allow entries to TickTask (just in case).
TickTask.setLocked(false);
// List the events listeners and register.
// Start logger task(s).
logManager.startTasks();
manageListeners = config.getBoolean(ConfPaths.COMPATIBILITY_MANAGELISTENERS);
if (manageListeners) {
listenerManager.setRegisterDirectly(true);
@ -773,6 +760,21 @@ public class NoCheatPlus extends JavaPlugin implements NoCheatPlusAPI {
listenerManager.clear();
}
// Register some generic stuff.
// Counters: debugging purposes, maybe integrated for statistics later.
registerGenericInstance(new Counters());
// Initialize MCAccess.
initMCAccess(config);
// Initialize BlockProperties.
initBlockProperties(config);
// Initialize data manager.
disableListeners.add(0, dataMan);
dataMan.onEnable();
// Register components.
@SetupOrder(priority = - 100)
class ReloadHook implements INotifyReload{
@Override