Skip to content

Find living characters by real name - #45

Merged
ryanbarlow97 merged 1 commit into
mainfrom
stage6/find-by-name
Oct 13, 2026
Merged

ryanbarlow97 merged 1 commit into
mainfrom
stage6/find-by-name

Conversation

@ryanbarlow97

@ryanbarlow97 ryanbarlow97 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Adds CharacterIdentity.findByName(String) -> List<CharacterInfo> and the matching Characters.findByName(String) facade method, for stage 6a's typed-name vehicle whitelist.

  • Providers return living characters whose canonical real name (CharacterInfo.name(), no masks or aliases) equals the argument, ignoring case. Several characters can share a name, so the result can hold more than one.
  • The interface method is a default returning an empty immutable list, so providers built against older TLibs keep compiling and find nobody.
  • The facade follows the existing style: main thread only, looks the provider up on every call, returns an empty list without a provider and an immutable copy of the provider's list otherwise.

Consumers that need this (VehicleFramework's typed-name whitelist) probe for it and disable the feature without TLibs 2.5.0.

Intended release: TLibs 2.5.0 (not tagged; installed locally only for the dependent builds).

Gate: tfmc-mvn -o -B clean verify, 206 tests, 0 failures, JaCoCo line gate (0 missed lines) met.

Docs: TF-Minecraft/Docs#207
Implementation: TF-Minecraft/RPCharacters#108

🤖 Generated with Claude Code

Add CharacterIdentity.findByName, a default method returning an empty
immutable list, and the matching Characters.findByName facade method.
Providers match canonical real names of living characters, ignoring
case; masks and aliases never match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the size:S 10-29 effective changed lines (tests excluded in mixed PRs). label Oct 13, 2026
@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b22d76f4-a5d2-4321-b72e-b0267be5a9af
📥 Commits

Reviewing files that changed from the base of the PR and between fe7f855 and 5f7eea0.

📒 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.

📝 Summary

Summary by CodeRabbit

  • New Features
    • Character lookup is now available by real name, with case-insensitive matching. Results can include multiple characters with the same name; masks and temporary aliases are not matched. If no character matches, or lookup is unavailable, the search returns no results.

Adds character name lookup to the identity interface and Characters utility. The lookup supports multiple real-name matches, returns an immutable list, and returns an empty list when no provider or lookup support is available.

Changes: Character name lookup

Layer / File(s) Summary
Lookup contract and facade
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 defines a default case-insensitive lookup for living characters’ real names. Characters.findByName delegates to the provider and returns an immutable copy, or an empty list when no provider is available. Tests cover delegation, multiple matches, immutable results, fallbacks, and thread restrictions.

Priority: ⬇️ Low

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

Change: Feature

Merge Risk: ⚪ Minimal · up to 5f7ee

The change adds the documented character-name lookup and reports coverage for its provider, result, and threading behavior. No actionable merge risk is identified.

- [ ] 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

Comment @coderabbitai help to get the list of available commands.

@ryanbarlow97
ryanbarlow97 merged commit 990e79c into main Oct 13, 2026
6 checks passed
@ryanbarlow97
ryanbarlow97 deleted the stage6/find-by-name branch October 13, 2026 09:53
@ryanbarlow97

Copy link
Copy Markdown
Contributor Author

Muse (independent reviewer) reviewed this PR after merge, against the stage 6a design: verdict OK. Two minor notes, neither a release risk: Characters.findByName(null) behaves differently with and without a provider (empty list or NPE; no caller passes null), and the provider's list is copied without a null guard (same as the sibling methods). Both are follow-ups for the next TLibs change; v2.5.0 stands.

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