13
0
geforkt von Mirrors/Velocity

Remove display name

Dieser Commit ist enthalten in:
lexikiq 2021-06-12 12:12:04 -04:00
Ursprung 8356b812c3
Commit 72408d5bd8
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: AE6C11E94FDBB116
2 geänderte Dateien mit 0 neuen und 13 gelöschten Zeilen

Datei anzeigen

@ -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<HoverEvent.ShowEntity> asHoverEvent(
@NotNull UnaryOperator<HoverEvent.ShowEntity> op) {

Datei anzeigen

@ -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();