diff --git a/MinecraftClient/Protocol/Message/ChatParser.cs b/MinecraftClient/Protocol/Message/ChatParser.cs index 28311400..802ed0c7 100644 --- a/MinecraftClient/Protocol/Message/ChatParser.cs +++ b/MinecraftClient/Protocol/Message/ChatParser.cs @@ -531,12 +531,9 @@ namespace MinecraftClient.Protocol.Message { var extraDict = extras[i] switch { - int => new Dictionary { { "text", $"{extras[i]}" } }, - string => new Dictionary - { - { "text", (string)extras[i] } - }, - _ => (Dictionary)extras[i] + string s => new Dictionary { { "text", s } }, + Dictionary d => d, + _ => new Dictionary { { "text", extras[i]?.ToString() ?? string.Empty } } }; extraBuilder.Append(NbtToString(extraDict) + "§r"); @@ -556,12 +553,9 @@ namespace MinecraftClient.Protocol.Message { var withDict = withs[i] switch { - int => new Dictionary { { "text", $"{withs[i]}" } }, - string => new Dictionary - { - { "text", (string)withs[i] } - }, - _ => (Dictionary)withs[i] + string s => new Dictionary { { "text", s } }, + Dictionary d => d, + _ => new Dictionary { { "text", withs[i]?.ToString() ?? string.Empty } } }; translateString.Add(NbtToString(withDict));