Fixed fallback command rules

This commit is contained in:
Jaime Martinez Rincon 2017-01-23 15:04:22 +01:00
parent fe2f7f22ce
commit b06d0d5e7b

View File

@ -6,7 +6,6 @@ import me.jaimemartz.lobbybalancer.configuration.ConfigEntries;
import me.jaimemartz.lobbybalancer.connection.ConnectionIntent;
import me.jaimemartz.lobbybalancer.manager.PlayerLocker;
import me.jaimemartz.lobbybalancer.section.ServerSection;
import me.jaimemartz.lobbybalancer.utils.ConfigUtils;
import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.config.ServerInfo;
@ -48,13 +47,14 @@ public class FallbackCommand extends Command {
return target;
} else {
Configuration rules = plugin.getConfig().getSection("settings.fallback-command.rules");
String bind = rules.getString(section.getName());
ServerSection target = plugin.getSectionManager().getByName(bind);
if (ConfigUtils.isSet(rules, section.getName())) {
String bind = rules.getString(section.getName());
plugin.getSectionManager().getByName(bind);
} else {
return section.getParent();
if (target == null) {
target = section.getParent();
}
return target;
}
} else {
if (ConfigEntries.FALLBACK_PRINCIPAL_ENABLED.get()) {