make worldguard hook register on load

This commit is contained in:
2023-03-26 03:09:07 +02:00
parent 61908b8fab
commit 7d2c41646e
3 changed files with 19 additions and 16 deletions
@@ -76,13 +76,6 @@ public final class PreventStabby extends JavaPlugin {
pvpCommand.setExecutor(mainCommand);
pvpCommand.setTabCompleter(mainCommand);
try {
WorldGuardHook.init();
worldGuardHook = true;
} catch (NoClassDefFoundError e) {
worldGuardHook = false;
}
if (getServer().getPluginManager().getPlugin("PlaceholderAPI") != null) {
new PlacoholderApiHook(this).register();
}
@@ -90,6 +83,18 @@ public final class PreventStabby extends JavaPlugin {
Metrics metrics = new Metrics(this, 14074);
}
@Override
public void onLoad() {
if (getServer().getPluginManager().getPlugin("WorldGuard") != null) {
try {
WorldGuardHook.init();
worldGuardHook = true;
} catch (NoClassDefFoundError e) {
worldGuardHook = false;
}
}
}
public static boolean worldGuardHookEnabled() {
return worldGuardHook;
}