mirror of
https://github.com/WiIIiam278/Velocitab.git
synced 2025-11-18 07:14:23 +01:00
refactor: lastDiplayname -> lastDisplayName
This commit is contained in:
parent
8bace563b4
commit
247fc68a4a
@ -112,7 +112,7 @@ public class PacketEventManager {
|
||||
.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()))));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -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
|
||||
@ -107,7 +107,7 @@ public final class TabPlayer implements Comparable<TabPlayer> {
|
||||
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
|
||||
@ -179,7 +179,7 @@ public final class TabPlayer implements Comparable<TabPlayer> {
|
||||
", role=" + role +
|
||||
", headerIndex=" + headerIndex +
|
||||
", footerIndex=" + footerIndex +
|
||||
", lastDisplayname=" + lastDisplayname +
|
||||
", lastDisplayname=" + lastDisplayName +
|
||||
", teamName='" + teamName + '\'' +
|
||||
", lastServer='" + lastServer + '\'' +
|
||||
", group=" + group.name() +
|
||||
|
||||
@ -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 class PlayerTabList {
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user