Skip to content

Commit

Permalink
try catch hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikSzabo committed Nov 8, 2024
1 parent 2fcc685 commit b6df380
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ plugins {
}

group = "gg.auroramc"
version = "1.3.5"
version = "1.3.6"

repositories {
mavenCentral()
Expand Down Expand Up @@ -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")
Expand Down
10 changes: 7 additions & 3 deletions src/main/java/gg/auroramc/quests/hooks/HookManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
}
Expand Down

0 comments on commit b6df380

Please sign in to comment.