Enhance server status display and player information handling

- Updated `ServerStatusDisplay` to use `ChatBot.GetVerbatim` for version name formatting.
- Modified `ServerStatusPanelBuilder` to improve player name display with color parsing.
- Changed translation for online player label to "Online Players:" for clarity.
- Refactored protocol version checks to streamline logic in server status handling.
This commit is contained in:
BruceChen 2026-03-30 02:45:56 +08:00
parent b25579a105
commit 90ea05b17d
3 changed files with 17 additions and 11 deletions

View file

@ -1,6 +1,7 @@
using System;
using System.Text;
using MinecraftClient.Protocol.Message;
using MinecraftClient.Scripting;
namespace MinecraftClient.Protocol
{
@ -47,12 +48,12 @@ namespace MinecraftClient.Protocol
sb.Append("§f");
sb.Append(Translations.mcc_server_info_label_version);
sb.Append(" §b");
sb.Append(info.VersionName);
sb.Append(ChatBot.GetVerbatim(info.VersionName));
sb.Append(" §7(");
sb.Append(string.Format(Translations.mcc_server_info_label_protocol, "§e" + info.ProtocolVersion + "§7"));
sb.AppendLine(")");
if (info.ResolvedProtocol != 0 && info.ResolvedProtocol != info.ProtocolVersion)
if (info.ResolvedProtocol != 0)
{
string resolvedMcVer = ProtocolHandler.ProtocolVersion2MCVer(info.ResolvedProtocol);
sb.Append("§f");