Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Legacy support & Minimessage configuration options #80
Legacy support & Minimessage configuration options #80
Changes from 6 commits
582b093
de1e5ad
07a5bd0
4996190
524dd31
a8036a0
fc1aee6
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if there are two of the same links in the message? This'll only convert the first one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not anymore, same iteration as everywhere until there is no link available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't tell what this variable is trying to do in this one. If I don't have permission for a click action I tried to use, it removes my click component, but leaves all the other click components in the message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem was, when you find something in the pattern, but have the permission to use it, there is no need for change. But if there is no need for change, the while loop will keep iterating over and over until the server runs out of memory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But we could make the permission check before the actually pattern initialization. However it could become annoying with the click and hover components. What do you think about this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think it makes sense for perm check before pattern initialization. What makes it annoying with click and hover components? That there are multiple types of them? Thats fine, just split it up more
As you see in my example above, I also chose to escape out the tag rather than repalcing it with "".
I think if you choose to replace it with "", it could result in some cases where for example <re<blue>d> would turn into <red> which we want to avoid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dont get this, Im sorry.
Do you want to put a
\
before the hover:.... stuff? I think this would still setup the component itself. Also, we are having a while loop that repeats until there is no component left. So i think thats not bad at all atm.All i could imagine to reduce iteration time:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that's exactly what Im saying. You can use the minimessage viewer at https://webui.advntr.dev/ to see that this does make the tag show without it serving as a tag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, don't worry much about reducing iteration time here. This won't get called so often to where it's too big a consideration so I'd much rather it be easy to read and maintain. I still think three individual loops for the hover would be the best, and similar for the other parts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If someone's using <# not as a tag, we wouldn't really want to convert this. Cant really imagine someone would do that but it's short enough a string to where I could see it coming up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minimessage tags are case insensitive so this wont catch stuff that are like <BOLD> or <bOLD>