Skip to content

Improve message placeholder support #26

@GeorgH93

Description

@GeorgH93

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)

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions