make trainees+ not count to kicked player count

This commit is contained in:
Ben 2016-04-05 12:43:19 +01:00
parent 876a7a8eb6
commit be63012d18

View File

@ -1209,11 +1209,28 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
return;
}
if (UtilServer.getPlayers().length >= UtilServer.getServer().getMaxPlayers() && !rank.has(Rank.ADMIN) && !event.getPlayer().isWhitelisted() && !event.getPlayer().isOp())
int online = 0;
for (Player player : UtilServer.getPlayers())
{
if (_clientManager.hasRank(player, Rank.HELPER))
{
continue;
}
online++;
}
if (online >= UtilServer.getServer().getMaxPlayers() && !rank.has(Rank.ADMIN) && !event.getPlayer().isWhitelisted() && !event.getPlayer().isOp())
{
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "Clans Beta is full! Try again soon");
event.setKickMessage("Clans Beta is full! Try again soon");
}
else
{
event.allow();
event.setResult(PlayerLoginEvent.Result.ALLOWED);
}
}
@EventHandler