List command should show player uid

This commit is contained in:
coooookies 2022-05-01 00:17:08 +08:00
parent 2fd73e043a
commit caffe859b8

View File

@ -19,9 +19,20 @@ public final class ListCommand implements CommandHandler {
if (playersMap.size() != 0) {
StringBuilder playerSet = new StringBuilder();
playersMap.values().forEach(player ->
playerSet.append(player.getNickname()).append(", "));
playersMap.values().forEach(player -> {
playerSet.append(player.getNickname());
if (sender != null) {
playerSet.append("<color=green><UID:")
.append(player.getUid())
.append("></color>, ");
} else {
playerSet.append("<UID:")
.append(player.getUid())
.append(">, ");
}
});
String players = playerSet.toString();
CommandHandler.sendMessage(sender, players.substring(0, players.length() - 2));
}