kangarko / ChatControl-Red

Issue tracker and documentation for the next generation ChatControl Red, the most advanced chat management plugin.
43 stars 22 forks source link

Suggestion: Add MiniMessage support #1839

Open ElBananaa opened 2 years ago

ElBananaa commented 2 years ago

As multiple users already suggested multiple times (directly or indirectly, see #1676, #967, #246 and a lot of other issues) to add support for Adventure, I thought it would be a good idea to suggest it once again so this could be added to the roadmap.

As a quick reminder, Adventure is basically a all-in-one library for everything that's user interface related. It can be used for your bossbars, chat text components, sounds, titles, books etc..

1. How it would benefit others? (Not just you, but 1,000s of others people using the same plugin.)

Adventure would allow users to use generic formats for their messages (which makes the plugin way more user-friendly).

While implementing adventure represents a certain amount of work at first, it'll greatly facilitate further work with anything that's user interface related. This also means that implementing features such as #384, #1476, #1777, #282 will be easier.

The library isn't only written better than spigot & bungee ones, but is also cross-platform and natively supported by Sponge, Velocity, Paper (and its forks) and Minestorm. It also is open-source and modern, offers better performances and is backward-compatible (from mc 1.7.10 to 1.18.2, which actually isn't an issue since, according to bstats, absolutely no one uses the plugin on servers below 1.8.8)

2. What would happen if we won't implement this feature? How's your server being affected?

You can find more informations about everything I said above on their docs https://docs.adventure.kyori.net/getting-started.html

pupshadow commented 2 years ago

This would be an amazing addition if it was to be implemented into the plugin.

kangarko commented 2 years ago

Thanks, I'll put this into my backlog. So specifically Adventure would make it easier for us to add chat gradients? Any other specific features?

Right now I don't have time for this, I am sorry.

PS: We do have people using us on Minecraft 1.2.5-1.7 however it just won't show up on bstats, or they can opt out of reporting.

ElBananaa commented 2 years ago

Thanks, I'll put this into my backlog. So specifically Adventure would make it easier for us to add chat gradients? Any other specific features?

Right now I don't have time for this, I am sorry.

PS: We do have people using us on Minecraft 1.2.5-1.7 however it just won't show up on bstats, or they can opt out of reporting.

From what I understood, Adventure is basically a all-in-one library which can be used for a lot of different usages. So yes, as one of the examples, using it would make it easier for you to implement gradients in chat, to create new guis, to work with chat components. Once again, I'd suggest taking a look at their docs to see how it works as it'll give you a better idea of what could be done with it, and how. But one of the most important things I noticed from what other devs said is that Adventure is really structured and better written than md5's libraries.

The library actually comes with a huge list of pros compared to other apis, which is why developers are switching to it.

I'll try to find more infos later so you can have a better idea of how great the library is.

kangarko commented 2 years ago

Thanks, we actually have our own SimpleComponent class and trying not to use md_5's components, as well as having our own ChatColor implementation. Seems like that's too much/unneeded work for now, I'll return to this when I have more time :)

arima0k commented 1 year ago

I would highly recommend working on this as with MiniMessage you can easily format color, RGB and other stuff and is widely supported.

MrCrazys commented 1 year ago

I'd like to see CMI's hex colour/gradient format to be supported. More specifically, I suppose it would be CMILib's hex colour format. I would love to be able to use it in various parts of the plugin, such as in the chat, formats, etc.

TomLewis commented 1 year ago

Please also consider https://mf.mattstudios.me/triumph-gui/introduction for GUIS, I think this also has adventure support seeing it from https://docs.adventure.kyori.net/community-libraries.html

Never used it, just found it today when searching the triumph docs. Then we can add all the GUI organisation!

kangarko commented 1 year ago

We already use Foundation GUI system for years and it works just fine, I see no reason rewriting.

envizar commented 4 months ago

the lack of minimessage support is the main disadvantage of CHC at the moment

kangarko commented 4 months ago

Can you give example of a competitor plugin where this is implemented? How would you like this to work? Happy to reconsider and add it if it makes sense to our existing chat format

envizar commented 4 months ago

