Fall back to wrapping the name in a component. Should fix #349 for real.
This commit is contained in:
@@ -57,9 +57,17 @@ public class VelocityLegacyHoverEventSerializer implements LegacyHoverEventSeria
|
|||||||
Decoder<Component, String, ? extends RuntimeException> componentDecoder) throws IOException {
|
Decoder<Component, String, ? extends RuntimeException> componentDecoder) throws IOException {
|
||||||
String snbt = PlainComponentSerializer.plain().serialize(input);
|
String snbt = PlainComponentSerializer.plain().serialize(input);
|
||||||
CompoundBinaryTag item = TagStringIO.get().asCompound(snbt);
|
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")),
|
return new ShowEntity(Key.of(item.getString("type")),
|
||||||
UUID.fromString(item.getString("id")),
|
UUID.fromString(item.getString("id")),
|
||||||
componentDecoder.decode(item.getString("name")));
|
name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Reference in New Issue
Block a user