From 35d25f770b51e5f1a5ace93c62046fa76c99342b Mon Sep 17 00:00:00 2001 From: Timongcraft Date: Wed, 9 Oct 2024 14:14:02 +0200 Subject: [PATCH] fix: players being invisible --- .../proxy/tablist/KeyedVelocityTabList.java | 4 ++-- .../velocitypowered/proxy/tablist/VelocityTabList.java | 8 ++++---- .../proxy/tablist/VelocityTabListLegacy.java | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/tablist/KeyedVelocityTabList.java b/proxy/src/main/java/com/velocitypowered/proxy/tablist/KeyedVelocityTabList.java index 61b17b097..8caa8d6d6 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/tablist/KeyedVelocityTabList.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/tablist/KeyedVelocityTabList.java @@ -187,7 +187,7 @@ public class KeyedVelocityTabList implements InternalTabList { Set.of(action), Collections.unmodifiableList(entries) ) - ).thenAcceptAsync(event -> { + ).thenAccept(event -> { if (event.getResult().isAllowed()) { if (event.getResult().getIds().isEmpty()) { boolean rewrite = false; @@ -242,7 +242,7 @@ public class KeyedVelocityTabList implements InternalTabList { } } } - }); + }).join(); } protected ServerUpdateTabListEvent.@Nullable Action mapToEventAction(int action) { diff --git a/proxy/src/main/java/com/velocitypowered/proxy/tablist/VelocityTabList.java b/proxy/src/main/java/com/velocitypowered/proxy/tablist/VelocityTabList.java index 4b8821ee3..b63d20754 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/tablist/VelocityTabList.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/tablist/VelocityTabList.java @@ -225,7 +225,7 @@ public class VelocityTabList implements InternalTabList { proxyServer.getEventManager().fire(new ServerUpdateTabListEvent(player, Collections.unmodifiableSet(mapToEventActions(infoPacket.getActions())), Collections.unmodifiableList(entries)) - ).thenAcceptAsync(event -> { + ).thenAccept(event -> { if (event.getResult().isAllowed()) { if (event.getResult().getIds().isEmpty()) { boolean rewrite = false; @@ -258,7 +258,7 @@ public class VelocityTabList implements InternalTabList { } } } - }); + }).join(); } protected UpsertPlayerInfoPacket.Entry createRawEntry(VelocityTabListEntry entry) { @@ -456,7 +456,7 @@ public class VelocityTabList implements InternalTabList { Set.of(ServerUpdateTabListEvent.Action.REMOVE_PLAYER), Collections.unmodifiableList(entries) ) - ).thenAcceptAsync(event -> { + ).thenAccept(event -> { if (event.getResult().isAllowed()) { if (event.getResult().getIds().isEmpty()) { for (UUID uuid : infoPacket.getProfilesToRemove()) { @@ -476,6 +476,6 @@ public class VelocityTabList implements InternalTabList { this.connection.write(new RemovePlayerInfoPacket(uuids)); } } - }); + }).join(); } } diff --git a/proxy/src/main/java/com/velocitypowered/proxy/tablist/VelocityTabListLegacy.java b/proxy/src/main/java/com/velocitypowered/proxy/tablist/VelocityTabListLegacy.java index 989cd9ff0..61f5997d9 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/tablist/VelocityTabListLegacy.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/tablist/VelocityTabListLegacy.java @@ -96,7 +96,7 @@ public class VelocityTabListLegacy extends KeyedVelocityTabList { Set.of(action), Collections.singletonList(entry) ) - ).thenAcceptAsync(event -> { + ).thenAccept(event -> { if (event.getResult().isAllowed()) { if (event.getResult().getIds().isEmpty()) { if (entry.isRewrite()) { @@ -134,7 +134,7 @@ public class VelocityTabListLegacy extends KeyedVelocityTabList { } } } - }); + }).join(); } private UpdateEventTabListEntry mapToEventEntry(int action, LegacyPlayerListItemPacket.Item packetItem) {