Update PlayerListener.java

This commit is contained in:
Deauthorized 2024-05-02 17:30:22 -04:00 committed by GitHub
parent 344df2b225
commit 5b3a37835a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -71,11 +71,9 @@ public class PlayerListener extends PlexListener
plugin.getSqlNotes().getNotes(plexPlayer.getUuid()).whenComplete((notes, ex) ->
{
String plural = notes.size() == 1 ? "note." : "notes.";
if (!notes.isEmpty())
{
PlexUtils.broadcastToAdmins(Component.text(plexPlayer.getName() + " has " + notes.size() + " " + plural).color(NamedTextColor.GOLD), "plex.notes.notify");
PlexUtils.broadcastToAdmins(Component.text("Click to view their " + plural).clickEvent(ClickEvent.runCommand("/notes " + plexPlayer.getName() + " list")).color(NamedTextColor.GOLD), "plex.notes.notify");
PlexUtils.broadcastToAdmins(PlexUtils.messageComponent(notes.size() == 1 ? "playerNoteAlert" : "playerNoteAlertPlural", plexPlayer.getName(), notes.size()), "plex.notes.notify");
}
});
}