Fix Clans selection not working
This commit is contained in:
parent
33e6bdc4f7
commit
d931f38b18
@ -261,7 +261,7 @@ public class ServerManager extends MiniPlugin
|
||||
|
||||
if (npcName.contains("Clans"))
|
||||
{
|
||||
ServerGroup serverGroup = _serverGroupsByName.get("Clans");
|
||||
ServerGroup serverGroup = _serverGroupsByName.get("ClansHub");
|
||||
|
||||
if (serverGroup == null)
|
||||
{
|
||||
@ -269,7 +269,7 @@ public class ServerManager extends MiniPlugin
|
||||
return;
|
||||
}
|
||||
|
||||
if (!selectBest(player, serverGroup))
|
||||
if (!selectBest(player, serverGroup, false))
|
||||
{
|
||||
player.sendMessage(F.main(getName(), "Sorry I was unable to find you a good server to send you to."));
|
||||
}
|
||||
@ -490,6 +490,11 @@ public class ServerManager extends MiniPlugin
|
||||
}
|
||||
|
||||
public boolean selectBest(Player player, ServerGroup serverGroup)
|
||||
{
|
||||
return selectBest(player, serverGroup, true);
|
||||
}
|
||||
|
||||
public boolean selectBest(Player player, ServerGroup serverGroup, boolean checkValid)
|
||||
{
|
||||
if (!Recharge.Instance.use(player, "Select Best Server", SELECT_SERVER_COOLDOWN, false, false))
|
||||
{
|
||||
@ -499,6 +504,8 @@ public class ServerManager extends MiniPlugin
|
||||
Collection<GameServer> servers = getServers(serverGroup.getPrefix());
|
||||
int required = getRequiredSlots(player);
|
||||
|
||||
if (checkValid)
|
||||
{
|
||||
servers.removeIf(server ->
|
||||
{
|
||||
MinecraftServer serverStatus = server.getServer();
|
||||
@ -521,6 +528,7 @@ public class ServerManager extends MiniPlugin
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (servers.isEmpty())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user