mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-12-25 18:17:38 +01:00
Bring reconnect yaml handler setting in line with what we had before (only create if needed)
This commit is contained in:
parent
71e64bf532
commit
05f4e69afd
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user