Skip to content

feat(handbook): 同步 #5997 手册机器与仓储飘升机改进到 1.21 - #6001

Merged
PigeonNian merged 1 commit into
Anvil-Dev:dev/1.21/1.6from
WhereisFff:codex/port-5997-1.21
Nov 8, 2026
Merged

PigeonNian merged 1 commit into
Anvil-Dev:dev/1.21/1.6from
WhereisFff:codex/port-5997-1.21

Conversation

@WhereisFff

Copy link
Copy Markdown
Contributor

将 #5997 的手册机器、仓储整合器、JEI 容器升级和飘升机改动同步到 dev/1.21/1.6,并适配 1.21.1 的物品能力和实体数据格式。

  • 同步中英文机器示例与进阶蓝图,拆分远古残骸和下界合金块章节;修正旧下界合金机的粗金块及创造板条箱说明。
  • 转换 11 个蓝图的木船 ID、悬挂实体坐标、炼药锅输出口字段、告示牌文本、库存格式及管道方块实体 ID。
  • 将容器升级配方并入 JEI 物品压入方块分类,保留材料、扩展结构要求和操作提示。
  • 同步整合器缓存映射及直连仓储访问,保留主线标记过滤、优先级和逐槽模拟语义。
  • 同步飘升机碰撞尺寸、上升间隙、阻挡等待和实际位移托举,保留 1.21 的尾焰粒子及已有 2 kW 耗电。
  • 允许铁砧破坏方块的掉落物被鱼缸和磁化节点吸附,将普通方块放置器抗爆性调整为 15。

依赖:Ageratum 更新至 1.21 已发布的 build.137;AnvilLib 保留 1.21 当前的 snapshot.649。结构实体预览的配套移植见 Anvil-Dev/Ageratum#53,需该 PR 合并发布后再将本 PR 的 Ageratum 版本更新为包含该修复的版本。当前 build.137 尚不包含实体预览支持。

验证:

  • ./gradlew.bat compileJava --console=plain、./gradlew.bat runData --console=plain 通过;检查生成差异并排除主线已有的无关语言生成变化。
  • Checkstyle 13.6.0 对改动 Java 文件检查通过,git diff --check 通过。
  • 4 项服务端 GameTest 通过:仓储逐槽模拟与实际插入、标记优先级、直连核心、飘升机方块/联合电网边界及蓝图加载。蓝图加载覆盖 11 个结构、842 个方块和 15 个实体。
  • 22 个改动页面的 60 个本地文件引用有效;独立代码审查通过。

测试通过临时 Gradle 初始化脚本运行,测试脚本未纳入本 PR。未启动游戏客户端,JEI 和手册渲染画面尚未实机验证。

- 同步中英文机器章节和蓝图,并适配 1.21 实体、告示牌及库存数据
- 合并容器升级 JEI 分类,保留升级材料与条件提示
- 同步仓储整合器缓存映射、直连核心和飘升机上升限制
- 允许铁砧破坏掉落物被吸附并调整方块放置器抗爆性
- 升级 Ageratum 至 1.21 对应的 build.137
Copilot AI balanced review requested due to automatic review settings November 8, 2026 15:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@PigeonNian
PigeonNian merged commit ab818dd into Anvil-Dev:dev/1.21/1.6 Nov 8, 2026
2 checks passed

@Gugle2308 Gugle2308 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

结论:REQUEST_CHANGES。1.21 回移整体结构正确,整合器逐槽映射、直连核心,JEI 合并,铁砧掉落吸附,方块放置器 15F 抗爆和手册页面都与 #5997 对应;但飘升机的 getGridAscent 在没有相交部件时返回 0 的 🔴 与 #5997 相同,另有两处 1.21/26.1 分支差异需要确认。

