Collect offline players only once
This commit is contained in:
parent
0bd6ac5cc8
commit
74041725fa
@ -27,6 +27,8 @@ public class PurgeTask extends BukkitRunnable {
|
|||||||
private final UUID sender;
|
private final UUID sender;
|
||||||
private final Set<String> toPurge;
|
private final Set<String> toPurge;
|
||||||
|
|
||||||
|
private final OfflinePlayer[] offlinePlayers = Bukkit.getOfflinePlayers();
|
||||||
|
|
||||||
private final boolean autoPurging;
|
private final boolean autoPurging;
|
||||||
private final int totalPurgeCount;
|
private final int totalPurgeCount;
|
||||||
|
|
||||||
@ -69,7 +71,6 @@ public class PurgeTask extends BukkitRunnable {
|
|||||||
|
|
||||||
Set<OfflinePlayer> playerPortion = new HashSet<OfflinePlayer>(INTERVALL_CHECK);
|
Set<OfflinePlayer> playerPortion = new HashSet<OfflinePlayer>(INTERVALL_CHECK);
|
||||||
Set<String> namePortion = new HashSet<String>(INTERVALL_CHECK);
|
Set<String> namePortion = new HashSet<String>(INTERVALL_CHECK);
|
||||||
OfflinePlayer[] offlinePlayers = Bukkit.getOfflinePlayers();
|
|
||||||
for (int i = 0; i < INTERVALL_CHECK; i++) {
|
for (int i = 0; i < INTERVALL_CHECK; i++) {
|
||||||
int nextPosition = (currentPage * INTERVALL_CHECK) + i;
|
int nextPosition = (currentPage * INTERVALL_CHECK) + i;
|
||||||
if (offlinePlayers.length >= nextPosition) {
|
if (offlinePlayers.length >= nextPosition) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user