Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-26 00:00:41 +01:00
Revert sending actionbar messages as jukebox, avoid pink system chat overlays (#4066)
System chat overlays too aren't pink anymore - they're still sent as jukebox for better visibility though.
Dieser Commit ist enthalten in:
Ursprung
3ec591509c
Commit
acf24d4d6b
@ -29,6 +29,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundSy
|
||||
import net.kyori.adventure.text.TranslatableComponent;
|
||||
import org.cloudburstmc.protocol.bedrock.packet.TextPacket;
|
||||
import org.geysermc.geyser.session.GeyserSession;
|
||||
import org.geysermc.geyser.text.ChatColor;
|
||||
import org.geysermc.geyser.text.GeyserLocale;
|
||||
import org.geysermc.geyser.translator.protocol.PacketTranslator;
|
||||
import org.geysermc.geyser.translator.protocol.Translator;
|
||||
@ -55,7 +56,11 @@ public class JavaSystemChatTranslator extends PacketTranslator<ClientboundSystem
|
||||
textPacket.setType(packet.isOverlay() ? TextPacket.Type.JUKEBOX_POPUP : TextPacket.Type.SYSTEM);
|
||||
|
||||
textPacket.setNeedsTranslation(false);
|
||||
textPacket.setMessage(MessageTranslator.convertMessage(packet.getContent(), session.locale()));
|
||||
if (packet.isOverlay()) {
|
||||
textPacket.setMessage(ChatColor.WHITE + MessageTranslator.convertMessage(packet.getContent(), session.locale()));
|
||||
} else {
|
||||
textPacket.setMessage(MessageTranslator.convertMessage(packet.getContent(), session.locale()));
|
||||
}
|
||||
|
||||
if (session.isSentSpawnPacket()) {
|
||||
session.sendUpstreamPacket(textPacket);
|
||||
|
@ -26,7 +26,7 @@
|
||||
package org.geysermc.geyser.translator.protocol.java.title;
|
||||
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.title.ClientboundSetActionBarTextPacket;
|
||||
import org.cloudburstmc.protocol.bedrock.packet.TextPacket;
|
||||
import org.cloudburstmc.protocol.bedrock.packet.SetTitlePacket;
|
||||
import org.geysermc.geyser.session.GeyserSession;
|
||||
import org.geysermc.geyser.translator.protocol.PacketTranslator;
|
||||
import org.geysermc.geyser.translator.protocol.Translator;
|
||||
@ -44,14 +44,11 @@ public class JavaSetActionBarTextTranslator extends PacketTranslator<Clientbound
|
||||
text = MessageTranslator.convertMessage(packet.getText(), session.locale());
|
||||
}
|
||||
|
||||
// Type seems wrong, but is intentional to avoid collisions with armor/remaining air bars
|
||||
TextPacket textPacket = new TextPacket();
|
||||
textPacket.setType(TextPacket.Type.JUKEBOX_POPUP);
|
||||
textPacket.setNeedsTranslation(false);
|
||||
textPacket.setSourceName("");
|
||||
textPacket.setMessage(text);
|
||||
textPacket.setXuid("");
|
||||
textPacket.setPlatformChatId("");
|
||||
session.sendUpstreamPacket(textPacket);
|
||||
SetTitlePacket titlePacket = new SetTitlePacket();
|
||||
titlePacket.setType(SetTitlePacket.Type.ACTIONBAR);
|
||||
titlePacket.setText(text);
|
||||
titlePacket.setXuid("");
|
||||
titlePacket.setPlatformOnlineId("");
|
||||
session.sendUpstreamPacket(titlePacket);
|
||||
}
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren