[PR #5944] [MERGED] Hoglins and other wide mobs suffocate in walls #6578

Closed
opened 2026-11-03 06:23:19 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5944
Author: @HrafnaValkyrja
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/wide-mobs-suffocate


📝 Commits (2)

  • 0bf5c15 Hoglins and other wide mobs suffocate in walls
  • 394725e Merge origin/main

📊 Changes

2 files changed (+85 additions, -10 deletions)

View changed files

📝 crates/horizon-client/src/mobs/ai.rs (+60 -10)
📝 tools/lan_e2e.py (+25 -0)

📄 Description

🤖 Opened by Valkyrie's AI agent (Claude Code, Opus 5.5), not by Valkyrie herself.

What and why

Hoglins (and every mob 1.0 or wider) never took in-wall damage. base_tick in crates/horizon-client/src/mobs/ai.rs only tested the single block at the eye and required width() < 1.0. The guard came in with the original AI-framework port (2f74209da) and has no vanilla counterpart; it approximated the real test for narrow mobs.

Now in_wall follows Entity.isInWall: a box of width * 0.8 by 1e-6 centred on the eye, every cell from floor(min) to floor(max), overlap beyond 1e-7. Wide mobs cover several columns; narrow mobs that clip a neighbouring wall column with the box now also suffocate (the old one-block test missed that). Vex stays exempt (noPhysics during tick). Server-thread mob tick only.

Fixes #5872

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

  • Entity.isInWall(): noPhysics -> false; w = getBbWidth()*0.8f; AABB.ofSize(getEyePosition(), w, 1.0E-6, w); BlockPos.betweenClosedStream(box).anyMatch(...).
  • Lambda: !state.isAir() && state.isSuffocating(level,pos) && Shapes.joinIsNotEmpty(state.getCollisionShape(level,pos).move(pos), Shapes.create(box), BooleanOp.AND).
  • LivingEntity.baseTick: if (isAlive() && isInWall()) hurt(inWall, 1.0F).

Test: in_wall_tests::wide_mobs_suffocate_by_the_eye_box, plus a new hoglin-wall check in tools/lan_e2e.py on real games: a hoglin summoned inside stone went from 39 to 35 health in 40 ticks. Not compared side by side with the vanilla server, and that check was not run without the fix.

Other projects' code

none

Self-check

pr_ready (tools/pr_ready.py --quick on Valhalla, against origin/main at c1f4a7c19, 4 min 49 s)

Check Result
Scope ✅ 3 files, +85 −10
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 515 passed (21 s)
rustfmt ✅ (6 s)
Rust ⚠️ 1.98.0 is older than CI's stable (1.99): clippy may flag lints CI doesn't, update with rustup update
clippy ✅ (1 min 37 s)
tests: horizon-client ✅ 1679 passed (2 min 41 s)
doc tests ✅ 0 passed (2 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 319 affected, to run in CI (--quick): arrow, auto_jump, block_removal, bulk_section, bundle_weight, camera, canyon_carver, carving_geometry, carving_mask, cauldron, cave_carver, chat_screen and 307 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Claude Code

https://claude.ai/code/session_018zuDTsnyHkP28bzn3u7S3m


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/5944 **Author:** [@HrafnaValkyrja](https://github.com/HrafnaValkyrja) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/wide-mobs-suffocate` --- ### 📝 Commits (2) - [`0bf5c15`](https://github.com/horizon-rust/horizon/commit/0bf5c156fed1549c44393b5cbfe8a1244e26cd78) Hoglins and other wide mobs suffocate in walls - [`394725e`](https://github.com/horizon-rust/horizon/commit/394725e84e030358f88a7fc03f494aabe268ee8e) Merge origin/main ### 📊 Changes **2 files changed** (+85 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mobs/ai.rs` (+60 -10) 📝 `tools/lan_e2e.py` (+25 -0) </details> ### 📄 Description > 🤖 Opened by Valkyrie's AI agent (Claude Code, Opus 5.5), not by Valkyrie herself. ## What and why Hoglins (and every mob 1.0 or wider) never took in-wall damage. `base_tick` in `crates/horizon-client/src/mobs/ai.rs` only tested the single block at the eye and required `width() < 1.0`. The guard came in with the original AI-framework port (2f74209da) and has no vanilla counterpart; it approximated the real test for narrow mobs. Now `in_wall` follows `Entity.isInWall`: a box of `width * 0.8` by 1e-6 centred on the eye, every cell from floor(min) to floor(max), overlap beyond 1e-7. Wide mobs cover several columns; narrow mobs that clip a neighbouring wall column with the box now also suffocate (the old one-block test missed that). Vex stays exempt (noPhysics during tick). Server-thread mob tick only. Fixes #5872 ## Kind - [x] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference - `Entity.isInWall()`: `noPhysics` -> false; `w = getBbWidth()*0.8f`; `AABB.ofSize(getEyePosition(), w, 1.0E-6, w)`; `BlockPos.betweenClosedStream(box).anyMatch(...)`. - Lambda: `!state.isAir() && state.isSuffocating(level,pos) && Shapes.joinIsNotEmpty(state.getCollisionShape(level,pos).move(pos), Shapes.create(box), BooleanOp.AND)`. - `LivingEntity.baseTick`: `if (isAlive() && isInWall()) hurt(inWall, 1.0F)`. Test: `in_wall_tests::wide_mobs_suffocate_by_the_eye_box`, plus a new `hoglin-wall` check in `tools/lan_e2e.py` on real games: a hoglin summoned inside stone went from 39 to 35 health in 40 ticks. Not compared side by side with the vanilla server, and that check was not run without the fix. ## Other projects' code none ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on Valhalla, against origin/main at c1f4a7c19, 4 min 49 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +85 −10 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 515 passed (21 s) | | rustfmt | ✅ (6 s) | | Rust | ⚠️ 1.98.0 is older than CI's stable (1.99): clippy may flag lints CI doesn't, update with `rustup update` | | clippy | ✅ (1 min 37 s) | | tests: horizon-client | ✅ 1679 passed (2 min 41 s) | | doc tests | ✅ 0 passed (2 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 319 affected, to run in CI (--quick): arrow, auto_jump, block_removal, bulk_section, bundle_weight, camera, canyon_carver, carving_geometry, carving_mask, cauldron, cave_carver, chat_screen and 307 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_018zuDTsnyHkP28bzn3u7S3m --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:23:19 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#6578
No description provided.