3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-12-24 15:20:35 +01:00

Fall back to wrapping the name in a component. Should fix #349 for real.

Dieser Commit ist enthalten in:
Andrew Steinborn 2020-08-07 07:19:22 -04:00
Ursprung 46e34ddb7f
Commit 9d36f9094d

Datei anzeigen

@ -57,9 +57,17 @@ public class VelocityLegacyHoverEventSerializer implements LegacyHoverEventSeria
Decoder<Component, String, ? extends RuntimeException> componentDecoder) throws IOException {
String snbt = PlainComponentSerializer.plain().serialize(input);
CompoundBinaryTag item = TagStringIO.get().asCompound(snbt);
Component name;
try {
name = componentDecoder.decode(item.getString("name"));
} catch (Exception e) {
name = TextComponent.of(item.getString("name"));
}
return new ShowEntity(Key.of(item.getString("type")),
UUID.fromString(item.getString("id")),
componentDecoder.decode(item.getString("name")));
name);
}
@Override