Skip to content

Conversation

@TureBentzin
Copy link

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.

@TureBentzin TureBentzin marked this pull request as draft April 8, 2025 14:50
public class TextUtil {
private static final MiniMessage MINI_MESSAGE = MiniMessage.miniMessage();

private static boolean miniplaceholders = false;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did this to make it fit your codestyle in PlaceholderUtil.java.

I would suggest introducing static booleans like this to HooksManager.java instead

@TureBentzin TureBentzin marked this pull request as ready for review April 8, 2025 14:54
@zetastormy zetastormy added the enhancement New feature or request label May 15, 2025
@zetastormy
Copy link
Collaborator

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!

@TureBentzin
Copy link
Author

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.

@TureBentzin
Copy link
Author

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.

@zetastormy
Copy link
Collaborator

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!

@zetastormy zetastormy added this to the 1.10.0 milestone Jul 29, 2025
@TureBentzin TureBentzin marked this pull request as draft July 30, 2025 18:32
@TureBentzin
Copy link
Author

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.

@zetastormy
Copy link
Collaborator

Thank you! And you're right, I should probably use TagResolvers for that.

@TureBentzin TureBentzin marked this pull request as ready for review August 17, 2025 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants