1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-26 12:35:28 +01:00

Fixed NPE when MythicMobs plugin not found on plugin reload

This commit is contained in:
montlikadani 2020-01-28 17:23:47 +01:00
parent 8f067f4646
commit 5aa4f0b763
2 changed files with 6 additions and 2 deletions

View File

@ -769,7 +769,7 @@ public class Jobs extends JavaPlugin {
if (HookManager.getMcMMOManager().CheckmcMMO()) {
HookManager.setMcMMOlistener();
}
if (HookManager.getMythicManager().Check()) {
if (HookManager.checkMythicMobs()) {
HookManager.getMythicManager().registerListener();
}
}

View File

@ -31,7 +31,7 @@ public class HookManager {
setWorldGuard();
setMythicManager();
if (Jobs.getGCManager().MythicMobsEnabled && MythicManager != null && MythicManager.Check())
if (checkMythicMobs())
MythicManager.registerListener();
}
@ -62,6 +62,10 @@ public class HookManager {
return MythicManager;
}
public static boolean checkMythicMobs() {
return Jobs.getGCManager().MythicMobsEnabled && MythicManager != null && MythicManager.Check();
}
private static boolean setWorldGuard() {
if (pm.getPlugin("WorldGuard") != null && pm.isPluginEnabled("WorldGuard")) {
worldGuardManager = new WorldGuardManager();