Repository navigation
Port math lib and registrum alias api to 1.21.8 移植数学库和注册库别名API到1.21.8 - #129
Conversation
Cherry-pick of 7285ae1 (Add math lib 添加数学库 (Anvil-Dev#122)) adapted to 1.21.8: - ResourceLocation instead of Identifier - test wiring for the 1.21.8 module.gradle layout
Cherry-pick of 892ef23 (Add alias api for Registrum 向Registrum加入别名API (Anvil-Dev#128)) adapted to this version.
Reason: script execution via -e/-c flag Reply |
代码审查摘要 — PR #129操作: opened(webhook 自动审查) 审查方法:本地克隆 🔍 移植保真度(本 PR 的核心,逐文件核对)
✅ 1.21.8 API 适配逐项核实(非猜测,均有字节码/mappings 依据)
|
| 声称 | 状态 | 证据 |
|---|---|---|
| port math lib to 1.21.8 | ✅ | module.math 37 文件 + settings/modules.json/module.main 胶水;CI build-l2 (math) success |
| port registrum alias api 到 1.21.8 | ✅ | 5 文件加行与 #128 一致;CI build-l2 (registrum) success |
| "ResourceLocation instead of Identifier" | 改名本身✅且无残留;但来源应是 dev/26.1 而非 1.21.1 的 7285ae13(见 |
|
| (隐含)#128 的 EntityBuilder 段 | ✅ 正当省略 | dev/1.21.8 无 spawnEgg(),派生 _spawn_egg 不存在 |
结论: APPROVE — 无阻塞问题,且 CI 已双绿(math/registrum build 含单测)。合并前建议顺手处理
🧪 测试建议
| 被测目标 | 推荐测试场景 | 优先级 |
|---|---|---|
AbstractRegistrum#addAlias/applyAliases |
旧名仍注册→忽略并 warn;同一旧名指向不同新名→error 且不覆盖;resolve 已指向新名→跳过不重复 addAlias(当前全仓无任何测试,源 #128 也没带) |
🟡 |
BlockBuilder/FluidBuilder#addAliases |
派生条目(block item / block entity type / fluid type / fluid block / bucket)仅在实际创建时才别名;item()(无参)与 simpleBlockEntity() 必须也置位(已核实二者内部委托带标志的重载) |
🟡 |
MathTestBootstrap#registerFunction |
同名重复注册走 bindValue 改绑后,registry.get(key).value() 是新函数、且注册表内不出现重复条目;bindValue 反射失败路径的异常信息 |
🟢 |
关于 PR 标题:本轮
gh auth status显示/opt/data/home/.config/gh/hosts.yml中 token invalid,按约定未自动修改。建议标题:Port math lib and Registrum alias API to 1.21.8 移植数学库与 Registrum 别名 API 到 1.21.8
由 Hermes Agent 审查
|
💾 Self-improvement review: Patched SKILL.md in skill 'reverse-port-pr-review' (1 replacement). · Patched SKILL.md in skill 'offline-pr-evidence-verification' (1 replacement). |
🌿 Roseau API Breaking Change Report
|
The module build script used jarJar(implementation project(...)) for util, while every other module in this branch uses jarJar(api project(...)). The math API exposes util types (IFunction.Type extends dev.anvilcraft.lib.v2.util.ISerializer), so a downstream project depending on math alone could not see them at compile time. The test comments describing MappedRegistry and RegistryLookup named 26.1 even though the behaviour is the same here; they now name this version.
The Math entries added in the port were missing from README.en.md. Both are packaged into the jar, so English readers had no math coordinates.
代码审查摘要 — PR #129(第 2 轮 · synchronize 复查)操作: synchronize diff 完整性: 本轮增量(2 个提交):
✅ 上一轮问题销账
🔴/
|
| 声称 | 状态 | 证据 |
|---|---|---|
| port math lib to 1.21.8 | ✅ | module.math 37 文件(与源 37/37 对齐)+ 四处接线;Identifier 残留 0 |
| port Registrum alias API 到 1.21.8 | 5 文件加行与源 #128 一致;但存在跨实例守卫缺口(见 |
|
| 「Cherry-pick of 7285ae1 (#122) … ResourceLocation instead of Identifier」 | 改名本身 ✅;7285ae13 确在 dev/1.21.1(#122 merge commit),而内容与 dev/26.1 近乎逐字一致 → 源码引用与内容不一致 |
|
隐含:#128 的 EntityBuilder.java 段 |
✅ 正当省略 | dev/1.21.8 的 EntityBuilder 无 spawnEgg(...),派生 _spawn_egg 条目在本分支不存在 |
| 新 commit「export util to consumers」 | ✅ | jarJar(api project(...)),且 IFunction.Type extends util.ISerializer 的公开 API 面确实透出 util |
| 新 commit「correct version comments」 | ✅ | module.math 内 26.1 命中 0 |
结论: COMMENT(不建议阻塞,但建议修 .gitignore、Builder 接口兼容性、零测试)。请等本 head CI 跑完再合并(mergeable_state: unstable)。
🧪 测试建议
| 被测目标 | 推荐测试场景 | 优先级 |
|---|---|---|
AbstractRegistrum#applyAliases |
①老名仍注册→忽略并 warn;②新名未注册→忽略;③resolve(old)==new→跳过不重复 addAlias;④跨实例同名不同目标→当前放行且 NeoForge 抛 IllegalStateException(复现 |
🔴 |
FluidBuilder#addAliases |
flowing_ 前缀 / 源流体 / FLUID_TYPES / 方块 / 桶五条派生名是否与实际注册名一一对应;registerType=false 与 noBlock()/noBucket() 时是否正确跳过 |
🟡 |
BlockBuilder#addAliases |
item() 无参、simpleBlockEntity() 便捷入口是否同样置位并别名 ITEM/BLOCK_ENTITY_TYPE |
🟡 |
MathTestBootstrap#registerFunction |
同名重复注册经 bindValue 改绑后 registry.get(key).value() 为新函数且注册表内无重复条目(该 workaround 已核实为必要) |
🟢 |
关于 PR 标题:
gh auth status显示/opt/data/home/.config/gh/hosts.yml的 token invalid(退出码仍为 0,但文本明确失败),按约定未自动修改。建议标题:Port Math lib and Registrum alias API to 1.21.8 移植数学库与 Registrum 别名 API 到 1.21.8(仅大小写规范化,语义无变化)。
由 Hermes Agent 审查
|
💾 Self-improvement review: Patched SKILL.md in skill 'reverse-port-pr-review' (1 replacement). · Patched references/registry-alias-api-and-rename-migration.md in skill 'reverse-port-pr-review' (1 replacement). |
🌿 Roseau API Breaking Change Report
|
|
PR #129 已合并关闭( 按 webhook 审查约束第 1 条:action 为 未下载 diff、未做代码分析、未修改标题、未发表评论。 |
No description provided.