Skip to content

Commit

Permalink
Sync getAlts
Browse files Browse the repository at this point in the history
  • Loading branch information
HaHaWTH committed Oct 24, 2024
1 parent 05cd66a commit dc994d4
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,14 @@ public static boolean hasAlt(Player player) {
*/
public static Collection<UUID> getAlts(Player player) {
String ip = Utils.getPlayerIp(player);
if (!PLAYER_ALTS.containsKey(ip)) {
return Collections.emptyList();
synchronized (PLAYER_ALTS) {
if (!PLAYER_ALTS.containsKey(ip)) {
return Collections.emptyList();
}
return PLAYER_ALTS.get(ip).stream()
.filter(uuid -> !uuid.equals(player.getUniqueId()))
.collect(Collectors.toList());
}
return PLAYER_ALTS.get(ip).stream()
.filter(uuid -> !uuid.equals(player.getUniqueId()))
.collect(Collectors.toList());
}

/**
Expand Down

0 comments on commit dc994d4

Please sign in to comment.