3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-11-16 21:10:30 +01:00

Improve Player#asComponent

Dieser Commit ist enthalten in:
lexikiq 2021-06-11 20:06:28 -04:00
Ursprung ba4ba2022e
Commit 9491046935
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: AE6C11E94FDBB116

Datei anzeigen

@ -31,6 +31,7 @@ import net.kyori.adventure.key.Keyed;
import net.kyori.adventure.pointer.Pointers; import net.kyori.adventure.pointer.Pointers;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.ComponentLike; import net.kyori.adventure.text.ComponentLike;
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;
@ -292,7 +293,9 @@ public interface Player extends CommandSource, Identified, InboundConnection,
@Override @Override
default @NotNull Component asComponent() { default @NotNull Component asComponent() {
return Component.text(getUsername()).hoverEvent(this); return Component.text(getUsername()).hoverEvent(this)
.clickEvent(ClickEvent.suggestCommand("/tell " + getUsername()))
.insertion(getUsername());
} }
@Override @Override