onEnable: Log an error if NCP is not there or already enabled. Spaces.

This commit is contained in:
asofold 2015-03-22 01:24:18 +01:00
parent 94fd56e66f
commit 21d54b48a4
1 changed files with 408 additions and 399 deletions

View File

@ -246,6 +246,15 @@ public class CompatNoCheatPlus extends JavaPlugin implements Listener {
// Start ticktask 2
getServer().getScheduler().scheduleSyncRepeatingTask(this, new TickTask2(), 1, 1);
// Check for the NoCheatPlus plugin.
Plugin plugin = pm.getPlugin("NoCheatPlus");
if (plugin == null) {
getLogger().severe("[CompatNoCheatPlus] The NoCheatPlus plugin is not present.");
}
else if (plugin.isEnabled()) {
getLogger().severe("[CompatNoCheatPlus] The NoCheatPlus plugin already is enabled, this might break several hooks.");
}
// Finished.
getLogger().info(getDescription().getFullName() + " is enabled. Some hooks might get registered with NoCheatPlus later on.");
}