Calculate the player count without offline players (FS-247) (#68)

Co-authored-by: Ryan <Wild1145@users.noreply.github.com>
This commit is contained in:
Nathan Curran
2021-05-23 00:40:55 +10:00
committed by GitHub
parent 9ff5da8d8f
commit d047cfc8ff
3 changed files with 15 additions and 5 deletions

View File

@ -838,6 +838,19 @@ public class FUtil
}.runTaskLater(TotalFreedomMod.getPlugin(), delay);
}
public static int getFakePlayerCount()
{
int i = TotalFreedomMod.getPlugin().al.vanished.size();
for (String name : TotalFreedomMod.getPlugin().al.vanished)
{
if (Bukkit.getPlayer(name) == null)
{
i--;
}
}
return getServer().getOnlinePlayers().size() - i;
}
public static class PaginationList<T> extends ArrayList<T>
{
private final int epp;