diff --git a/module/reconnect-yaml/src/main/java/net/md_5/bungee/module/reconnect/yaml/PluginYaml.java b/module/reconnect-yaml/src/main/java/net/md_5/bungee/module/reconnect/yaml/PluginYaml.java index 63a87b58..0d77ce2a 100644 --- a/module/reconnect-yaml/src/main/java/net/md_5/bungee/module/reconnect/yaml/PluginYaml.java +++ b/module/reconnect-yaml/src/main/java/net/md_5/bungee/module/reconnect/yaml/PluginYaml.java @@ -1,5 +1,6 @@ package net.md_5.bungee.module.reconnect.yaml; +import net.md_5.bungee.api.config.ListenerInfo; import net.md_5.bungee.api.plugin.Plugin; public class PluginYaml extends Plugin @@ -8,6 +9,14 @@ public class PluginYaml extends Plugin @Override public void onEnable() { - getProxy().setReconnectHandler( new YamlReconnectHandler() ); + // TODO: Abstract this for other reconnect modules + for ( ListenerInfo info : getProxy().getConfig().getListeners() ) + { + if ( !info.isForceDefault() && getProxy().getReconnectHandler() == null ) + { + getProxy().setReconnectHandler( new YamlReconnectHandler() ); + break; + } + } } }