Skip to content

Convert MiniMessage hex colors to legacy ampersand format before translation#4

Draft
Chwitst187 wants to merge 1 commit into
masterfrom
codex/convert-color-formatting-to-minimessage
Draft

Convert MiniMessage hex colors to legacy ampersand format before translation#4
Chwitst187 wants to merge 1 commit into
masterfrom
codex/convert-color-formatting-to-minimessage

Conversation

@Chwitst187
Copy link
Copy Markdown
Owner

Motivation

  • messages.yml uses MiniMessage-style hex tags like <#RRGGBB> while downstream color formatters only handle legacy & codes, causing hex tags to be shown literally instead of colored.
  • Convert MiniMessage hex tags to the legacy ampersand hex form so existing formatters can render the intended colors without a larger refactor to MiniMessage/adventure everywhere.

Description

  • Added a MINI_HEX_PATTERN regex and a helper convertMiniMessageHexToLegacyAmpersand(String) that converts <#RRGGBB> into &x&R&R&G&G&B&B sequences.
  • Updated formatMessage(...) to run the conversion before calling colorFormatter.translateAlternateColorCodes('&', ...) so formatted messages render hex colors correctly.
  • Updated prefix(...) to apply the same conversion for consistent prefix rendering; changes are in plugman-core/src/main/java/core/com/rylinaux/plugman/file/messaging/MessageFormatter.java and include an import for java.util.regex.Pattern.

Testing

  • Attempted to run mvn -q -pl plugman-core,plugman-bukkit -am test -DskipTests, but the Maven run failed due to external repository resolution returning HTTP 403 from https://repo.maven.apache.org/maven2, so automated tests could not be executed in this environment.
  • No automated test failures in-project were observed because tests could not be fetched/run due to the network/repository error.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant