Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
d232d18fda
Commit
a6407d6bb0
@ -62,7 +62,7 @@ public class Tablist extends MessageToMessageDecoder<PacketWrapper> {
|
||||
this.player = player;
|
||||
this.viewer = ChatSender.of(player);
|
||||
this.directTabItems = Storage.directTabItems.computeIfAbsent(player, p -> new HashMap<>());
|
||||
onServerSwitch();
|
||||
injection();
|
||||
}
|
||||
|
||||
public void update(TablistPart global, int seconds) {
|
||||
@ -145,12 +145,17 @@ public class Tablist extends MessageToMessageDecoder<PacketWrapper> {
|
||||
}
|
||||
|
||||
public void onServerSwitch() {
|
||||
connection = (ServerConnection) player.getServer();
|
||||
injection();
|
||||
|
||||
synchronized (directTabItems) {
|
||||
sendNpcPacket(npcs.stream().map(npc -> directTabItems.get(npc).getUsername()).collect(Collectors.toList()), true);
|
||||
directTabItems.clear();
|
||||
npcs.clear();
|
||||
}
|
||||
}
|
||||
|
||||
private void injection() {
|
||||
connection = (ServerConnection) player.getServer();
|
||||
|
||||
if(connection != null) {
|
||||
ChannelPipeline pipeline = connection.getCh().getHandle().pipeline();
|
||||
|
@ -51,7 +51,9 @@ public class TablistManager extends BasicListener {
|
||||
|
||||
public TablistManager() {
|
||||
ProxyServer.getInstance().getScheduler().schedule(BungeeCore.get(), this::updateTablist, 1, 1, TimeUnit.SECONDS);
|
||||
ProxyServer.getInstance().getPlayers().forEach(player -> tablists.put(player, new Tablist(player)));
|
||||
synchronized (tablists) {
|
||||
ProxyServer.getInstance().getPlayers().forEach(player -> tablists.put(player, new Tablist(player)));
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren