mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-16 15:15:20 +01:00
Fix 1.19 -> 1.18.2 title translation: empty text edge case (#3115)
This commit is contained in:
parent
ce4f21b7d8
commit
c96b2bd859
@ -120,7 +120,8 @@ public final class Protocol1_19To1_18_2 extends AbstractProtocol<ClientboundPack
|
|||||||
|
|
||||||
final PacketHandler titleHandler = wrapper -> {
|
final PacketHandler titleHandler = wrapper -> {
|
||||||
final JsonElement component = wrapper.read(Type.COMPONENT);
|
final JsonElement component = wrapper.read(Type.COMPONENT);
|
||||||
if (!component.isJsonNull()) {
|
final boolean isEmpty = component.isJsonNull() || (component.isJsonArray() && component.getAsJsonArray().size() == 0);
|
||||||
|
if (!isEmpty) {
|
||||||
wrapper.write(Type.COMPONENT, component);
|
wrapper.write(Type.COMPONENT, component);
|
||||||
} else {
|
} else {
|
||||||
wrapper.write(Type.COMPONENT, GsonComponentSerializer.gson().serializeToTree(Component.empty()));
|
wrapper.write(Type.COMPONENT, GsonComponentSerializer.gson().serializeToTree(Component.empty()));
|
||||||
|
Loading…
Reference in New Issue
Block a user