🔴 1. IonocraftEntity.getGridAscent 没有相交部件时返回 0(与 #5997 同源,未修)

  • PowerGrid.getComponents() 只有方块部件;飘升机自己的 DynamicPowerComponent 在 dynamicComponents 里,不进入这个流;SimplePowerGrid.getPowerComponentInfoList 同样只有方块部件。
  • 常规场景:飘升机停在机器上方,探测盒(box.maxY 往上)不与任何机器 AABB 相交 → ranges 为空 → uncovered 仍是 probe → uncovered.min(Y)-box.maxY-ASCENT_GAP=-0.01 → Math.max(0,...)=0 → limitGridAscent 把 delta.y 清零,飘升机永远升不起来(只有被高大机器 AABB 罩住或穿在机器里才会返回非零)。
  • 修复:没有 range 与 probe 相交时直接 return ascent;只有确实有部件在探测盒内才按 uncovered.min(Y) 截断。

⚠️ 2. 客户端 limitGridAscent 的 AABB 与服务端 IPowerComponent.getShape() 不一致

  • 服务端用 powerGrid.getComponents().stream().map(IPowerComponent::getShape):默认 AABB.ofSize(pos.getCenter(), range, range, range),尺寸 = range。
  • 客户端用 new AABB(info.pos()).inflate(info.range()):以方块 1×1×1 为基准向四周扩 range,尺寸 = 1 + 2×range。
  • 同一 range 下客户端探测盒明显更大,上升限制比服务端宽松,预测与实际可能不一致(客户端先升、服务端再拉回)。26.1 的对应实现用 PowerComponentInfo::boundingBox,1.21 的 PowerComponentInfo 若没有等价方法,建议改为与服务端同式的 AABB.ofSize(info.pos().getCenter(), info.range(), ...) 或补一个 boundingBox 访问器。

⚠️ 3. 飘升机碰撞尺寸与 26.1 主线不一致(1.21:0.98 / 26.1:0.48)

  • 本 PR 把 1.21 的 sized(0.75, 0.75) 改成 0.98×0.98;#5997 在 26.1 是改成 0.75×0.48。两边模型/渲染不同可以解释,但 PR 描述写“同步 #5997 的…飘升机改动”,建议明确这是 1.21 模型适配而非直接同步,避免后续对账时误判。
  • 1.21 的 eyeHeight 0.5625 < 0.98,没有 26.1 那个“眼睛高于碰撞箱”的问题,这点无需改。

⚠️ 4. Ageratum build.137 尚不包含结构实体预览,11 个 .nbt 蓝图里的实体(船、悬挂实体、告示牌文本、炼药锅输出口、管道 BE)暂时不会在手册里显示

  • PR 描述已明确说明依赖 Anvil-Dev/Ageratum#53,并计划在其合并发布后再升级 Ageratum;本 PR 的 .nbt 方块部分可用,实体预览是已知缺口。建议合并前确认维护者接受这个阶段性限制,或等 #53 发布后一起升版本。

💡 5. 手册 203_netherite_block.md 的英文 “respectively..” 多了一个句点

  • 建议改为 “respectively.”。

✅ 已核对

  • StoragePortConsolidatorBlockEntity(1.21 IItemHandler 版):itemPorts() 按标记优先排序、bufferPort(slot)=itemPorts().get(slot/32)、bufferSlot(slot)=slot%32;getSlots/getStackInSlot/insertItem/extractItem/getSlotLimit/isItemValid 全部走同一映射;insertItem 现在写 port.getBuffer().insertItem(bufferSlot(slot), ...),逐槽语义保留;直连核心 getDirectStorageHandler 走 Storages.getOrCreate(...).getItems();与 PR 描述的“缓存映射、直连仓储、标记过滤、优先级、逐槽模拟”一致。
  • IonocraftEntity:CONSUMPTION 保持 1.21 的 2;getBlockAscent/ascentDelay/move 的实体积木碰撞截断、4 tick 延迟、按实际 movedY 托举、clientCompute 的 working 语义正确(getGridAscent 的问题见 🔴 1)。
  • JEI:ContainerUpgradeCategory/Recipe 与 CONTAINER_UPGRADE 类型删除干净;ItemInjectCategory 用两个合成 RecipeHolder 复用 item_inject 分类,1.21 的 RecipeType/ResourceLocation/addItemStack/RenderSupport.renderBlock 适配正确;预览状态、扩展槽位、六个 catalyst、lang 清理都齐全。
  • 铁砧破坏掉落:AnvilUtil.dropItems 换成按 maxStackSize 拆分的 ItemEntity,并 anvilcraft$setIsAdsorbable(true);无 AnvilUtil 残留。
  • ModBlocks:BLOCK_PLACER 加 explosionResistance(15F),PR 描述已声明。
  • 手册:002_stone/201_netherite_block 已无引用;003_sand/022_mesh/101_piezoelectric/201_gem/210_tree 的 .nbt 引用与新增文件对应;202_ancient_debris/203_netherite_block 的新页面与 009/001_basic_minerals/210_netherite_ingot 的链接一致;203 的中文“粗金块”与 1.21 机器一致。
  • gradle:ageratum 121→137、anvillib 保持 649,与 PR 描述一致。

📝 建议补测

  • 飘升机:停在机器上方(无部件在探测盒内)应正常上升;在高大机器下方应被截断;客户端与服务端上升高度一致(对应 ⚠️ 2)。
  • 整合器:insertItem(slot) 后立即 getStackInSlot(slot) 应看到刚插入的物品;直连核心 vs 有端口两种形态的 getSlots/insert/extract;标记端口核心输出槽不再暴露的兼容性。
  • 手册:中英文 202/203/210/101/003/022 的 structure 渲染;Ageratum#53 合并后确认 .nbt 实体预览。
  • JEI:容器升级两个条目在 item_inject 分类中的图标/预览/扩展槽 tooltip。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants