From 9d36f9094d690a9741401ce382be57aa7660ebea Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Fri, 7 Aug 2020 07:19:22 -0400 Subject: [PATCH] Fall back to wrapping the name in a component. Should fix #349 for real. --- .../util/VelocityLegacyHoverEventSerializer.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/protocol/util/VelocityLegacyHoverEventSerializer.java b/proxy/src/main/java/com/velocitypowered/proxy/protocol/util/VelocityLegacyHoverEventSerializer.java index 043286f87..6a971a414 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/protocol/util/VelocityLegacyHoverEventSerializer.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/protocol/util/VelocityLegacyHoverEventSerializer.java @@ -57,9 +57,17 @@ public class VelocityLegacyHoverEventSerializer implements LegacyHoverEventSeria Decoder 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