Skip to content

Add public name API and Fabric placeholder support#19

Open
Serendisand wants to merge 2 commits into
eclipseisoffline:mainfrom
Serendisand:main
Open

Add public name API and Fabric placeholder support#19
Serendisand wants to merge 2 commits into
eclipseisoffline:mainfrom
Serendisand:main

Conversation

@Serendisand

Copy link
Copy Markdown

This PR adds an official API for other mods to read Custom Names values, and adds optional Fabric
placeholder support through Patbox's Placeholder API.

Added public API

Other mods can now read Custom Names-managed player names through CustomNameApi, including:

  • prefix
  • nickname
  • display nickname with vanilla-name fallback
  • suffix
  • LuckPerms prefix
  • LuckPerms suffix
  • full Custom Names display name

Added Fabric placeholder support

When Patbox's Placeholder API is installed on Fabric, Custom Names now registers these player placeholders:

  • %eclipsescustomname:prefix%
  • %eclipsescustomname:nickname%
  • %eclipsescustomname:suffix%
  • %eclipsescustomname:luckperms_prefix%
  • %eclipsescustomname:luckperms_suffix%
  • %eclipsescustomname:full_name%

The Placeholder API integration is kept as a soft dependency:

  • Fabric declares it as suggests
  • Gradle uses compileOnly
  • placeholders are only registered when placeholder-api is present
  • NeoForge does not register this Fabric-specific integration

@Serendisand

Copy link
Copy Markdown
Author

#18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant