From 76732f805a8b4d7e54e69ffaf5ba8f9c1aa47285 Mon Sep 17 00:00:00 2001 From: egg82 Date: Mon, 1 Oct 2018 13:48:38 -0600 Subject: [PATCH] * Fixed issues with PLAN support killing the plugin. Sorry! --- Bukkit/pom.xml | 4 ++-- Bukkit/src/main/resources/plugin.yml | 3 ++- Bukkit/src/me/egg82/avpn/AntiVPN.java | 18 +++++++++--------- Bungee/pom.xml | 4 ++-- Bungee/src/main/resources/plugin.yml | 3 ++- Bungee/src/me/egg82/avpn/AntiVPN.java | 18 +++++++++--------- Common/pom.xml | 2 +- 7 files changed, 27 insertions(+), 25 deletions(-) diff --git a/Bukkit/pom.xml b/Bukkit/pom.xml index 5eb3ee0b..d8df149c 100644 --- a/Bukkit/pom.xml +++ b/Bukkit/pom.xml @@ -1,7 +1,7 @@ 4.0.0 AntiVPN-Bukkit - 2.4.13 + 2.4.14 AntiVPN src @@ -222,7 +222,7 @@ ninja.egg82.plugins AntiVPN - 2.4.13 + 2.4.14 ninja.egg82.lib diff --git a/Bukkit/src/main/resources/plugin.yml b/Bukkit/src/main/resources/plugin.yml index 3d08199a..eb6e7f31 100644 --- a/Bukkit/src/main/resources/plugin.yml +++ b/Bukkit/src/main/resources/plugin.yml @@ -1,9 +1,10 @@ name: AntiVPN main: me.egg82.avpn.AntiVPN -version: 2.4.13 +version: 2.4.14 author: egg82 api-version: 1.13 description: Get the best; save money on overpriced plugins and block VPN users! +softdepend: [Plan] commands: avpnreload: description: Reloads the plugin diff --git a/Bukkit/src/me/egg82/avpn/AntiVPN.java b/Bukkit/src/me/egg82/avpn/AntiVPN.java index b1275116..c5fa3fc7 100644 --- a/Bukkit/src/me/egg82/avpn/AntiVPN.java +++ b/Bukkit/src/me/egg82/avpn/AntiVPN.java @@ -95,15 +95,6 @@ public void onLoad() { PluginReflectUtil.addServicesFromPackage("me.egg82.avpn.registries", true); PluginReflectUtil.addServicesFromPackage("me.egg82.avpn.lists", true); - PluginManager manager = getServer().getPluginManager(); - - if (manager.getPlugin("Plan") != null) { - printInfo(ChatColor.GREEN + "Enabling support for Plan."); - ServiceLocator.provideService(PlanAnalyticsHelper.class, false); - } else { - printInfo(ChatColor.YELLOW + "Plan was not found. Personal analytics support has been disabled."); - } - Configuration config = ConfigLoader.getConfig("config.yml", "config.yml"); Config.debug = config.getNode("debug").getBoolean(); @@ -173,6 +164,15 @@ public void onLoad() { public void onEnable() { super.onEnable(); + PluginManager manager = getServer().getPluginManager(); + + if (manager.getPlugin("Plan") != null) { + printInfo(ChatColor.GREEN + "Enabling support for Plan."); + ServiceLocator.provideService(PlanAnalyticsHelper.class, false); + } else { + printInfo(ChatColor.YELLOW + "Plan was not found. Personal analytics support has been disabled."); + } + if (Config.sendErrors) { swapExceptionHandlers(new RollbarExceptionHandler(Config.ROLLBAR_KEY, "production", version, getServerId(), getName())); } diff --git a/Bungee/pom.xml b/Bungee/pom.xml index 65238644..b5502e20 100644 --- a/Bungee/pom.xml +++ b/Bungee/pom.xml @@ -1,7 +1,7 @@ 4.0.0 AntiVPN-Bungee - 2.4.13 + 2.4.14 AntiVPN src @@ -185,7 +185,7 @@ ninja.egg82.plugins AntiVPN - 2.4.13 + 2.4.14 ninja.egg82.lib diff --git a/Bungee/src/main/resources/plugin.yml b/Bungee/src/main/resources/plugin.yml index 03e0aabb..7ec3f4e0 100644 --- a/Bungee/src/main/resources/plugin.yml +++ b/Bungee/src/main/resources/plugin.yml @@ -1,9 +1,10 @@ name: AntiVPN main: me.egg82.avpn.AntiVPN -version: 2.4.13 +version: 2.4.14 author: egg82 api-version: 1.13 description: Get the best; save money on overpriced plugins and block VPN users! +softdepends: [Plan] commands: avpnreload: description: Reloads the plugin diff --git a/Bungee/src/me/egg82/avpn/AntiVPN.java b/Bungee/src/me/egg82/avpn/AntiVPN.java index 6c292db1..a3260fc3 100644 --- a/Bungee/src/me/egg82/avpn/AntiVPN.java +++ b/Bungee/src/me/egg82/avpn/AntiVPN.java @@ -89,15 +89,6 @@ public void onLoad() { PluginReflectUtil.addServicesFromPackage("me.egg82.avpn.registries", true); PluginReflectUtil.addServicesFromPackage("me.egg82.avpn.lists", true); - PluginManager manager = getProxy().getPluginManager(); - - if (manager.getPlugin("Plan") != null) { - printInfo(ChatColor.GREEN + "Enabling support for Plan."); - ServiceLocator.provideService(PlanAnalyticsHelper.class, false); - } else { - printInfo(ChatColor.YELLOW + "Plan was not found. Personal analytics support has been disabled."); - } - Configuration config = ConfigLoader.getConfig("config.yml", "config.yml"); Config.debug = config.getNode("debug").getBoolean(); @@ -171,6 +162,15 @@ public void onLoad() { public void onEnable() { super.onEnable(); + PluginManager manager = getProxy().getPluginManager(); + + if (manager.getPlugin("Plan") != null) { + printInfo(ChatColor.GREEN + "Enabling support for Plan."); + ServiceLocator.provideService(PlanAnalyticsHelper.class, false); + } else { + printInfo(ChatColor.YELLOW + "Plan was not found. Personal analytics support has been disabled."); + } + if (Config.sendErrors) { swapExceptionHandlers(new RollbarExceptionHandler(Config.ROLLBAR_KEY, "production", version, getServerId(), getDescription().getName())); } diff --git a/Common/pom.xml b/Common/pom.xml index 9cdef4e4..871e6862 100644 --- a/Common/pom.xml +++ b/Common/pom.xml @@ -1,7 +1,7 @@ 4.0.0 AntiVPN - 2.4.13 + 2.4.14 AntiVPN src