Skip to content

新增文本组件工具、本地化模板和通用难度 - #13

Merged
QiuYe-QAQ merged 16 commits into
26.1from
qy/localization-component-template
Nov 25, 2026
Merged

QiuYe-QAQ merged 16 commits into
26.1from
qy/localization-component-template

Conversation

@QiuYe-QAQ

@QiuYe-QAQ QiuYe-QAQ commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

What / 目的

在 RegistrateLib 提供文本组件工具、可复用本地化模板,以及由模组定义的通用难度档位。

Implementation Details / 实现细节

  • ComponentUtils 迁入 RegistrateLib 的本地化文本包,提供字面与翻译组件构造、拼接、预览、解析及颜色样式。数字格式与调色复用 ModularMCLib-Utils 的 NumberUtils 和 ColorUtils。
  • ComponentTemplate.Line 保存 TranslationKey 和 Style。模组通过 addLocalization 声明译文,通过 build(...) 传入组件参数。
  • 模组用实现 DifficultyLevel 的枚举定义至少两个档位。DifficultyValues 根据配置的稳定 ID 选择档位,并取得该档的有类型值。
  • Gradle 从项目 Maven 目录解析原先准备的 Utils 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。

@QiuYe-QAQ
QiuYe-QAQ requested a review from a team as a code owner November 25, 2026 05:32
@github-actions github-actions Bot added 26.1 Tests: Passed Game Tests have passed on this PR labels Nov 25, 2026
@QiuYe-QAQ QiuYe-QAQ added type: feature New feature or request bundled for a 0.X.0 Update Release: Major - 0.X.0 Releases focused on Content, changes to gameplay; While maintaining mostly API stability. labels Nov 25, 2026
@QiuYe-QAQ QiuYe-QAQ changed the title 新增可复用的本地化组件模板 新增文本组件工具、本地化模板和通用难度 Nov 25, 2026
@QiuYe-QAQ
QiuYe-QAQ enabled auto-merge (squash) November 25, 2026 11:08
@QiuYe-QAQ
QiuYe-QAQ disabled auto-merge November 25, 2026 11:08
@QiuYe-QAQ
QiuYe-QAQ merged commit ea29edc into 26.1 Nov 25, 2026
4 checks passed
@QiuYe-QAQ
QiuYe-QAQ deleted the qy/localization-component-template branch November 25, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

26.1 Release: Major - 0.X.0 Releases focused on Content, changes to gameplay; While maintaining mostly API stability. Tests: Passed Game Tests have passed on this PR type: feature New feature or request bundled for a 0.X.0 Update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant