From 183bb3c522515be3b6337361ff06605f026c735b Mon Sep 17 00:00:00 2001 From: Jaime Martinez Rincon Date: Sat, 18 Feb 2017 11:21:46 +0100 Subject: [PATCH] That is what happens when I copy paste --- .../lobbybalancer/commands/FallbackCommand.java | 3 ++- .../lobbybalancer/section/ServerSection.java | 16 +++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/main/java/me/jaimemartz/lobbybalancer/commands/FallbackCommand.java b/src/main/java/me/jaimemartz/lobbybalancer/commands/FallbackCommand.java index e490dd5..6ecb6a2 100644 --- a/src/main/java/me/jaimemartz/lobbybalancer/commands/FallbackCommand.java +++ b/src/main/java/me/jaimemartz/lobbybalancer/commands/FallbackCommand.java @@ -53,8 +53,9 @@ public class FallbackCommand extends Command { target = section.getParent(); } - if (ConfigEntries.RECONNECT_KICK_RESTRICTED.get()) { + if (ConfigEntries.FALLBACK_COMMAND_RESTRICTED.get()) { if (section.getPosition() >= 0 && target.getPosition() < 0) { + msgr.send(ConfigEntries.UNAVAILABLE_MESSAGE.get()); return null; } } diff --git a/src/main/java/me/jaimemartz/lobbybalancer/section/ServerSection.java b/src/main/java/me/jaimemartz/lobbybalancer/section/ServerSection.java index c4076cb..5bd5557 100644 --- a/src/main/java/me/jaimemartz/lobbybalancer/section/ServerSection.java +++ b/src/main/java/me/jaimemartz/lobbybalancer/section/ServerSection.java @@ -86,7 +86,7 @@ public class ServerSection { void load(LobbyBalancer plugin) { if (parent != null && parent.parent == this) { - throw new IllegalStateException(String.format("The section \"%s\" and \"%s\" are parents of each other", this.name, parent.name)); + throw new IllegalStateException(String.format("The sections \"%s\" and \"%s\" are parents of each other", this.name, parent.name)); } if (section.contains("provider")) { @@ -149,13 +149,15 @@ public class ServerSection { if (provider == null) { ServerSection sect = this.parent; - while (sect.provider == null) { - sect = sect.parent; - } + if (sect != null) { + while (sect.provider == null) { + sect = sect.parent; + } - plugin.getLogger().info(String.format("The section \"%s\" inherits the provider from the section \"%s\"", this.name, sect.name)); - provider = sect.provider; - inherited = true; + plugin.getLogger().info(String.format("The section \"%s\" inherits the provider from the section \"%s\"", this.name, sect.name)); + provider = sect.provider; + inherited = true; + } } if (provider == null) {