Render the territory map in a monospaced font - #23
Merged
Conversation
Chat's default font is proportional, so a grid of mixed glyphs came out ragged — how far a row reached across the screen depended on which chunks happened to be claimed, which is the opposite of what a map is for. The rows now go out as components in minecraft:uniform, Minecraft's built-in fixed-width font, so the columns line up. Only the rows change font; the title and legend stay in the normal chat font. The row locale key is still used — getTranslationAsComponent() resolves the legacy colour codes, and the font is set on the result.
|
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Follow-up to #22, which merged a few minutes before this commit was pushed — so this fix missed the boat rather than being a new change of direction.
Chat's default font is proportional, so the territory grid came out ragged: how far a row reached across the screen depended on which chunks happened to be claimed, which is the opposite of what a map is for.
The map rows now go out as components in
minecraft:uniform, Minecraft's built-in fixed-width font. Only the rows change font — the title and legend stay in the normal chat font.The row locale key is still used and still translatable:
getTranslationAsComponent()resolves the legacy&codes viaparseMiniMessageOrLegacy, and the font is set on the resulting component.IslandChunksCommandTestreads the rows back out of the captured component and asserts the font is set, so this cannot be quietly reverted to a plain string without a test failing.Verified in game on Paper 26.2:
■ ▣ □ ◎ ◉ ◆all render single-width in unifont, so the grid comes out square.🤖 Generated with Claude Code
https://claude.ai/code/session_017EZEwab2kL4i1FNnBYvSmp