akdukaan / GPFlags

GriefPreventionFlags is a Minecraft plugin to allow players to customize their GriefPrevention claims with claimflags.
GNU General Public License v3.0
17 stars 20 forks source link

Allow for Minimessage Alternatives & Further Configuration #78

Open MaksyKun opened 3 weeks ago

MaksyKun commented 3 weeks ago

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:

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.

akdukaan commented 3 weeks ago

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 commented 3 weeks ago

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 . 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 commented 3 weeks ago

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 commented 3 weeks ago

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 commented 2 weeks ago

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.