From 9d314a68d1b913f8ab9320238fa3b13f620f1b63 Mon Sep 17 00:00:00 2001 From: SkytAsul Date: Wed, 8 Jun 2022 18:13:44 +0200 Subject: [PATCH] Failsafe for HolographicDisplays v3 --- .../utils/compatibility/DependenciesManager.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/fr/skytasul/quests/utils/compatibility/DependenciesManager.java b/core/src/main/java/fr/skytasul/quests/utils/compatibility/DependenciesManager.java index d9be535a..bf2acc93 100644 --- a/core/src/main/java/fr/skytasul/quests/utils/compatibility/DependenciesManager.java +++ b/core/src/main/java/fr/skytasul/quests/utils/compatibility/DependenciesManager.java @@ -94,7 +94,16 @@ public class DependenciesManager implements Listener { }); public static final BQDependency holod2 = new BQDependency("HolographicDisplays", () -> QuestsAPI.setHologramsManager(new BQHolographicDisplays2()), null, plugin -> plugin.getClass().getName().equals("com.gmail.filoghost.holographicdisplays.HolographicDisplays")); - public static final BQDependency holod3 = new BQDependency("HolographicDisplays", () -> QuestsAPI.setHologramsManager(new BQHolographicDisplays3()), null, plugin -> plugin.getClass().getName().equals("me.filoghost.holographicdisplays.plugin.HolographicDisplays")); + public static final BQDependency holod3 = new BQDependency("HolographicDisplays", () -> QuestsAPI.setHologramsManager(new BQHolographicDisplays3()), null, plugin -> { + if (!plugin.getClass().getName().equals("me.filoghost.holographicdisplays.plugin.HolographicDisplays")) return false; + try { + Class.forName("me.filoghost.holographicdisplays.api.HolographicDisplaysAPI"); + return true; + }catch (ClassNotFoundException ex) { + BeautyQuests.logger.warning("Your version of HolographicDisplays is unsupported. Please make sure you are running the LATEST dev build of HolographicDisplays."); + return false; + } + }); public static final BQDependency sentinel = new BQDependency("Sentinel", BQSentinel::initialize);