Can you give example of a competitor plugin where this is implemented? How would you like this to work? Happy to reconsider and add it if it makes sense to our existing chat format

https://forums.papermc.io/threads/chatformatter-✅-minimessages-✅-template-system-✅-placeholders-✅-vault-support.315/ It's very simple plugin, but MiniMessage support is one of its main features So... MiniMessage support can be very serious advantage over other chat plugins

kangarko commented 4 months ago

Please describe specifically how this would be working in the chat/formats, thanks

envizar commented 4 months ago

Please describe specifically how this would be working in the chat/formats, thanks

# If true, each section in Parts will begin on a new line automatically.
# See https://github.com/kangarko/ChatControl-Red/issues/2510
New_Line_Per_Part: false

# If true, you won't be able to use & colors
# See https://docs.advntr.dev/minimessage/format.html
UseMiniMessage: true

# The parts of this format.
Parts:
  message:
    Message: '<gradient:#FF0000:#00FF00>{player_nick}</gradient><gray>: <font:alt>{message}'
kangarko commented 3 months ago

Thanks. Got It now. Due to lack of time I have to put it on hold for a few weeks, mind pinging me at the end of March? Thanks.

envizar commented 3 months ago

mind pinging me at the end of March?

@kangarko

kangarko commented 3 months ago

Thanks for the ping tho. I will be adding minimessage support soon.

CodingWithAnxiety commented 4 weeks ago

Bump this- ^^^ Minimessage would be an abolute godsend for us server owners

kangarko commented 3 weeks ago

I am hesitant since it would add more mess to the codebase. I rather use Audience 100% of the time. I havent got to it yet but it seems doable as they have 1.7.10+ compatibility.

CodingWithAnxiety commented 3 weeks ago

It would be a breaking change for configs. I'd still love to see CC-Red get MM support- even if that means legacy servers might be incapable of using it.

kangarko commented 3 weeks ago

Can't afford cutting out legacy servers. Matter fact we did a survey last week, over 250 people have responded what plugin they need. And one of the things many agreed on was 1.8.8 compatibility.

Adventure supports 1.7.10+ tho. ChatControl supports even older than that. I am fine cutting <1.6.4. So it's doable. I just need to dedicate a ton of time rewriting the core to require Adventure.

I love clean solutions and slapping MM on top of what we have would just waste so much performance it made me sick. I want chatcontrol to be the fastest performing plugin and we are not achieving that goal sadly.

I'll be sitting down and getting present with this this summer.

TomLewis commented 3 weeks ago

I prefer stability and performance over anything, so I agree its worth the time and effort to do it right.

I just want <center> haha

CodingWithAnxiety commented 3 weeks ago

^^ Agreed, stability & performance comes first.

Just a thought, Maybe another survey would be in order? Normally, I'd be okay with saying, "Let's ditch <1.6," but that feels extremely unfair- especially for a plugin as large as CC. I'd like to see what people think about supporting versions that old. At the end of the day though, Plugins will eventually have to stop supporting legacy minecraft versions[^1], and plugin developers shouldn't feel guilty about dropping those versions.

[^1]: I'm not saying to ditch 1.8.8 in this reference, however I am using this post as a good example of my point.

kangarko commented 3 weeks ago

Actually, do you know how much it took to support 1.4.7-1.6.4? Less than a few hours. I believe developers are just unwilling or don't know how. To me it's just sad that 4-6 lines of extra code that would make a plugin work on an entire version of the game are not being added by developers. We see this with Windows 7.

We managed to backport ALL of modern Paper/Spigot features to Foundation and make them work on decades old versions.

The real issues started at around 1.2.5 where the chat event is different and a lot of APIs are missing but we even managed that with relative ease. Technic Classic customers use 1.2.5.

I would say all Bukkit plugins as they stand today can easily be made compatible with versions down to 1.1 (anything older has a different event manager).

But if I ditch the core and use Adventure, we become 1.7.10+ exclusive.

Actually and counterintuitively, the easiest way would be to write my own Adventure-like alternative. It's simpler than it looks. The entire chat component setup in MC can be made in one class which even ChatGPT manages to rewrite.

I am just blocked by other tasks as life is very different now that I am 26 not 14 and there are tons of edge cases we need to test properly.