Fixed LiteBans detection #367

This commit is contained in:
Rsl1122 2017-10-29 12:31:39 +02:00
parent 91398d86d0
commit 313e75cc9c
7 changed files with 18 additions and 8 deletions

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.djrapitops</groupId>
<artifactId>Plan</artifactId>
<version>4.0.0</version>
<version>4.0.3</version>
<packaging>jar</packaging>
<repositories>
<repository>
@ -70,7 +70,7 @@
<dependency>
<groupId>com.djrapitops</groupId>
<artifactId>PlanPluginBridge</artifactId>
<version>4.0.0</version>
<version>4.0.3</version>
<scope>compile</scope>
</dependency>
<!-- Testing -->

View File

@ -1,4 +1,4 @@
name: Plan
author: Rsl1122
main: main.java.com.djrapitops.plan.PlanBungee
version: 4.0.2
version: 4.0.3

View File

@ -1,7 +1,7 @@
name: Plan
author: Rsl1122
main: main.java.com.djrapitops.plan.Plan
version: 4.0.2
version: 4.0.3
softdepend:
- OnTime
- EssentialsX

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.djrapitops</groupId>
<artifactId>PlanPluginBridge</artifactId>
<version>4.0.0</version>
<version>4.0.3</version>
<packaging>jar</packaging>
<repositories>
<repository>

View File

@ -13,6 +13,8 @@ import com.djrapitops.pluginbridge.plan.superbvote.SuperbVoteHook;
import com.djrapitops.pluginbridge.plan.towny.TownyHook;
import com.djrapitops.pluginbridge.plan.vault.VaultHook;
import com.djrapitops.pluginbridge.plan.viaversion.ViaVersionHook;
import main.java.com.djrapitops.plan.Log;
import main.java.com.djrapitops.plan.Settings;
import main.java.com.djrapitops.plan.data.additional.HookHandler;
/**
@ -56,7 +58,10 @@ public class Bridge {
for (Hook hook : hooks) {
try {
hook.hook();
} catch (Exception | NoClassDefFoundError ignore) {
} catch (Exception | NoClassDefFoundError e) {
if (Settings.DEV_MODE.isTrue()) {
Log.toLog("PluginBridge", e);
}
}
}
}

View File

@ -21,6 +21,10 @@ public abstract class Hook {
protected HookHandler hookHandler;
private Hook() {
throw new IllegalStateException();
}
/**
* Class constructor.
* <p>
@ -45,8 +49,9 @@ public abstract class Hook {
/**
* Constructor to set enabled to false.
*/
public Hook() {
public Hook(HookHandler hookHandler) {
enabled = false;
this.hookHandler = hookHandler;
}
protected void addPluginDataSource(PluginData pluginData) {

View File

@ -25,7 +25,7 @@ public class LiteBansHook extends Hook {
*/
@SuppressWarnings("ResultOfMethodCallIgnored")
public LiteBansHook(HookHandler hookH) {
super();
super(hookH);
try {
Database.get();
enabled = true;