Skip to content

fix: keep v1 colour codes out of the import report and unify the no-homes notice - #52

Merged
milanmalhotra merged 1 commit into
devfrom
issue-49-import-report-colour-codes
Aug 17, 2026
Merged

fix: keep v1 colour codes out of the import report and unify the no-homes notice#52
milanmalhotra merged 1 commit into
devfrom
issue-49-import-report-colour-codes

Conversation

@milanmalhotra

Copy link
Copy Markdown
Collaborator

Closes #49

Problem

/import-homes sethomes echoed v1 message settings into chat verbatim. v1's own defaults carry section-sign colour codes, so §4 turned the rest of the advice line red (and §k would scramble it), making a successful import report look like it half failed.

Separately, the "you have no homes yet" notice was sent as info from /homes, as a red error from the homes menu, and with a third wording from /list-homes.

Change

  • The two v1 message notes go through messageNote(), which shows ChatColor.COLOR_CHAR as &, prints the value once, and appends "(colour codes shown as &; copy the original from plugins/SetHomes/config.yml to keep them)" only when a code was actually present. The exact original stays recoverable from v1's own file.
  • The tp-cooldown note says "no v2 equivalent" rather than "no Set Homes Two equivalent".
  • One wording and one severity for the no-homes notice: all three call sites read the noHomes config key with UserInfo.NO_HOMES as the default and send it as info. UserError.NO_HOMES is removed, and /list-homes no longer adds a second usage line.

Tests

mvn test: 371 tests, 0 failures, 0 skipped (was 367). New: a §4/§k fixture produces no § in any note and shows &4/&k; a coded message names plugins/SetHomes/config.yml; a plain message is shown as-is with no caveat; /homes, the menu and /list-homes all send the notice without ChatColor.RED, and /list-homes sends exactly one line. Both guards in messageNote() were broken and restored to confirm the tests catch them.

@milanmalhotra
milanmalhotra merged commit 5a9b701 into dev Aug 17, 2026
3 checks passed
@milanmalhotra
milanmalhotra deleted the issue-49-import-report-colour-codes branch August 17, 2026 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant