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

Allow for Minimessage Alternatives & Further Configuration #78

Open
MaksyKun opened this issue Aug 23, 2024 · 5 comments
Open

Allow for Minimessage Alternatives & Further Configuration #78

MaksyKun opened this issue Aug 23, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@MaksyKun
Copy link

Is your feature request related to a problem? Please describe.
The feature is not related to a real problem but rather to the lack of controllability on allowing players to use Minimessages. For example, we dont have a problem with using Minimessage Format on our server, but we cant allow for EnterMessages that can run the <click></click> features. Furthermore, our whole server infrastructure relies on Legacy color-codes.

Describe the solution you'd like
The solutions Im proposing are the following:

  • Writing a parser that allows for legacy color-codes that will just simply be parsed into Minimessage Format. The players wouldnt even see a difference between both of them.
  • Allowing for further customization of MInimessage usage by adding permissions:
    • For Example gpflags.messages.click.<click-types>
    • gpflags.messages.hex-colors, etc.

Describe alternatives you've considered
I havent found any alternative to allow legacy colorcodes with the new update, which therefore forces us to make inconsistencies in our server concept. If you allow for contribution, I am willing to implement those features and make a PR. Id be glad to allow for further customization and think that some other people might find this helpful too.

Thanks for taking your time.

@MaksyKun MaksyKun added the enhancement New feature or request label Aug 23, 2024
@akdukaan
Copy link
Owner

For the first bullet point, I know a lot of the plugins I use are slowly moving away from the legacy formatting and I could see minimessage being the new norm soon. I wouldn’t be opposed to allowing legacy colors, but I don’t want to add configuration if I don’t have to. If it’s possible to do this without configuration, I’d be happy to accept a PR for it. Would it be possible to first check if the string has minimessage codes, and if it doesn’t, then convert legacy codes into minimessage when sending? I think that allows for players to use whichever formatting they want in their flags without breaking either!

The second bullet point with minimessage permissions is definitely something that I’ve been wanting to do. Just haven’t looked into it quite enough actually implement it just yet. Would absolutely love it if you wanted to PR this!

@MaksyKun
Copy link
Author

MaksyKun commented Aug 23, 2024

Yes, thats definitely possible! I have written some methods in past to allow for both, legacy and minimessages and it gets automatically changed into minimessage-format. It checks the String directly and replaces for example &c into color:red. And Id be happy to share it.

Gonna take some time in the next weeks and get back to you once its ready. Thanks for approvement!

@MaksyKun
Copy link
Author

Are you fine with enabling java 14 language support for enhanced switch cases? Or is there any requirement for lower version due to compatibility?

@akdukaan
Copy link
Owner

Would prefer being able to support lower minecraft and java versions but if it's going to make the dev more than a tiny bit harder, I'm fine dropping it. Also, if you have a Discord, join the #gpflags-and-more channel at https://discord.com/invite/MBdsxAR so it's a little easier to chat :)

@MaksyKun
Copy link
Author

The changes are finished in the PR. Think this are not all cases at all so it definetly brings potential for future improvements if anyone might have new ideas.

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

No branches or pull requests

2 participants