From e4c4643bea2af7d48e87ffcafc6852719aee0b28 Mon Sep 17 00:00:00 2001 From: Ghost_chu <2908803755@qq.com> Date: Fri, 17 Jan 2020 22:32:21 +0800 Subject: [PATCH] Fix helper cannot get annotation Former-commit-id: 833e0b7967194fd1ce64ad156cffe85487dafe10 --- .../org/maxgamer/quickshop/Util/IntegrationHelper.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/maxgamer/quickshop/Util/IntegrationHelper.java b/src/main/java/org/maxgamer/quickshop/Util/IntegrationHelper.java index af9a19c19..c6a9d5aae 100644 --- a/src/main/java/org/maxgamer/quickshop/Util/IntegrationHelper.java +++ b/src/main/java/org/maxgamer/quickshop/Util/IntegrationHelper.java @@ -36,6 +36,7 @@ public class IntegrationHelper { if (!isIntegrationClass(clazz)) { throw new InvaildIntegratedPluginClass(); } + Util.debugLog("Registering "+clazz.getName()); integrations.add(clazz); } @@ -44,12 +45,14 @@ public class IntegrationHelper { if (!isIntegrationClass(clazz)) { throw new InvaildIntegratedPluginClass(); } + Util.debugLog("Unregistering "+clazz.getName()); integrations.remove(clazz); } public void callIntegrationsLoad(@NotNull IntegrateStage stage) { integrations.forEach(integratedPlugin -> { - if (integratedPlugin.getClass().getAnnotation(IntegrationStage.class).loadStage() == stage) { + if (integratedPlugin.getClass().getDeclaredAnnotation(IntegrationStage.class).loadStage() == stage) { + Util.debugLog("Calling for load "+integratedPlugin.getName()); integratedPlugin.load(); } }); @@ -57,7 +60,8 @@ public class IntegrationHelper { public void callIntegrationsUnload(@NotNull IntegrateStage stage) { integrations.forEach(integratedPlugin -> { - if (integratedPlugin.getClass().getAnnotation(IntegrationStage.class).loadStage() == stage) { + if (integratedPlugin.getClass().getDeclaredAnnotation(IntegrationStage.class).loadStage() == stage) { + Util.debugLog("Calling for unload "+integratedPlugin.getName()); integratedPlugin.unload(); } });