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: * 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 * 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 { public class AdvancedAntiCheatHook extends Hook {
private static PlayerHackKickListener listener;
public AdvancedAntiCheatHook(HookHandler hookHandler) { public AdvancedAntiCheatHook(HookHandler hookHandler) {
super("me.konsolas.aac.AAC", hookHandler); super("me.konsolas.aac.AAC", hookHandler);
} }
@ -40,10 +38,7 @@ public class AdvancedAntiCheatHook extends Hook {
return; return;
} }
if (listener == null) { plugin.registerListener(new PlayerHackKickListener());
listener = new PlayerHackKickListener();
plugin.registerListener(listener);
}
addPluginDataSource(new AdvancedAntiCheatData(table)); addPluginDataSource(new AdvancedAntiCheatData(table));
} }
} }

View File

@ -1,4 +1,4 @@
/* /*
* Licence is provided in the jar as license.yml also here: * 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 * 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 { public class ProtocolSupportHook extends Hook {
private static PlayerVersionListener listener;
public ProtocolSupportHook(HookHandler hookHandler) { public ProtocolSupportHook(HookHandler hookHandler) {
super("protocolsupport.ProtocolSupport", hookHandler); super("protocolsupport.ProtocolSupport", hookHandler);
} }
@ -39,10 +37,7 @@ public class ProtocolSupportHook extends Hook {
Log.toLog(this.getClass().getName(), e); Log.toLog(this.getClass().getName(), e);
return; return;
} }
if (listener == null) { plan.registerListener(new PlayerVersionListener());
listener = new PlayerVersionListener();
plan.registerListener(listener);
}
addPluginDataSource(new ProtocolSupportData(table)); addPluginDataSource(new ProtocolSupportData(table));
} }
} }

View File

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