Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2025-01-11 23:51:11 +01:00
Check for empty component in JavaSetTitleTextTranslator
Dieser Commit ist enthalten in:
Ursprung
c6c2ff99c3
Commit
7beedb46f8
@ -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());
|
||||
|
Laden…
x
In neuem Issue referenzieren
Einen Benutzer sperren