13
0
geforkt von Mirrors/Velocity

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