From caffe859b82498c00b6d68324a6e08ad1a6c7317 Mon Sep 17 00:00:00 2001
From: coooookies <1164557342@qq.com>
Date: Sun, 1 May 2022 00:17:08 +0800
Subject: [PATCH] List command should show player uid
---
.../command/commands/ListCommand.java | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/src/main/java/emu/grasscutter/command/commands/ListCommand.java b/src/main/java/emu/grasscutter/command/commands/ListCommand.java
index 99abd7ac7..9ff8d2fe1 100644
--- a/src/main/java/emu/grasscutter/command/commands/ListCommand.java
+++ b/src/main/java/emu/grasscutter/command/commands/ListCommand.java
@@ -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(", ");
+ } else {
+ playerSet.append(", ");
+ }
+ });
+
String players = playerSet.toString();
CommandHandler.sendMessage(sender, players.substring(0, players.length() - 2));
}