From 0fcbcbbb11889d5a5616720b79cd5f9be743af1d Mon Sep 17 00:00:00 2001 From: Phoenix616 Date: Mon, 25 Sep 2023 12:55:42 +0100 Subject: [PATCH] Fix ChestShop not starting if an error occurred hooking into a dependency --- src/main/java/com/Acrobot/ChestShop/Dependencies.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/Acrobot/ChestShop/Dependencies.java b/src/main/java/com/Acrobot/ChestShop/Dependencies.java index 2cea5a1..53bef1b 100644 --- a/src/main/java/com/Acrobot/ChestShop/Dependencies.java +++ b/src/main/java/com/Acrobot/ChestShop/Dependencies.java @@ -20,6 +20,7 @@ import org.bukkit.plugin.PluginManager; import java.util.AbstractMap; import java.util.HashMap; import java.util.Map; +import java.util.logging.Level; import java.util.stream.Collectors; /** @@ -68,7 +69,11 @@ public class Dependencies implements Listener { Plugin plugin = pluginManager.getPlugin(dependency); if (plugin != null && plugin.isEnabled()) { - loadPlugin(dependency, plugin); + try { + loadPlugin(dependency, plugin); + } catch (Exception e) { + plugin.getLogger().log(Level.WARNING, "Unable to hook into " + plugin.getName() + " " + plugin.getDescription().getVersion(), e); + } } }