Repository navigation
新增文本组件工具、本地化模板和通用难度 - #13
Merged
Merged
Conversation
QiuYe-QAQ
enabled auto-merge (squash)
November 25, 2026 11:08
QiuYe-QAQ
disabled auto-merge
November 25, 2026 11:08
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.
What / 目的
在 RegistrateLib 提供文本组件工具、可复用本地化模板,以及由模组定义的通用难度档位。
Implementation Details / 实现细节
ComponentUtils迁入 RegistrateLib 的本地化文本包,提供字面与翻译组件构造、拼接、预览、解析及颜色样式。数字格式与调色复用 ModularMCLib-Utils 的NumberUtils和ColorUtils。ComponentTemplate.Line保存TranslationKey和Style。模组通过addLocalization声明译文,通过build(...)传入组件参数。DifficultyLevel的枚举定义至少两个档位。DifficultyValues根据配置的稳定 ID 选择档位,并取得该档的有类型值。0.1.0,用 JarJar 随 RegistrateLib 提供运行时依赖。Outcome / 结果
模板初版通过 Gradle 构建、6 个 GameTest 和英文及简中 DataGen。随后模板行简化通过 Gradle 构建。本轮新增的文本工具、依赖接入和难度 API 按要求跳过本地构建和测试。
Potential Compatibility Issues / 潜在兼容性问题
新增文本工具的调用方使用
com.modularmc.registrate.localization.text.ComponentUtils。依赖版本针对 Minecraft 26.1.2。