From 247fc68a4ae764b376f3f5b8d078fb9b1b875a42 Mon Sep 17 00:00:00 2001 From: William278 Date: Fri, 19 Jan 2024 17:12:55 +0000 Subject: [PATCH] refactor: lastDiplayname -> lastDisplayName --- .../net/william278/velocitab/packet/PacketEventManager.java | 2 +- .../java/net/william278/velocitab/player/TabPlayer.java | 6 +++--- .../java/net/william278/velocitab/tab/PlayerTabList.java | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/net/william278/velocitab/packet/PacketEventManager.java b/src/main/java/net/william278/velocitab/packet/PacketEventManager.java index 3856cfa2..cb57836a 100644 --- a/src/main/java/net/william278/velocitab/packet/PacketEventManager.java +++ b/src/main/java/net/william278/velocitab/packet/PacketEventManager.java @@ -112,7 +112,7 @@ protected void handleEntry(@NotNull UpsertPlayerInfoPacket packet, @NotNull Play .filter(entry -> entry.getProfileId().equals(tabPlayer.getPlayer().getUniqueId())) .findFirst() .ifPresent(entry -> entry.setDisplayName( - new ComponentHolder(player.getProtocolVersion(), tabPlayer.getLastDisplayname())))); + new ComponentHolder(player.getProtocolVersion(), tabPlayer.getLastDisplayName())))); } } diff --git a/src/main/java/net/william278/velocitab/player/TabPlayer.java b/src/main/java/net/william278/velocitab/player/TabPlayer.java index ed3fd3c8..756cc7a5 100644 --- a/src/main/java/net/william278/velocitab/player/TabPlayer.java +++ b/src/main/java/net/william278/velocitab/player/TabPlayer.java @@ -43,7 +43,7 @@ public final class TabPlayer implements Comparable { private Role role; private int headerIndex = 0; private int footerIndex = 0; - private Component lastDisplayname; + private Component lastDisplayName; private String teamName; @Nullable @Setter @@ -107,7 +107,7 @@ public String getServerDisplayName(@NotNull Velocitab plugin) { public CompletableFuture getDisplayName(@NotNull Velocitab plugin) { return Placeholder.replace(group.format(), plugin, this) .thenApply(formatted -> plugin.getFormatter().format(formatted, this, plugin)) - .thenApply(c -> this.lastDisplayname = c); + .thenApply(c -> this.lastDisplayName = c); } @NotNull @@ -179,7 +179,7 @@ public String toString() { ", role=" + role + ", headerIndex=" + headerIndex + ", footerIndex=" + footerIndex + - ", lastDisplayname=" + lastDisplayname + + ", lastDisplayname=" + lastDisplayName + ", teamName='" + teamName + '\'' + ", lastServer='" + lastServer + '\'' + ", group=" + group.name() + diff --git a/src/main/java/net/william278/velocitab/tab/PlayerTabList.java b/src/main/java/net/william278/velocitab/tab/PlayerTabList.java index 60f91774..96826105 100644 --- a/src/main/java/net/william278/velocitab/tab/PlayerTabList.java +++ b/src/main/java/net/william278/velocitab/tab/PlayerTabList.java @@ -19,7 +19,6 @@ package net.william278.velocitab.tab; -import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.ServerConnection; @@ -289,7 +288,7 @@ public void updatePlayer(@NotNull TabPlayer tabPlayer, boolean force) { } public void updatePlayerDisplayName(@NotNull TabPlayer tabPlayer) { - final Component lastDisplayName = tabPlayer.getLastDisplayname(); + final Component lastDisplayName = tabPlayer.getLastDisplayName(); tabPlayer.getDisplayName(plugin).thenAccept(displayName -> { if (displayName == null || displayName.equals(lastDisplayName)) { return;