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

Allow /nickcolor #facade as /nickcolor <#facade> #116

Open
funnyboy-roks opened this issue Aug 28, 2023 · 2 comments
Open

Allow /nickcolor #facade as /nickcolor <#facade> #116

funnyboy-roks opened this issue Aug 28, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@funnyboy-roks
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Soooo many people are confused about /nickcolor needing the angle brackets (<>) for the command

Describe the solution you'd like
Interpret #rrggbb as <#rrggbb> and red as <red>

Describe alternatives you've considered
The only other way that could benefit users would be to give a more helpful error message that is not just "You may only includes color codes."

Potential Implementation
Check if the argument has <> and add them if it doesn't before it's parsed, this would be a bit of a dirty implementation, but it would work well, and shouldn't break anything else.

Basically, we take this

String nickInput = String.join(" ", args);

and add

if (!nickInput.startsWith("<") && !nickInput.endsWith(">")) {
    nickInput = '<' + nickInput + '>';
}

If there is a concern about that failing, then we could put the "corrected" version in a new variable and use the old one if the colour code is detected to be wrong.

I'd be happy to open a PR with these changes, if feature is desired.

@funnyboy-roks funnyboy-roks added the enhancement New feature or request label Aug 28, 2023
@Majekdor
Copy link
Member

Love the idea!

Because of the legacy format, I think the best way of doing this would be to try to parse what they originally wrote, and if that fails then try to parse it by adding <> around it.

@funnyboy-roks
Copy link
Contributor Author

Oh yeah, I forgot about legacy 😞. Doing the original first should work, that would also catch edge cases where the player's username is a colour.

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

No branches or pull requests

2 participants