Repository navigation
feat: 共享 modid 注册管线并扩展 Group 配置 - #1
Merged
Merged
Conversation
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.
问题与目标
同一 modid 的多个 Core 应共同提交注册和 datagen 内容,避免独立管线处理时覆盖输出。Group 的固定配置选项也难以复用已有 Builder 能力,需要在保留现有用法的基础上开放扩展点。
改动内容
configureBlock、configureItem、configureFluid、configureBlockEntity,回调按声明顺序追加。apply*Defaults方法,保留自定义 Builder 及其父类型;支持build(factory)返回自定义 Group。兼容边界
build()保持兼容。应用顺序为 Core 默认配置、Group 内置默认配置、Group 回调、条目链配置;追加型操作仍会累计。验证结果
./gradlew test check:通过,包含 Spotless 检查。runData通过,检查生成文件确认两个 Core 的语言键共存,以及 Group 语言前缀、自定义中文翻译和方块掉落正确。git diff --check:通过。GameTest 和 datagen 验证使用临时 Gradle init 脚本向构建目录补齐测试模组元数据,datagen 输出到
/tmp;未修改项目运行配置。