Adding MP support to TextUtil
With this PR I suggest adding basic MiniPlaceholder support to TextUtil. I implemented this trying to hopefully fit with your codestyle.
Feel free to request changes.
Hi, sorry for reviewing it this late. I was going through the changes, which I think are well implemented, but I'd like to understand the reason behind this change.
As far as I can tell, we already use PlaceholderUtil wherever placeholders can be applied, so I’m curious about what this change improves or solves, as TextUtil is only used when placeholders shouldn't be applied.
Thanks in advance!
I finally had time to come back to this project and take a brief look at the PR again.
As I already wrote in the title, this PR introduces Miniplaceholders (https://github.com/MiniPlaceholders/MiniPlaceholders) support to Akropolis.
This allows all Akropolis messages (messages.yml) to contain MiniPlaceholder placeholders. Specifically, all text that runs through the
public static Component parse(String message) {..}
and
public static Component parse(String message, TagResolver resolver) {..}
methods in TextUtil.java, where your MiniMessage deserialization happens, may now contain placeholders.
Due to the time that has passed since I opend this PR, I would be willing to rebase this PR so it is based on your newest version instead of the old one. That would also allow changing the commit messages to fit your spec.
I understand now, I didn't notice previously that the messages from messages.yml didn't have any kind of placeholder replaced. If you have the time to rebase this PR, I would be grateful. Thank you!
I did the rebase earlier today. You changed the behavior of the replacements in commit a8a5b74 to use string replacements instead of converting between components and text. I propose using standard MiniMessage TagResolvers for this, because that is exactly what they are designed for.
I have marked this PR as a draft for now. As soon as I find time to test the changes, I will mark it as ready for review.
Thank you! And you're right, I should probably use TagResolvers for that.