mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Store extended player info, list display names
- Add 1.10.1 and 1.10.2 in supported version list - Store both player name and player display names - List command will sort players by player name - List command will now display by display name - Ability to use /list raw to display by real name Suggestion by Johngreen123
This commit is contained in:
parent
a4cc36ce05
commit
9a98a9d46f
10 changed files with 156 additions and 85 deletions
|
|
@ -8,11 +8,18 @@ namespace MinecraftClient.Commands
|
|||
public class List : Command
|
||||
{
|
||||
public override string CMDName { get { return "list"; } }
|
||||
public override string CMDDesc { get { return "list: get the player list."; } }
|
||||
public override string CMDDesc { get { return "list [raw]: get the player list."; } }
|
||||
|
||||
public override string Run(McTcpClient handler, string command)
|
||||
{
|
||||
return "PlayerList: " + String.Join(", ", handler.GetOnlinePlayers());
|
||||
bool rawNames = getArg(command).ToLower() == "raw";
|
||||
return "PlayerList: "
|
||||
+ String.Join(", ",
|
||||
handler.GetOnlinePlayers()
|
||||
.OrderBy(player => player.Name)
|
||||
.Select(player => rawNames
|
||||
? player.Name
|
||||
: player.DisplayName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue