Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce a method by which to create raw replacements. #657

Merged
merged 1 commit into from Jan 13, 2022

Conversation

mbax
Copy link
Contributor

@mbax mbax commented Dec 29, 2021

Moreso meant to start conversation, because I bet there's a better stage at which to escape, using the specific MiniMessage object and not just the default one.

Presently, only a minimessage-parsed string replacement is offered. Manually doing escapeTokens all the time gets tiring, so I hope to introduce a built-into-adventure method by which to do this. Otherwise, I'll just be creating my own simple helper method to automate.

To quote @kezz

maybe we can do a pass right at the end once all the tokens are made

image

@kezz
Copy link
Member

kezz commented Jan 1, 2022

Random thoughts: if we hold a way of identifying a raw replacement then we can do the escaping as and when the placeholders are resolved, thus solving the problem of the escaping not happening on the currently active MM instance.

@zml2008
Copy link
Member

zml2008 commented Jan 1, 2022

hm, why not return a Placeholder<Component>, and this method just delegates to Placeholder.component(name, Component.text(raw))?

@kezz
Copy link
Member

kezz commented Jan 2, 2022

hm, why not return a Placeholder<Component>, and this method just delegates to Placeholder.component(name, Component.text(raw))?

Yup, this is the solution we should be using for this! With a Javadoc that is something like Creates a placeholder that inserts a raw string, ignoring any MiniMessage tags present in the string.

@kezz kezz added this to the 4.10.0 milestone Jan 2, 2022
@mbax mbax force-pushed the gordonRamsayItsRaw.gif branch 3 times, most recently from 654c47f to 2883bd3 Compare January 9, 2022 04:54
Credits:
@zml2008 for smarter approach
@kezz for javadocs suggestion
This was referenced Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants