diff --git a/MinecraftClient/Protocol/Message/ChatParser.cs b/MinecraftClient/Protocol/Message/ChatParser.cs index 5bfd2b66..bf3c1e74 100644 --- a/MinecraftClient/Protocol/Message/ChatParser.cs +++ b/MinecraftClient/Protocol/Message/ChatParser.cs @@ -63,16 +63,19 @@ namespace MinecraftClient.Protocol.Message /// JSON serialized text /// Optional container for links from JSON serialized text /// Returns the translated text - public static string ParseText(string json, List? links = null) + public static string ParseText(string json, List? links = null) { - return JSONData2String(Json.ParseJson(json), "", links); + var isJson = false; + try + { + isJson = JsonDocument.Parse(json) != null; + } + catch + { + isJson = false; + } + return !isJson ? json : JSONData2String(Json.ParseJson(json), "", links); } - - public static string ParseText(Dictionary nbt) - { - return NbtToString(nbt); - } - /// /// The main function to convert text from MC 1.9+ JSON to MC 1.5.2 formatted text /// @@ -551,4 +554,4 @@ namespace MinecraftClient.Protocol.Message return colorCode + message + extraBuilder.ToString(); } } -} \ No newline at end of file +}