Skip to content

Characters.publicName: a character's alias for other plugins - #52

Merged
XxFran10xX merged 1 commit into
mainfrom
feat/character-public-name
Nov 19, 2026
Merged

XxFran10xX merged 1 commit into
mainfrom
feat/character-public-name

Conversation

@XxFran10xX

@XxFran10xX XxFran10xX commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Status record

  • Reviewed: skipped (13 non-test lines, no saved data)
  • Second opinion: CodeRabbit APPROVED at a05a614
  • Dev-tested at a05a614 (with RPCharacters #162, SimpleFactions #251, BirdMessenger Expose each account's reviewed legacy heir #43 on TFMCDev01: faction leader shows the alias, creation alias step)
  • Local tests: CharactersTest, CharacterValuesTest, CharacterEventsTest passed at a05a614

What

Characters.publicName(characterId) (and the CharacterIdentity.publicName default method): the name a character goes by in public, online or offline. That is its alias, or its real name when it has none. Masks and temporary aliases never count (displayName(Player) still covers those for players online now).

Providers that keep no aliases answer with the real name, so nothing changes until RPCharacters implements it.

Why

Players thought the character name they type at creation was public. Plugins that list characters (SimpleFactions' faction list, the public map, grave holograms, letter estates) showed that real name even when the character had an alias. This lets them show the alias instead. Feature request: "Alias separation in Character Creator".

Used by

  • RPCharacters (implements it, plus the new creation step)
  • SimpleFactions (member names)
  • BirdMessenger (estate letter labels)

Those PRs pin TLibs 2.8.0, so their CI passes once this is released.

🤖 Generated with Claude Code

Characters.publicName(characterId) gives the name a character goes by in
public, online or offline: its alias, or its real name without one. Masks
and temporary aliases never count. Providers that keep no aliases fall back
to the real name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • New Features
    • Added a way to retrieve a character’s public name, using an alias when available and otherwise the real name.
    • Returns no name when the character is unknown or no provider is registered.

The character identity API adds public-name lookup. The default implementation returns the character’s real name when available. The registry delegates to its provider and returns an empty optional if no provider is registered. Tests cover these behaviours and non-main-thread rejection.

Changes: Character public-name lookup

Layer / File(s) Summary
Add public-name lookup and verify behaviour
src/main/java/net/tfminecraft/tlibs/character/CharacterIdentity.java, src/main/java/net/tfminecraft/tlibs/character/Characters.java, src/test/java/net/tfminecraft/tlibs/character/CharactersTest.java
CharacterIdentity adds a default publicName(UUID) method and updates the displayName(Player) documentation. Characters delegates lookup to the registered provider. Tests cover missing providers, provider delegation, default results and non-main-thread rejection.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Feature

Suggested reviewers: ryanbarlow97

Merge Risk: Minimal · up to a05a6

This adds a public-name lookup API that returns the real name until a provider implements alias support, so existing behavior is unchanged. No merge-blocking risk was found.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: de0c56d1-17c1-4eca-bbe6-9cf99b4a7dda
Commits

Reviewing files that changed from the base of the PR and between 64ff730 and a05a614.

Files selected for processing: 3

  • src/main/java/net/tfminecraft/tlibs/character/CharacterIdentity.java
  • src/main/java/net/tfminecraft/tlibs/character/Characters.java
  • src/test/java/net/tfminecraft/tlibs/character/CharactersTest.java

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@github-actions github-actions Bot added the size:S 10-29 effective changed lines (tests excluded in mixed PRs). label Nov 19, 2026
@XxFran10xX

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@XxFran10xX
XxFran10xX merged commit e8b64ca into main Nov 19, 2026
5 checks passed
@XxFran10xX
XxFran10xX deleted the feat/character-public-name branch November 19, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 effective changed lines (tests excluded in mixed PRs).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant