Skip to content

Commit

Permalink
* Fixed issues with PLAN support killing the plugin. Sorry!
Browse files Browse the repository at this point in the history
  • Loading branch information
egg82 committed Oct 1, 2018
1 parent 61c6d8a commit 76732f8
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 25 deletions.
4 changes: 2 additions & 2 deletions Bukkit/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>AntiVPN-Bukkit</artifactId>
<version>2.4.13</version>
<version>2.4.14</version>
<name>AntiVPN</name>
<build>
<sourceDirectory>src</sourceDirectory>
Expand Down Expand Up @@ -222,7 +222,7 @@
<dependency>
<groupId>ninja.egg82.plugins</groupId>
<artifactId>AntiVPN</artifactId>
<version>2.4.13</version>
<version>2.4.14</version>
</dependency>
<dependency>
<groupId>ninja.egg82.lib</groupId>
Expand Down
3 changes: 2 additions & 1 deletion Bukkit/src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
18 changes: 9 additions & 9 deletions Bukkit/src/me/egg82/avpn/AntiVPN.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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()));
}
Expand Down
4 changes: 2 additions & 2 deletions Bungee/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>AntiVPN-Bungee</artifactId>
<version>2.4.13</version>
<version>2.4.14</version>
<name>AntiVPN</name>
<build>
<sourceDirectory>src</sourceDirectory>
Expand Down Expand Up @@ -185,7 +185,7 @@
<dependency>
<groupId>ninja.egg82.plugins</groupId>
<artifactId>AntiVPN</artifactId>
<version>2.4.13</version>
<version>2.4.14</version>
</dependency>
<dependency>
<groupId>ninja.egg82.lib</groupId>
Expand Down
3 changes: 2 additions & 1 deletion Bungee/src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
18 changes: 9 additions & 9 deletions Bungee/src/me/egg82/avpn/AntiVPN.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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()));
}
Expand Down
2 changes: 1 addition & 1 deletion Common/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>AntiVPN</artifactId>
<version>2.4.13</version>
<version>2.4.14</version>
<name>AntiVPN</name>
<build>
<sourceDirectory>src</sourceDirectory>
Expand Down

0 comments on commit 76732f8

Please sign in to comment.