Fixed a NBT crash < 1.20.2 and Fixed a crash with parsing 'extra' section in Chat

This commit is contained in:
Anon 2024-02-18 17:56:02 +01:00
parent 6d016332fb
commit 35cfd4a7db
2 changed files with 5 additions and 8 deletions

View file

@ -452,7 +452,10 @@ namespace MinecraftClient.Protocol.Message
object[] extras = (object[])value;
for (int i = 0; i < extras.Length; i++)
{
var extraDict = (Dictionary<string, object>)extras[i];
var extraDict = extras[i] is string
? new Dictionary<string, object>() { { "text", (string)extras[i] } }
: (Dictionary<string, object>)extras[i];
extraBuilder.Append(NbtToString(extraDict) + "§r");
}
}