✨ feat(MessageFormatter): enhance name formatting to support teleport… - #129
TheBjoRedCraft wants to merge 1 commit into
Conversation
…ation and improve message display
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The new name-click teleport mechanism routes through /tp (name-based, command-dependent) instead of the existing UUID-based teleport abstraction, and several public-facing API conveniences were removed/changed without compatibility safeguards.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 4
Open (4)
What changed in this PR
This PR updates chat message rendering so sender names can optionally become teleport targets and message hover details are simplified to show timestamp + plain text, with the change applied consistently across Paper and Minestom formatters.
Changes:
- Extend
appendNamewith anallowTeleportflag and update platform formatters to use it. - Replace the previous hover payload (
appendMessageData) with a simpler timestamp + plain message hover in global formatting. - Minor UI tweaks (delete icon/tooltip) and bump version to
4.5.16.
| File | Description |
|---|---|
| surf-chat-paper/src/main/kotlin/dev/slne/surf/chat/paper/util/components.kt | Updates Paper appendName(Player, …) wrapper to forward teleport capability. |
| surf-chat-paper/src/main/kotlin/dev/slne/surf/chat/paper/message/MessageFormatter.kt | Uses new name formatting + adjusts separators and hover payload for global messages. |
| surf-chat-minestom/src/main/kotlin/dev/slne/surf/chat/minestom/message/MinestomMessageFormatter.kt | Mirrors the Paper global formatting updates for Minestom. |
| surf-chat-core/surf-chat-core-client/src/main/kotlin/dev/slne/surf/chat/core/client/message/format/common-format.kt | Implements teleport-capable name formatting and tweaks delete UI. |
| gradle.properties | Bumps project version. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| append { | ||
| append(MiniMessage.miniMessage().deserialize(prefix + name)) | ||
| if (allowTeleport) { | ||
| clickRunsCommand("/tp $name") |
There was a problem hiding this comment.
Es gibt keinen tp command auf minestom deswegen war das vorher über das callback
Also so ungefähr
clickEvent(ClickEvent.callback { clicked ->
val who = clicked.uuidOrNull() ?: return@callback
ChatPlatform.teleportToPlayer(who, teleportTarget)
})
…ation and improve message display