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

Hex Color Fix #4529

Merged
merged 3 commits into from
Feb 25, 2022
Merged

Hex Color Fix #4529

merged 3 commits into from
Feb 25, 2022

Conversation

Sorbon-CH
Copy link
Contributor

Description

With the latest update, Hex colors couldnt be used within containers like variables, or functions.
Idk why tho. But this fixes it 🎉


Target Minecraft Versions: 1.16+
Requirements: Skript
Related Issues: #4527

@TPGamesNL
Copy link
Member

Caused by #3908. That PR has an issue, usages of ChatColor#parseHexColor expect the input to optionally start with a #, for example:

boolean tryHex = Utils.HEX_SUPPORTED && color == 'x';
ChatColor chatColor = null;
if (tryHex && i + 14 < chars.length) { // Try to parse hex "&x&1&2&3&4&5&6"
chatColor = Utils.parseHexColor(msg.substring(i + 2, i + 14).replace("&", "").replace("§", ""));

But the regex check doesn't account for this, this fix makes it so it does.

@TPGamesNL TPGamesNL added the bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. label Jan 26, 2022
@TPGamesNL TPGamesNL merged commit d051fca into SkriptLang:master Feb 25, 2022
TPGamesNL pushed a commit to TPGamesNL/Skript that referenced this pull request Mar 8, 2022
(cherry picked from commit d051fca)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants