From 72408d5bd896e3a2e1bf4dadfe733e1217dff1f6 Mon Sep 17 00:00:00 2001 From: lexikiq Date: Sat, 12 Jun 2021 12:12:04 -0400 Subject: [PATCH] Remove display name --- .../java/com/velocitypowered/api/proxy/Player.java | 12 ------------ .../proxy/connection/client/ConnectedPlayer.java | 1 - 2 files changed, 13 deletions(-) diff --git a/api/src/main/java/com/velocitypowered/api/proxy/Player.java b/api/src/main/java/com/velocitypowered/api/proxy/Player.java index 27fa6f299..66c5b433a 100644 --- a/api/src/main/java/com/velocitypowered/api/proxy/Player.java +++ b/api/src/main/java/com/velocitypowered/api/proxy/Player.java @@ -29,7 +29,6 @@ import net.kyori.adventure.identity.Identity; import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Keyed; import net.kyori.adventure.text.Component; -import net.kyori.adventure.text.event.ClickEvent; import net.kyori.adventure.text.event.HoverEvent; import net.kyori.adventure.text.event.HoverEventSource; import org.checkerframework.checker.nullness.qual.Nullable; @@ -288,17 +287,6 @@ public interface Player extends CommandSource, Identified, InboundConnection, return Key.key("player"); } - /** - * Gets a {@link Component} that renders a player name similarly to vanilla. - * - * @return a Component representing this player - */ - default @NotNull Component getDisplayName() { - return Component.text(getUsername()).hoverEvent(this) - .clickEvent(ClickEvent.suggestCommand("/tell " + getUsername())) - .insertion(getUsername()); - } - @Override default @NotNull HoverEvent asHoverEvent( @NotNull UnaryOperator op) { diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java index 7807c8518..f0f31f0ed 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java @@ -148,7 +148,6 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player { private final @NotNull Pointers pointers = Player.super.pointers().toBuilder() .withDynamic(Identity.UUID, this::getUniqueId) .withDynamic(Identity.NAME, this::getUsername) - .withDynamic(Identity.DISPLAY_NAME, this::getDisplayName) .withStatic(PermissionChecker.POINTER, getPermissionChecker()) .build();