Fixed a crash on chat parsing.

Returned the commended try catch block.
This commit is contained in:
Anon 2024-02-21 17:38:32 +01:00
parent b2ef5cb23b
commit 13de67b6f8
2 changed files with 54 additions and 47 deletions

View file

@ -471,7 +471,10 @@ namespace MinecraftClient.Protocol.Message
var withs = (object[])withComponent;
for (int i = 0; i < withs.Length; i++)
{
var withDict = (Dictionary<string, object>)withs[i];
var withDict = withs[i] is string
? new Dictionary<string, object>() { { "text", (string)withs[i] } }
: (Dictionary<string, object>)withs[i];
translateString.Add(NbtToString(withDict));
}
}