feat: uuid support for getEntry

This commit is contained in:
ChomeNS
2024-12-29 08:03:16 +07:00
parent e50f9cf433
commit 4d9c1ca99b
2 changed files with 9 additions and 2 deletions

View File

@@ -101,7 +101,14 @@ public class PlayersPlugin extends Bot.Listener {
public final PlayerEntry getEntry (String username) {
for (PlayerEntry candidate : list) {
if (candidate != null && (getName(candidate).equals(username) || candidate.usernames.contains(username))) {
if (
candidate != null &&
(
candidate.profile.getIdAsString().equals(username) || // checks for a string UUID
getName(candidate).equals(username) ||
candidate.usernames.contains(username)
)
) {
return candidate;
}
}