Bridge now registers listeners during reload (they're unregistered)

This commit is contained in:
Rsl1122 2018-01-30 12:06:04 +02:00
parent 62264ce1fd
commit 5df1145199
3 changed files with 5 additions and 18 deletions

View File

@ -1,4 +1,4 @@
/*
/*
* Licence is provided in the jar as license.yml also here:
* https://github.com/Rsl1122/Plan-PlayerAnalytics/blob/master/Plan/src/main/resources/license.yml
*/
@ -19,8 +19,6 @@ import com.djrapitops.pluginbridge.plan.Hook;
*/
public class AdvancedAntiCheatHook extends Hook {
private static PlayerHackKickListener listener;
public AdvancedAntiCheatHook(HookHandler hookHandler) {
super("me.konsolas.aac.AAC", hookHandler);
}
@ -40,10 +38,7 @@ public class AdvancedAntiCheatHook extends Hook {
return;
}
if (listener == null) {
listener = new PlayerHackKickListener();
plugin.registerListener(listener);
}
plugin.registerListener(new PlayerHackKickListener());
addPluginDataSource(new AdvancedAntiCheatData(table));
}
}

View File

@ -1,4 +1,4 @@
/*
/*
* Licence is provided in the jar as license.yml also here:
* https://github.com/Rsl1122/Plan-PlayerAnalytics/blob/master/Plan/src/main/resources/license.yml
*/
@ -20,8 +20,6 @@ import com.djrapitops.pluginbridge.plan.viaversion.ProtocolTable;
*/
public class ProtocolSupportHook extends Hook {
private static PlayerVersionListener listener;
public ProtocolSupportHook(HookHandler hookHandler) {
super("protocolsupport.ProtocolSupport", hookHandler);
}
@ -39,10 +37,7 @@ public class ProtocolSupportHook extends Hook {
Log.toLog(this.getClass().getName(), e);
return;
}
if (listener == null) {
listener = new PlayerVersionListener();
plan.registerListener(listener);
}
plan.registerListener(new PlayerVersionListener());
addPluginDataSource(new ProtocolSupportData(table));
}
}

View File

@ -44,10 +44,7 @@ public class ViaVersionHook extends Hook {
Log.toLog(this.getClass().getName(), e);
return;
}
if (listener == null) {
listener = new PlayerVersionListener(api);
plan.registerListener(listener);
}
plan.registerListener(new PlayerVersionListener(api));
addPluginDataSource(new ViaVersionData(table));
}
}