Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-17 05:20:14 +01:00
Remove display name
Dieser Commit ist enthalten in:
Ursprung
8356b812c3
Commit
72408d5bd8
@ -29,7 +29,6 @@ import net.kyori.adventure.identity.Identity;
|
|||||||
import net.kyori.adventure.key.Key;
|
import net.kyori.adventure.key.Key;
|
||||||
import net.kyori.adventure.key.Keyed;
|
import net.kyori.adventure.key.Keyed;
|
||||||
import net.kyori.adventure.text.Component;
|
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.HoverEvent;
|
||||||
import net.kyori.adventure.text.event.HoverEventSource;
|
import net.kyori.adventure.text.event.HoverEventSource;
|
||||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||||
@ -288,17 +287,6 @@ public interface Player extends CommandSource, Identified, InboundConnection,
|
|||||||
return Key.key("player");
|
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
|
@Override
|
||||||
default @NotNull HoverEvent<HoverEvent.ShowEntity> asHoverEvent(
|
default @NotNull HoverEvent<HoverEvent.ShowEntity> asHoverEvent(
|
||||||
@NotNull UnaryOperator<HoverEvent.ShowEntity> op) {
|
@NotNull UnaryOperator<HoverEvent.ShowEntity> op) {
|
||||||
|
@ -148,7 +148,6 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
|
|||||||
private final @NotNull Pointers pointers = Player.super.pointers().toBuilder()
|
private final @NotNull Pointers pointers = Player.super.pointers().toBuilder()
|
||||||
.withDynamic(Identity.UUID, this::getUniqueId)
|
.withDynamic(Identity.UUID, this::getUniqueId)
|
||||||
.withDynamic(Identity.NAME, this::getUsername)
|
.withDynamic(Identity.NAME, this::getUsername)
|
||||||
.withDynamic(Identity.DISPLAY_NAME, this::getDisplayName)
|
|
||||||
.withStatic(PermissionChecker.POINTER, getPermissionChecker())
|
.withStatic(PermissionChecker.POINTER, getPermissionChecker())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren