From b6df380ee33cf540ca2047e3a56ae2f9ac9bfa4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Szab=C3=B3?= Date: Fri, 8 Nov 2024 09:04:24 +0100 Subject: [PATCH] try catch hooks --- build.gradle.kts | 4 ++-- .../java/gg/auroramc/quests/hooks/HookManager.java | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 0623611..0ecca5d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -18,7 +18,7 @@ plugins { } group = "gg.auroramc" -version = "1.3.5" +version = "1.3.6" repositories { mavenCentral() @@ -52,7 +52,7 @@ dependencies { } compileOnly("com.github.Xiao-MoMi:Custom-Fishing:2.2.26") compileOnly("com.nisovin.shopkeepers:ShopkeepersAPI:2.22.3") - compileOnly("com.github.Gypopo:EconomyShopGUI-API:1.7.1") + compileOnly("com.github.Gypopo:EconomyShopGUI-API:1.7.2") compileOnly("io.th0rgal:oraxen:1.179.0") compileOnly("com.github.brcdev-minecraft:shopgui-api:3.0.0") compileOnly("io.lumine:MythicLib-dist:1.6.2-SNAPSHOT") diff --git a/src/main/java/gg/auroramc/quests/hooks/HookManager.java b/src/main/java/gg/auroramc/quests/hooks/HookManager.java index 6b0ed20..c4e38a0 100644 --- a/src/main/java/gg/auroramc/quests/hooks/HookManager.java +++ b/src/main/java/gg/auroramc/quests/hooks/HookManager.java @@ -12,9 +12,13 @@ public class HookManager { public static void enableHooks(AuroraQuests plugin) { for (var hook : hooks.values()) { - hook.hook(plugin); - if (hook instanceof Listener) { - Bukkit.getPluginManager().registerEvents((Listener) hook, plugin); + try { + hook.hook(plugin); + if (hook instanceof Listener) { + Bukkit.getPluginManager().registerEvents((Listener) hook, plugin); + } + } catch (Exception e) { + AuroraQuests.logger().warning("Failed to enable hook " + hook.getClass().getSimpleName() + ": " + e.getMessage()); } } }