Add support for RGB colours in region greeting and farewell messages
OllieMartin opened this issue · 3 comments
Is your feature request related to a problem? Please describe.
When trying to use the new RGB colour codes in greeting / region leave messages they do not work. This is because the &x code is not being translated to §x in order to support the spigot default format of §x§a§b§c§d§e§f for RGB codes. In order to use these codes you have to go directly into WorldGuards regions files and edit the message manually to include the §x code which means that only staff members with access to the server host can use these codes which is not ideal at all.
Describe the solution you'd like
WorldGuard should translate the &x code to §x to provide support for RGB colour codes.
I am aware of many other formats for RGB codes such as &#abcdef and &xabcdef as well as the Spigot standard &x&a&b&c&d&e&f, but at the very least support for the spigot standard should be implemented as this requires very little to be changed in the code for WorldGuard. Only translating the &x character to §x when using the flag commands (and anywhere else you wish to add support.)
Ideally support should be added for the other methods too (perhaps later down the line) so that staff members can more easily use codes in region welcome / leave messages without having to deal with the verbose &x&a&b&c&d&e&f format every time they need to type a code. That is why many other plugins have already adopted the &#abcdef format.
Describe alternatives you've considered
The only alternatives currently are to manually edit the worldguard region files to swap the &x to §x as this is not being done by your chat serializers. This means that nearly all staff are unable to use these RGB codes as they do not have console access. Another alternative would be to find a way to insert raw § codes into chat, but this is not supported by Minecraft.
Additional context
Minecraft v1.16 added support for RGB codes as well as their standard 16 colour code system using the popular &1, &2, ... &f system. Your text serializers correctly translate all these old codes &1 -> §1, &2 -> §2 and so on. But because &x is a new code, there is not yet support for this.
Many other plugins now provide support for a variety of methods for using these hex RGB codes. EssentialsChat uses &#abcdef, and I am the developer of MultiChat which supports all formats &xabcdef, &#abcdef and &x&a&b&c&d&e&f.
Thank you for your time, if you need any more information please let me know.
May be at least is a good idea to allow how spigot handles RGB color codes in existing entry/exit flags and don't deprecate them. We don't need complex messages for some small things.
But MiniMessage also sounds like a great idea and you should do that.
But this issue is open for 3 years now and no support was provided...
Yes, this feature is currently not implemented and it's an open todo.
I personally don't like the spigot implementation, because there is no way to add some stuff like hovers, click events and other things to the messages. And other implementations from the color format are more confusing and don't help at any needed changes in the future.
The idea from wizjany and me is:
- add a new flag type (don't use StringFlag for message related things)
- Use https://github.com/KyoriPowered/adventure-text-minimessage for the message translation
With MiniMessage it should be possible to add hover and click events on the text. But that's some bigger rework.
With 3a9b1b1 wiz added a deprecation warning for the flags but the final rework does need some time. Feel free to make a pr for that.