Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-27 16:40:14 +01:00
Fix colored titles
Dieser Commit ist enthalten in:
Ursprung
d548647367
Commit
298b5e7a53
@ -29,6 +29,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.server.ServerTitlePacket;
|
|||||||
import com.nukkitx.protocol.bedrock.packet.SetTitlePacket;
|
import com.nukkitx.protocol.bedrock.packet.SetTitlePacket;
|
||||||
import org.geysermc.connector.network.session.GeyserSession;
|
import org.geysermc.connector.network.session.GeyserSession;
|
||||||
import org.geysermc.connector.network.translators.PacketTranslator;
|
import org.geysermc.connector.network.translators.PacketTranslator;
|
||||||
|
import org.geysermc.connector.utils.MessageUtils;
|
||||||
|
|
||||||
public class JavaTitleTranslator extends PacketTranslator<ServerTitlePacket> {
|
public class JavaTitleTranslator extends PacketTranslator<ServerTitlePacket> {
|
||||||
|
|
||||||
@ -39,11 +40,11 @@ public class JavaTitleTranslator extends PacketTranslator<ServerTitlePacket> {
|
|||||||
switch (packet.getAction()) {
|
switch (packet.getAction()) {
|
||||||
case TITLE:
|
case TITLE:
|
||||||
titlePacket.setType(SetTitlePacket.Type.SET_TITLE);
|
titlePacket.setType(SetTitlePacket.Type.SET_TITLE);
|
||||||
titlePacket.setText(packet.getTitle().getFullText());
|
titlePacket.setText(MessageUtils.getBedrockMessage(packet.getTitle()));
|
||||||
break;
|
break;
|
||||||
case SUBTITLE:
|
case SUBTITLE:
|
||||||
titlePacket.setType(SetTitlePacket.Type.SET_SUBTITLE);
|
titlePacket.setType(SetTitlePacket.Type.SET_SUBTITLE);
|
||||||
titlePacket.setText(packet.getTitle().getFullText());
|
titlePacket.setText(MessageUtils.getBedrockMessage(packet.getTitle()));
|
||||||
break;
|
break;
|
||||||
case CLEAR:
|
case CLEAR:
|
||||||
case RESET:
|
case RESET:
|
||||||
@ -52,7 +53,7 @@ public class JavaTitleTranslator extends PacketTranslator<ServerTitlePacket> {
|
|||||||
break;
|
break;
|
||||||
case ACTION_BAR:
|
case ACTION_BAR:
|
||||||
titlePacket.setType(SetTitlePacket.Type.SET_ACTIONBAR_MESSAGE);
|
titlePacket.setType(SetTitlePacket.Type.SET_ACTIONBAR_MESSAGE);
|
||||||
titlePacket.setText(packet.getTitle().getFullText());
|
titlePacket.setText(MessageUtils.getBedrockMessage(packet.getTitle()));
|
||||||
break;
|
break;
|
||||||
case TIMES:
|
case TIMES:
|
||||||
titlePacket.setFadeInTime(packet.getFadeIn());
|
titlePacket.setFadeInTime(packet.getFadeIn());
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren