SteamWar/BungeeCore
Archiviert
13
2

Merge remote-tracking branch 'origin/master'
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2022-12-17 12:29:14 +01:00
Commit 4904e9b60f
3 geänderte Dateien mit 12 neuen und 7 gelöschten Zeilen

Datei anzeigen

@ -116,7 +116,7 @@ public class BungeeCore extends Plugin {
local = new Node.LocalNode(); local = new Node.LocalNode();
if(MAIN_SERVER) { if(MAIN_SERVER) {
new Node.RemoteNode("lx"); //new Node.RemoteNode("lx");
} }
commands.put("/tp", null); commands.put("/tp", null);

Datei anzeigen

@ -168,7 +168,6 @@ public class Tablist extends MessageToMessageDecoder<PacketWrapper> {
pipeline.remove("steamwar-tablist"); pipeline.remove("steamwar-tablist");
pipeline.addBefore(PipelineUtils.BOSS_HANDLER, "steamwar-tablist", this); pipeline.addBefore(PipelineUtils.BOSS_HANDLER, "steamwar-tablist", this);
if(oldTab())
player.unsafe().sendPacket(teamPacket); player.unsafe().sendPacket(teamPacket);
} }
} }
@ -239,11 +238,15 @@ public class Tablist extends MessageToMessageDecoder<PacketWrapper> {
break; break;
} }
} else if(packet instanceof PlayerListItemRemove) { } else if(packet instanceof PlayerListItemRemove) {
List<String> names = new ArrayList<>();
for(UUID uuid : ((PlayerListItemRemove) packet).getUuids()) { for(UUID uuid : ((PlayerListItemRemove) packet).getUuids()) {
synchronized (directTabItems) { 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) { } else if(packet instanceof PlayerListItemUpdate) {
PlayerListItemUpdate list = (PlayerListItemUpdate) packet; PlayerListItemUpdate list = (PlayerListItemUpdate) packet;
EnumSet<PlayerListItemUpdate.Action> actions = list.getActions(); EnumSet<PlayerListItemUpdate.Action> actions = list.getActions();
@ -324,7 +327,7 @@ public class Tablist extends MessageToMessageDecoder<PacketWrapper> {
} }
private void sendNpcPacket(List<String> names, boolean remove) { private void sendNpcPacket(List<String> names, boolean remove) {
if(oldTab() && !names.isEmpty()) { if(!names.isEmpty()) {
Team packet = new Team(TAB_TEAM); Team packet = new Team(TAB_TEAM);
packet.setMode((byte) (remove ? 4 : 3)); packet.setMode((byte) (remove ? 4 : 3));
packet.setPlayers(names.toArray(new String[0])); packet.setPlayers(names.toArray(new String[0]));

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);