-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Labels
Description
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)