Do not load all players just to get a name.

This commit is contained in:
tastybento 2024-05-26 17:01:02 -07:00
parent ca15740a8c
commit 8b0a5a3d0b

View File

@ -157,8 +157,8 @@ public class PlayersManager {
if (playerUUID == null) { if (playerUUID == null) {
return ""; return "";
} }
return names.loadObjects().stream().filter(n -> n.getUuid().equals(playerUUID)).findFirst() getPlayer(playerUUID);
.map(Names::getUniqueId).orElse(""); return playerCache.get(playerUUID).getPlayerName();
} }
/** /**