PrisonTeam / Prison

The home of the Prison project, a Minecraft plugin to provide mining and ranking gameplay experience.
https://www.spigotmc.org/resources/prison.1223/
Other
127 stars 50 forks source link

Hex Color Codes don't work #206

Closed EpicPuppy613 closed 3 years ago

EpicPuppy613 commented 3 years ago

Which module are you submitting this issue for?

Ranks

Describe the issue you are experiencing.

Hex color codes don't get saved properly in the database

Describe the steps to reproduce the problem.

Create a rank with a tag that includes a hex color code

Anything else we need to know?

Hex color code example: &7[#f38caaE&7] Renders as [E]

EpicPuppy613 commented 3 years ago

Hex color codes is a new feature in 1.16 that allows you to color text in chat with a hex code rather than the standard 16 minecraft colors, does not seem to work in chat or in the scoreboard, but for some reason, it works for the confirmation message when changing the tag or creating a new rank

EDIT: also doesn't show in the rank list, but it does show when clicking on the rank for more info

EpicPuppy613 commented 3 years ago

Problem fixed: spigot hex codes format &x&R&R&G&G&B&B

EpicPuppy613 commented 3 years ago

Hex colors don't render properly in the ranks list

rbluer commented 3 years ago

Prison tries to support spigot versions 1.8 through 1.16.5, therefore it may not always behave correctly for all versions of spigot. It may work fine for 1.16.5, but expect possible artifacts for anything before 1.16.x.

I honestly cannot say that &x&R&R&G&G&B&B is a fix. It is not. It is horrible for you to have to enter such horrid mess as that. That to me is not a valid hex color code.

To fix that problems, within prison you can use standard hex color code notation such as #RRGGBB. That is far more intuitive and follows the standard output from most hex color tools. Prison's support for hex colors is mostly through placeholders and is automatic. Most other commands may support hex colors because thy all go through the same text parsers.

Prison also supports rendering hex color codes through it's placeholders for other plugins that do not directly support hex colors using placeholder annotations. There are two kinds of conversion techniques that are used to help ensure the greatest amount of flexibility.

Here are two examples where prison is providing a compatibility conversion for a plugin that does not support hex colors directly:

{prison_mines_size_temp5::nFormat:'#af33ff'#,##0.00:1:kmg:hex} {prison_mines_size_temp5::nFormat:'#af33ff'#,##0.00:1:kmg:hex2}

For more information on placeholders, see our documentation:

https://prisonteam.github.io/Prison/prison_docs_310_guide_placeholders.html

So as you can see, since prison does support real hex codes, I'm closing this as will not fix because nothing is broken, and also because prison does support real hex color codes such as #af8cff.

The fact that you tried to use a hex code and it did not work, may be more of a symptom of the tool that is using the placeholders do not support it directly. This was tested on plugins that supported hex colors directly and ones that did not support it, but they did work when using the placeholder attributes hex and hex2 converters.

rbluer commented 3 years ago

If you need to talk about this, such as to work out better solutions to your issues, please visit our discord server for better support than what can be provided through these kind of messages. Thanks! Blue