bugfix: Fixed scoreboard command crashing the client on 1.20.4

This commit is contained in:
Anon 2026-03-24 21:20:14 +01:00 committed by GitHub
commit 699b2cad6b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -531,12 +531,9 @@ namespace MinecraftClient.Protocol.Message
{
var extraDict = extras[i] switch
{
int => new Dictionary<string, object> { { "text", $"{extras[i]}" } },
string => new Dictionary<string, object>
{
{ "text", (string)extras[i] }
},
_ => (Dictionary<string, object>)extras[i]
string s => new Dictionary<string, object> { { "text", s } },
Dictionary<string, object> d => d,
_ => new Dictionary<string, object> { { "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<string, object> { { "text", $"{withs[i]}" } },
string => new Dictionary<string, object>
{
{ "text", (string)withs[i] }
},
_ => (Dictionary<string, object>)withs[i]
string s => new Dictionary<string, object> { { "text", s } },
Dictionary<string, object> d => d,
_ => new Dictionary<string, object> { { "text", withs[i]?.ToString() ?? string.Empty } }
};
translateString.Add(NbtToString(withDict));