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() { public void startTasks() {
// TODO: This is a temporary solution. Needs on-demand scheduling [or a wrapper task]. // TODO: This is a temporary solution. Needs on-demand scheduling [or a wrapper task].
TickTask.addTickListener(taskPrimary); TickTask.addTickListener(taskPrimary);
scheduleAsynchronous(); // Just in case.
} }
@Override @Override

View File

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