Last commit for version 2.1.2.2

This commit is contained in:
Jaime Martínez Rincón 2017-11-29 18:52:21 +01:00
parent aebe9419f0
commit 6cea42767b
5 changed files with 47 additions and 41 deletions

View File

@ -11,7 +11,7 @@
<name>PlayerBalancer Plugin</name>
<artifactId>playerbalancer-plugin</artifactId>
<version>2.1.3</version>
<version>2.1.2.2</version>
<build>
<finalName>PlayerBalancer</finalName>

View File

@ -28,7 +28,9 @@ public class ServerConnectListener implements Listener {
ServerSection section = getSection(player, target);
if (section != null) {
if (section == null)
return;
if (target.equals(section.getServer())) {
event.setCancelled(true);
}
@ -46,7 +48,6 @@ public class ServerConnectListener implements Listener {
}
};
}
}
private ServerSection getSection(ProxiedPlayer player, ServerInfo target) {
if (player.getServer() == null && plugin.getSettings().getForcedEntrySectionProps().isEnabled()) {

View File

@ -59,10 +59,14 @@ public class ServerKickListener implements Listener {
));
}
if (matches) {
if (!matches)
return;
ServerSection section = getSection(player, from);
if (section != null) {
if (section == null)
return;
List<ServerInfo> servers = new ArrayList<>();
servers.addAll(section.getServers());
servers.remove(from);
@ -84,8 +88,6 @@ public class ServerKickListener implements Listener {
}
};
}
}
}
private ServerSection getSection(ProxiedPlayer player, ServerInfo from) {
if (player.getServer() == null) {

View File

@ -7,7 +7,6 @@ import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
//TODO improve this
public class PlayerLocker {
private static final Set<UUID> storage = Collections.synchronizedSet(new HashSet<UUID>());

View File

@ -90,11 +90,15 @@ public class MainCommand implements CommandExecutor {
sender.sendMessage(ChatColor.GRAY + "Available commands:");
sender.sendMessage(ChatColor.AQUA + "/spb connect <section> [player]" + ChatColor.GRAY + " - " + ChatColor.RED + "Connects you or the specified player to that section");
sender.sendMessage(ChatColor.AQUA + "/spb fallback [player]" + ChatColor.GRAY + " - " + ChatColor.RED + "Connects you or the specified player to the parent of the current section");
/* TODO For version 2.1.3 of the main plugin
sender.sendMessage(ChatColor.AQUA + "/spb bypassconnect <server> [player]" + ChatColor.GRAY + " - " + ChatColor.RED + "Connects you or the specified player to a specific server without balancing");
sender.sendMessage(ChatColor.AQUA + "/spb setbypass [player]" + ChatColor.GRAY + " - " + ChatColor.RED + "Sets a bypass for you or the specified player");
sender.sendMessage(ChatColor.AQUA + "/spb clearbypass [player]" + ChatColor.GRAY + " - " + ChatColor.RED + "Clears the bypass for you or the specified player");
sender.sendMessage(ChatColor.AQUA + "/spb overridestatus <server> <status>" + ChatColor.GRAY + " - " + ChatColor.RED + "Overrides the accessible status of a specific server, over anything else");
sender.sendMessage(ChatColor.AQUA + "/spb clearoverride <server>" + ChatColor.GRAY + " - " + ChatColor.RED + "Clears the overridden status of a specific server");
*/
sender.sendMessage(ChatColor.STRIKETHROUGH + ChatColor.GRAY.toString() + Strings.repeat("-", 53));
}
}