Skip to content

Commit

Permalink
refactor: lastDiplayname -> lastDisplayName
Browse files Browse the repository at this point in the history
  • Loading branch information
WiIIiam278 committed Jan 19, 2024
1 parent 8bace56 commit 247fc68
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()))));
}

}
6 changes: 3 additions & 3 deletions src/main/java/net/william278/velocitab/player/TabPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public final class TabPlayer implements Comparable<TabPlayer> {
private Role role;
private int headerIndex = 0;
private int footerIndex = 0;
private Component lastDisplayname;
private Component lastDisplayName;
private String teamName;
@Nullable
@Setter
Expand Down Expand Up @@ -107,7 +107,7 @@ public String getServerDisplayName(@NotNull Velocitab plugin) {
public CompletableFuture<Component> 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
Expand Down Expand Up @@ -179,7 +179,7 @@ public String toString() {
", role=" + role +
", headerIndex=" + headerIndex +
", footerIndex=" + footerIndex +
", lastDisplayname=" + lastDisplayname +
", lastDisplayname=" + lastDisplayName +
", teamName='" + teamName + '\'' +
", lastServer='" + lastServer + '\'' +
", group=" + group.name() +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 247fc68

Please sign in to comment.