fix: 修复语言重载与聊天颜色边界#718
Open
zhibeigg wants to merge 1 commit into
Open
Conversation
11 tasks
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.
原有问题
语言重载、JSON 语言节点和颜色解析在边界输入下会丢失结构或保留旧状态:
TypeJson的translate:指令分支不可达,嵌套对象、数组和 hover 列表在转换时可能被扁平化或改变类型。典型触发场景与后果
#000000、带前导零的 RGB、可变宽度分量或非法颜色表达式:黑色被误判、颜色值截断,或原始文本丢失。本 PR 修改
TypeJson的translate:解析顺序,并保留嵌套对象、数组和 hover 列表的原始结构类型。Locale当前没有 Issue 所述 Unicode/CJK 分类逻辑,因此未新增无调用方 API。修改目的
保证语言内容在复杂 JSON、连续重载和并发读取场景下保持结构完整与状态一致,同时让颜色边界输入可预测且不会破坏用户原文。
兼容性与行为变化
验证
./gradlew :module:minecraft:minecraft-chat:test :module:minecraft:minecraft-i18n:test --rerun-tasks --no-parallel./gradlew :module:minecraft:minecraft-chat:build :module:minecraft:minecraft-i18n:build --rerun-tasks --no-parallelgit diff --check(仅 Windows LF→CRLF 提示)Refs #703