From 3be4da2392ccef21a9d659169c182fed4078f857 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sat, 10 Dec 2022 11:25:22 +0100 Subject: [PATCH] Fix local Chat 1.19 - 1.19.2 Signed-off-by: Lixfel --- src/de/steamwar/bungeecore/util/Chat19.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/de/steamwar/bungeecore/util/Chat19.java b/src/de/steamwar/bungeecore/util/Chat19.java index 9205579..a543f74 100644 --- a/src/de/steamwar/bungeecore/util/Chat19.java +++ b/src/de/steamwar/bungeecore/util/Chat19.java @@ -22,6 +22,7 @@ package de.steamwar.bungeecore.util; import net.md_5.bungee.ServerConnection; import net.md_5.bungee.api.connection.ProxiedPlayer; 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.packet.ClientChat; import net.md_5.bungee.protocol.packet.ClientCommand; @@ -33,11 +34,12 @@ public class Chat19 { private Chat19(){} 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("/")) { ((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 { - ((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 { p.chat(message);