Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve message placeholder support #26

Open
GeorgH93 opened this issue Dec 6, 2021 · 0 comments
Open

Improve message placeholder support #26

GeorgH93 opened this issue Dec 6, 2021 · 0 comments
Assignees

Comments

@GeorgH93
Copy link
Owner

GeorgH93 commented Dec 6, 2021

Currently placeholders in messages are handled through String.format this approach is rather limited. Problems with the current implementation:

  • It's impossible to support RGB colors in placeholders
  • Formatting in placeholders is broken if it is split across 2 lines
  • Adding JSON in placeholders is impossible
  • String.format does not allow for format caching
  • It's possible to create broken messages way to easy
  • PAPI integration is really unsafe
  • Data for placeholders has to be retrieved, even when it's not used

The new interface should use proper placeholders instead of replaceAll.
There will be a IPlaceholderFormatter interface, that gets implemented by the user and it retrieves and formats the placeholder on demand. The placeholder resolver will be registered with the message via this method: void registerPlaceholder(String placeholderName, IPlaceholderResolver placeholderResolver)

@GeorgH93 GeorgH93 self-assigned this Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant