Skip to content

Fixed the ionocraft collision box bug 修复飘升机碰撞箱大小错误 - #6049

Merged
PigeonNian merged 1 commit into
Anvil-Dev:dev/1.21/1.6from
WhereisFff:dev/1.21/fixiono
Nov 12, 2026
Merged

PigeonNian merged 1 commit into
Anvil-Dev:dev/1.21/1.6from
WhereisFff:dev/1.21/fixiono

Conversation

@WhereisFff

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI balanced review requested due to automatic review settings November 11, 2026 15:54

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.

@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.

结论:APPROVE

这是一行尺寸对齐修正,能够准确定位到具体的提交,并与 dev/26.1/1.6 中对应分支的值完全一致。CI 的 build 与 checkstyle 两项检查都通过,mergeable: true。

✅ 核对

  • 根本原因已定位:1.21 的基线值 sized(0.98f, 0.98f) 由 ab818dd19d(#6001,1.21 侧同步 #5997)引入。该提交把「0.75/0.75 → 0.75/0.48」错误地移植成了「0.75/0.75 → 0.98/0.98」:
    • git show ffdf4c44a0 -- .../ModEntities.java:26.1 侧是把 0.75F, 0.75F 改成 0.75F, 0.48F;
    • git show ab818dd19d -- .../ModEntities.java:1.21 侧改动的是同一行,却把结果写成 0.98f, 0.98f。
  • 当前 head 与 26.1 完全一致:dev/26.1/1.6 的 ModEntities:89 就是 sized(0.75F, 0.48F)、eyeHeight(0.5625F)、clientTrackingRange(10),本次改动只让 1.21 的宽度和高度与 26.1 对齐。
  • 确实存在「碰撞箱放不下」的问题:IonocraftItem.use 中有一段判断 if (!level.noCollision(entity, entity.getBoundingBox())) return fail(...)。旧值 0.98 × 0.98 几乎撑满整格,斜向或贴墙放置时会被 noCollision 拒绝;改成 0.75 × 0.48 后,一格内的放置余量恢复到与视觉模型一致(模型宽 12 px = 0.75 格)。
  • 全仓库中其他使用 0.98 的位置(STANDABLE_LEVITATING_BLOCK 等兄弟实体、DeflectionRingBlockEntity 里针对「0.98 宽的落下铁砧」的注释)都与本次改动无关,没有被误改。

💡 1. eyeHeight(0.5625F) 大于新的碰撞箱高度 0.48

改动后,眼睛位置比碰撞箱顶部还高 0.0825 格。EntityDimensions 不会强制限制 eyeHeight,getEyeY() 直接返回 getY() + eyeHeight,因此任何基于视线起点的判定(射线、hasLineOfSight、命中检测)都会从箱体外部开始。26.1 也是同样的写法,属于从那边继承下来的问题;这里只是提醒:如果后续有逻辑要依赖 getEyeY(),建议在两个分支一起调整到 ≤ 0.48。

💡 2. 相关的玩法影响建议写进 changelog

碰撞箱变小会连带影响三处以碰撞箱为基准的判断,这些都是本次修复的预期效果,但值得记录:

  • 供电判定区域变小:getPowerSupplyingBoundingBox() = getBoundingBox().inflate(0.5),竖直跨度从约 1.98 格降到约 1.48 格,飘升机必须更贴近电网范围才会上浮(客户端 clientCompute() 用同一套几何)。
  • 带动与推挤上下方的范围变小:tick() 里 getBoundingBox().inflate(0.2F, -0.01F, 0.2F) 与 move() 里 expandTowards(0, 1F, 0) 的竖直覆盖面同步缩小,站在飘升机上方的实体/玩家被带起的范围随之变窄。
  • 模型略微超出碰撞箱:IonocraftModel 的宽是 12 px(0.75 格,正好匹配),高是 10 px(0.625 格),比 0.48 的碰撞箱高出约 0.145 格;这与 26.1 的表现一致,属于有意把碰撞箱做得更扁。

📝 3. 与本 PR 无关的既有分支差异(无需处理)

26.1 的同一处还带 .noLootTable(),1.21 没有;1.21 靠 IonocraftEntity#getDropItem() 返回 ModItems.IONOCRAFT。这是分支既有差异,不在本次改动范围内。

@PigeonNian
PigeonNian merged commit 0ea57be into Anvil-Dev:dev/1.21/1.6 Nov 12, 2026
2 checks passed
@WhereisFff
WhereisFff deleted the dev/1.21/fixiono branch November 12, 2026 18:29
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