Fix failed Dispatch Packet on server disconnect (#28)

This commit is contained in:
ironboundred 2023-03-30 14:40:22 -05:00 committed by GitHub
parent 95bc4669a8
commit f14a92b432
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -154,6 +154,9 @@ public class PlayerTabList {
// Update a player's name in the tab list
public void updatePlayer(@NotNull TabPlayer tabPlayer) {
if (!tabPlayer.getPlayer().isActive()) {
return;
}
players.forEach(player -> tabPlayer.getDisplayName(plugin).thenAccept(displayName -> {
player.getPlayer().getTabList().getEntries().stream()
.filter(e -> e.getProfile().getId().equals(tabPlayer.getPlayer().getUniqueId())).findFirst()