Closed Andre601 closed 2 years ago
Decided to switch to a String list instead of having that many boolean options. This means the new format would be something similar to this:
example:
!color_animation
colors: ['#abcdef', '#123456']
formats: ['BOLD', 'ITALIC']
distance: 5
speed: 1
This seems good overall. I'd prefer not to use the TextColor class for the format codes, since it has been created specifically to handle colors.
What alternative would you recommend? String seems nice, tho I feel like it would be weird?
Also, if we would go with that, what would be the best approach to handle possible cases like "BOLD, ITALIC"
and BOLD,ITALIC
?
Additionally, where should I put the finding/handling of the formatting codes if not in the TextColor? Making a separate class just for this seems overkill to me.
I'd be in favor of a separate class, if it is needed. Most libraries and also minecraft itself have moved to separating colors and format.
I pushed a change that uses String now.
Also added a sanitizeFormats(String format)
method that will make sure the String is valid formatting codes and not random garbage text.
Code was taken from a previous PlaceholderAPI version (Was used there for color formatting)
Please, please, PLEASE give feedback on this! I'm not sure if I understand the system good enough to have made the best option available here...
The goal is to add boolean options to enable individual formatting options to a
!color_animation
If everything works as I assume, should this now allow a placeholder like this: