Bring reconnect yaml handler setting in line with what we had before (only create if needed)

This commit is contained in:
md_5 2014-01-17 09:35:29 +11:00
parent 71e64bf532
commit 05f4e69afd

View File

@ -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;
}
}
}
}