Skip to content

Commit

Permalink
Fix logging task (sync) not registering. Shuffle init order.
Browse files Browse the repository at this point in the history
  • Loading branch information
asofold committed Nov 19, 2014
1 parent 4544e1d commit 3364d48
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 22 deletions.
Expand Up @@ -35,6 +35,7 @@ public BukkitLogNodeDispatcher(Plugin plugin) {
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
Expand Down
46 changes: 24 additions & 22 deletions NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/NoCheatPlus.java
Expand Up @@ -732,36 +732,23 @@ public void onEnable() {
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);
Expand All @@ -773,6 +760,21 @@ public void onEnable() {
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
Expand Down

0 comments on commit 3364d48

Please sign in to comment.