3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-07-01 21:18:02 +02:00

Fix hoverEvent translation from 1.20.2 to 1.20.3 in some cases (#3591)

Dieser Commit ist enthalten in:
Jerry Xiao 2023-12-22 19:10:29 +08:00 committet von GitHub
Ursprung 18f2cf25cd
Commit 0e31664bfe
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -193,16 +193,17 @@ public final class ComponentConverter {
// Store show_entity id as int array instead of uuid string
// Not really required, but we might as well make it more compact
final JsonObject hoverEvent = value.getAsJsonObject();
final CompoundTag convertedTag = (CompoundTag) convertToTag(value);
final JsonElement id = hoverEvent.get("id");
final UUID uuid;
if (id != null && id.isJsonPrimitive() && (uuid = UUIDUtil.parseUUID(id.getAsString())) != null) {
hoverEvent.remove("id");
final CompoundTag convertedTag = (CompoundTag) convertToTag(value);
convertedTag.remove("id");
convertedTag.put("id", new IntArrayTag(UUIDUtil.toIntArray(uuid)));
tag.put(key, convertedTag);
return;
}
tag.put(key, convertedTag);
return;
}
tag.put(key, convertToTag(value));