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

Alternative Color for RGB Text for Clients Below 1.16 #344

Closed
ghost opened this issue May 8, 2021 · 5 comments
Closed

Alternative Color for RGB Text for Clients Below 1.16 #344

ghost opened this issue May 8, 2021 · 5 comments
Labels
Milestone

Comments

@ghost
Copy link

ghost commented May 8, 2021

RGB color doesn't display for clients below 1.16. It would be nice to have the ability to select an alternative old-school color code (&0 to &f) that will display in place of RGB text or gradients for older clients.

If no alternative color code was provided, we could calculate the closest color. Other plugins already do this.

Currently if older clients ping the server, they see "random" colors. (It probably renders the first 4 bits of the RGB color code.)

Possible syntax would be: #00AAAA3 - 3 represents the &3 code (which in this case is exactly the same as the hex code before, but this is just an example).

@stephan-gh
Copy link
Member

Hmm yeah I see how that could be useful, but not sure this is very simple to implement with the current code :/

@stephan-gh
Copy link
Member

stephan-gh commented May 8, 2021

I think something that might work is to provide an option to remove all RGB colors for clients < 1.16.

You could then put another color immediately before the RGB color code, that would be preserved and therefore show on older clients. On newer clients, the old color will be replaced with the RGB color immediately after. e.g. something like

  Description:
  - |-
    &a&#45bf55A Minecraft &9&#0288d1Server.
    &e%gradient#ffbe00#f4511e%Now with RGB colors. Nice!%gradient%

Calculating closest color could also work but not sure I want the complexity of that given that it will look totally terrible for gradients anyway. I'd rather remove the RGB colors then and provide options to set a different color instead.

Does that sound good too?

Edit: Fixed various typos since I'm too stupid to write properly :)

@stephan-gh stephan-gh added this to the 3.5.0 milestone May 8, 2021
@ghost
Copy link
Author

ghost commented May 8, 2021

Yeah, that would be good I guess.

Or, another option that I thought of is to maybe have a completely different description for older clients? I don't think that should be hard to implement given that there are already personalized messages.

But maybe I can take a look at it and make a pull request if I have achieved something.

@stephan-gh
Copy link
Member

Or, another option that I thought of is to maybe have a completely different description for older clients? I don't think that should be hard to implement given that there are already personalized messages.

Yes, I thought about it too. If I had ever finished SLP 4.0 you would already be able to do this using "triggers" (see my explanation at #338 (comment)). Unfortunately, in SLP 3.0 the available profiles are hardcoded and adding new ones is not very trivial (and kind of messy). :(

@stephan-gh
Copy link
Member

stephan-gh commented May 10, 2021

@Epharal1 If you would like to contribute a way to have a completely separate MOTD etc for outdated clients I think it would be best to keep it generic (independent of RGB) and just call it Outdated (next to Default, Personalized and Banned). It would trigger whenever some outdated client pings the server, no matter if it supports RGB or not. You can see how Banned was added in #99, the changes you'd need to do for that would be similar.

With the Outdated profile, you could either decide to keep it without RGB for all clients, or combine it with what I mentioned above (stripping all RGB colors for clients that don't support it). I think I will add that anyway since it's relatively simple (although it requires messing a bit with replacers and regular expressions).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant