mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Check for empty component in JavaSetTitleTextTranslator
This commit is contained in:
parent
c6c2ff99c3
commit
7beedb46f8
1 changed files with 2 additions and 1 deletions
|
@ -27,6 +27,7 @@ package org.geysermc.geyser.translator.protocol.java.title;
|
|||
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.title.ClientboundSetTitleTextPacket;
|
||||
import com.nukkitx.protocol.bedrock.packet.SetTitlePacket;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.geysermc.geyser.session.GeyserSession;
|
||||
import org.geysermc.geyser.translator.protocol.PacketTranslator;
|
||||
import org.geysermc.geyser.translator.protocol.Translator;
|
||||
|
@ -38,7 +39,7 @@ public class JavaSetTitleTextTranslator extends PacketTranslator<ClientboundSetT
|
|||
@Override
|
||||
public void translate(GeyserSession session, ClientboundSetTitleTextPacket packet) {
|
||||
String text;
|
||||
if (packet.getText() == null) { // This can happen, see https://github.com/KyoriPowered/adventure/issues/447
|
||||
if (packet.getText() == null || Component.empty().equals(packet.getText())) { // This can happen, see https://github.com/KyoriPowered/adventure/issues/447
|
||||
text = " ";
|
||||
} else {
|
||||
text = MessageTranslator.convertMessage(packet.getText(), session.getLocale());
|
||||
|
|
Loading…
Reference in a new issue