From 3be4da2392ccef21a9d659169c182fed4078f857 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sat, 10 Dec 2022 11:25:22 +0100 Subject: [PATCH 1/4] 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); From 0c509bdfdc71c984027e84629a3f3fefda4d82ea Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sat, 10 Dec 2022 12:30:10 +0100 Subject: [PATCH 2/4] Test fix tablist order Signed-off-by: Lixfel --- src/de/steamwar/bungeecore/tablist/Tablist.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/de/steamwar/bungeecore/tablist/Tablist.java b/src/de/steamwar/bungeecore/tablist/Tablist.java index b347147..a1ba215 100644 --- a/src/de/steamwar/bungeecore/tablist/Tablist.java +++ b/src/de/steamwar/bungeecore/tablist/Tablist.java @@ -168,8 +168,7 @@ public class Tablist extends MessageToMessageDecoder { pipeline.remove("steamwar-tablist"); pipeline.addBefore(PipelineUtils.BOSS_HANDLER, "steamwar-tablist", this); - if(oldTab()) - player.unsafe().sendPacket(teamPacket); + player.unsafe().sendPacket(teamPacket); } } @@ -324,7 +323,7 @@ public class Tablist extends MessageToMessageDecoder { } private void sendNpcPacket(List names, boolean remove) { - if(oldTab() && !names.isEmpty()) { + if(!names.isEmpty()) { Team packet = new Team(TAB_TEAM); packet.setMode((byte) (remove ? 4 : 3)); packet.setPlayers(names.toArray(new String[0])); From 5fd0dcae65d984781800c2b6bc3be25a9389d385 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sat, 10 Dec 2022 12:38:07 +0100 Subject: [PATCH 3/4] Fix NPC removal in Tablist Signed-off-by: Lixfel --- src/de/steamwar/bungeecore/tablist/Tablist.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/tablist/Tablist.java b/src/de/steamwar/bungeecore/tablist/Tablist.java index a1ba215..b34fbad 100644 --- a/src/de/steamwar/bungeecore/tablist/Tablist.java +++ b/src/de/steamwar/bungeecore/tablist/Tablist.java @@ -238,11 +238,15 @@ public class Tablist extends MessageToMessageDecoder { break; } } else if(packet instanceof PlayerListItemRemove) { + List names = new ArrayList<>(); for(UUID uuid : ((PlayerListItemRemove) packet).getUuids()) { synchronized (directTabItems) { - directTabItems.remove(uuid); + PlayerListItem.Item directItem = directTabItems.remove(uuid); + if(npcs.remove(uuid)) + names.add(directItem.getUsername()); } } + sendNpcPacket(names, true); } else if(packet instanceof PlayerListItemUpdate) { PlayerListItemUpdate list = (PlayerListItemUpdate) packet; EnumSet actions = list.getActions(); From e6d0bcc69fe43c3ce3d2daba83ff854b2beee274 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Wed, 14 Dec 2022 09:05:15 +0100 Subject: [PATCH 4/4] Disable LX Signed-off-by: Lixfel --- src/de/steamwar/bungeecore/BungeeCore.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/BungeeCore.java b/src/de/steamwar/bungeecore/BungeeCore.java index 6465671..b627d99 100644 --- a/src/de/steamwar/bungeecore/BungeeCore.java +++ b/src/de/steamwar/bungeecore/BungeeCore.java @@ -116,7 +116,7 @@ public class BungeeCore extends Plugin { local = new Node.LocalNode(); if(MAIN_SERVER) { - new Node.RemoteNode("lx"); + //new Node.RemoteNode("lx"); } commands.put("/tp", null);