SteamWar/BungeeCore
Archiviert
13
2

Fix local Chat 1.19 - 1.19.2
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2022-12-10 11:25:22 +01:00
Ursprung 37f32033db
Commit 3be4da2392

Datei anzeigen

@ -22,6 +22,7 @@ package de.steamwar.bungeecore.util;
import net.md_5.bungee.ServerConnection; import net.md_5.bungee.ServerConnection;
import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.protocol.ChatChain; import net.md_5.bungee.protocol.ChatChain;
import net.md_5.bungee.protocol.ProtocolConstants;
import net.md_5.bungee.protocol.SeenMessages; import net.md_5.bungee.protocol.SeenMessages;
import net.md_5.bungee.protocol.packet.ClientChat; import net.md_5.bungee.protocol.packet.ClientChat;
import net.md_5.bungee.protocol.packet.ClientCommand; import net.md_5.bungee.protocol.packet.ClientCommand;
@ -33,11 +34,12 @@ public class Chat19 {
private Chat19(){} private Chat19(){}
public static void chat(ProxiedPlayer p, String message) { public static void chat(ProxiedPlayer p, String message) {
if(p.getPendingConnection().getVersion() >= 759) { int version = p.getPendingConnection().getVersion();
if(version >= ProtocolConstants.MINECRAFT_1_19) {
if(message.startsWith("/")) { if(message.startsWith("/")) {
((ServerConnection) p.getServer()).getCh().write(new ClientCommand(message.substring(1), System.currentTimeMillis(), 0, Collections.emptyMap(), false, new ChatChain(Collections.emptyList(), null), new SeenMessages(0, new BitSet(0)))); ((ServerConnection) p.getServer()).getCh().write(new ClientCommand(message.substring(1), System.currentTimeMillis(), 0, Collections.emptyMap(), false, new ChatChain(Collections.emptyList(), null), new SeenMessages(0, new BitSet(0))));
} else { } else {
((ServerConnection) p.getServer()).getCh().write(new ClientChat(message, System.currentTimeMillis(), 0, null, false, new ChatChain(Collections.emptyList(), null), new SeenMessages(0, new BitSet(0)))); ((ServerConnection) p.getServer()).getCh().write(new ClientChat(message, System.currentTimeMillis(), 0, version < ProtocolConstants.MINECRAFT_1_19_3 ? new byte[0] : null, false, new ChatChain(Collections.emptyList(), null), new SeenMessages(0, new BitSet(0))));
} }
} else { } else {
p.chat(message); p.chat(message);