Keep server tab names and team formatting; fix player lookups #9

Merged
selimaj-dev merged 1 commits from fix-tablist-and-player-lookups into master 2026-09-25 12:01:39 +00:00
Owner

Fixes #3. Pulls in saturnclientmc/common#1, which fixes #2 and #6.

Summary

Tab list (#3)

TabListMixin in all 8 versions used @Overwrite on PlayerListEntry.getDisplayName() and always returned Text.literal(name). That dropped server-set display names (rank prefixes, colours). Because it never returned null, it also disabled vanilla's team decoration, for every player.

It's now an @Inject at RETURN:

  • Non-Saturn players keep vanilla's value untouched.
  • Saturn players get the Saturn icon in front of the original name. When the server set none, the icon goes in front of Team.decorateName(team, name), which is what vanilla's tab list shows.
  • Separate styles: the icon and the name sit side by side under an empty parent, so the name keeps its own colours instead of inheriting the icon's.
  • Compatibility: no more @Overwrite, so it no longer conflicts with other mods that touch this method.

The only difference between versions is the GameProfile accessors: getName()/getId() for 1.21.4–1.21.8 and name()/id() for 1.21.9+.

common bump (#2, #6)

This moves the submodule to 9e3bf14 (saturnclientmc/common#1):

  • no more per-frame get_player requests for non-Saturn players
  • thread-safe player and cosmetic state

Merge order

  1. Merge saturnclientmc/common#1.
  2. Update the common pointer here to the merge commit on common/master. It currently points at the PR branch head 9e3bf14.
  3. Merge this PR.

Testing

  • ./gradlew compileJava passes for all 8 versions.
  • 1.21.11, with a real account (DevAuth) against the production server:
    • The Mixin class export shows getDisplayName calling saturn$addSaturnIcon.
    • A test datapack put the player on a red team with a [VIP] prefix. The tab list rendered the Saturn icon followed by the red [VIP] Kr4ight, where the old code showed a plain white name.
  • 1.21.4, on an offline account, so not a Saturn player:
    • The injection is present in the exported class.
    • The tab list rendered the red [VIP] Player235 with no icon, meaning vanilla team formatting is kept for non-Saturn players.
  • Not covered: 1.21.5–1.21.10 compile, but weren't launched; each is identical to 1.21.4 or 1.21.11 apart from the accessors. The multi-player lookup scenario (#2) wasn't reproduced; both tests were singleplayer.

🤖 Generated with Claude Code

Fixes #3. Pulls in saturnclientmc/common#1, which fixes #2 and #6. ## Summary ### Tab list (#3) `TabListMixin` in all 8 versions used `@Overwrite` on `PlayerListEntry.getDisplayName()` and always returned `Text.literal(name)`. That dropped server-set display names (rank prefixes, colours). Because it never returned `null`, it also disabled vanilla's team decoration, for **every** player. It's now an `@Inject` at `RETURN`: - **Non-Saturn players** keep vanilla's value untouched. - **Saturn players** get the Saturn icon in front of the original name. When the server set none, the icon goes in front of `Team.decorateName(team, name)`, which is what vanilla's tab list shows. - **Separate styles:** the icon and the name sit side by side under an empty parent, so the name keeps its own colours instead of inheriting the icon's. - **Compatibility:** no more `@Overwrite`, so it no longer conflicts with other mods that touch this method. The only difference between versions is the `GameProfile` accessors: `getName()`/`getId()` for 1.21.4–1.21.8 and `name()`/`id()` for 1.21.9+. ### `common` bump (#2, #6) This moves the submodule to `9e3bf14` (saturnclientmc/common#1): - no more per-frame `get_player` requests for non-Saturn players - thread-safe player and cosmetic state ## Merge order 1. Merge saturnclientmc/common#1. 2. Update the `common` pointer here to the merge commit on `common/master`. It currently points at the PR branch head `9e3bf14`. 3. Merge this PR. ## Testing - `./gradlew compileJava` passes for all 8 versions. - **1.21.11**, with a real account (DevAuth) against the production server: - The Mixin class export shows `getDisplayName` calling `saturn$addSaturnIcon`. - A test datapack put the player on a red team with a `[VIP] ` prefix. The tab list rendered **the Saturn icon followed by the red `[VIP] Kr4ight`**, where the old code showed a plain white name. - **1.21.4**, on an offline account, so not a Saturn player: - The injection is present in the exported class. - The tab list rendered **the red `[VIP] Player235` with no icon**, meaning vanilla team formatting is kept for non-Saturn players. - **Not covered:** 1.21.5–1.21.10 compile, but weren't launched; each is identical to 1.21.4 or 1.21.11 apart from the accessors. The multi-player lookup scenario (#2) wasn't reproduced; both tests were singleplayer. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
selimaj-dev added 1 commit 2026-09-25 12:00:54 +00:00
TabListMixin @Overwrote PlayerListEntry.getDisplayName() and always
returned the bare profile name, dropping server-set display names (rank
prefixes, colours) and, by never returning null, vanilla's team
decoration, for every player. Inject at RETURN instead: non-Saturn
players keep the original value, and Saturn players get the icon in
front of the original name, or the team-decorated profile name when the
server set none.

Also bump common for the player-lookup and thread-safety fixes.

Fixes #3. Refs #2, #6.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
selimaj-dev merged commit 1a5c7f2a2c into master 2026-09-25 12:01:39 +00:00
selimaj-dev deleted branch fix-tablist-and-player-lookups 2026-09-25 12:02:32 +00:00
Sign in to join this conversation.