forked from chipmunkmc/chipmunkbot
fix lmao
This commit is contained in:
parent
483ba18302
commit
1b6f040122
2 changed files with 16 additions and 8 deletions
|
@ -3,9 +3,14 @@ package land.chipmunk.chipmunkbot.command;
|
||||||
import land.chipmunk.chipmunkbot.data.MutablePlayerListEntry;
|
import land.chipmunk.chipmunkbot.data.MutablePlayerListEntry;
|
||||||
import land.chipmunk.chipmunkbot.util.UUIDUtilities;
|
import land.chipmunk.chipmunkbot.util.UUIDUtilities;
|
||||||
import land.chipmunk.chipmunkbot.ChipmunkBot;
|
import land.chipmunk.chipmunkbot.ChipmunkBot;
|
||||||
|
import com.github.steveice10.mc.auth.data.GameProfile;
|
||||||
import net.kyori.adventure.text.Component;
|
import net.kyori.adventure.text.Component;
|
||||||
import net.kyori.adventure.text.format.NamedTextColor;
|
import net.kyori.adventure.text.format.NamedTextColor;
|
||||||
import net.kyori.adventure.text.format.TextDecoration;
|
import net.kyori.adventure.text.format.TextDecoration;
|
||||||
|
import net.kyori.adventure.text.format.Style;
|
||||||
|
import net.kyori.adventure.text.event.ClickEvent;
|
||||||
|
import net.kyori.adventure.text.event.HoverEvent;
|
||||||
|
import net.kyori.adventure.key.Key;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
public class PlayerCommandSource extends CommandSource {
|
public class PlayerCommandSource extends CommandSource {
|
||||||
|
@ -26,7 +31,17 @@ public class PlayerCommandSource extends CommandSource {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Component displayName () {
|
public Component displayName () {
|
||||||
return Component.selector(player.profile().getId().toString());
|
final GameProfile profile = player.profile();
|
||||||
|
final String username = profile.getName();
|
||||||
|
final UUID uuid = profile.getId();
|
||||||
|
|
||||||
|
final Style style = Style.style()
|
||||||
|
.insertion(username)
|
||||||
|
.clickEvent(ClickEvent.suggestCommand("/tell " + username + " "))
|
||||||
|
.hoverEvent(HoverEvent.showEntity(Key.key("minecraft", "player"), uuid, Component.text(username)))
|
||||||
|
.build();
|
||||||
|
|
||||||
|
return Component.text(username, style);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public MutablePlayerListEntry player () { return this.player; }
|
@Override public MutablePlayerListEntry player () { return this.player; }
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
package land.chipmunk.chipmunkbot.data.chat;
|
|
||||||
|
|
||||||
import net.kyori.adventure.text.Component;
|
|
||||||
|
|
||||||
public interface PlayerMessageParser {
|
|
||||||
PlayerMessage parse (Component message);
|
|
||||||
}
|
|
Loading…
Reference in a new issue