[PR #4205] [MERGED] Get off a strider onto the shore, not into the lava beside it #5483

Closed
opened 2026-11-03 05:12:54 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4205
Author: @d3grando
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @levzzz5154

Base: main ← Head: fix-3513-strider-dismount-lava


📝 Commits (6)

  • 91aa9c7 Get off a strider onto the shore, not into the lava beside it
  • 83f723f Merge hr/main into fix-3513-strider-dismount-lava
  • b5ad463 Fix main's test build: Aabb in_water stub in end_gateway, duplicate tests module and Items::load args in creatures
  • 7cee64a Fix main's test build: Aabb in_water stub in end_gateway
  • 53259f6 Merge hr/main into fix-3513-strider-dismount-lava
  • da1f0fb Merge hr/main into fix-3513-strider-dismount-lava

📊 Changes

2 files changed (+340 additions, -37 deletions)

View changed files

📝 crates/horizon-client/src/game/mounts.rs (+316 -27)
📝 crates/horizon-client/src/game/respawn_anchor.rs (+24 -10)

📄 Description

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

What and why

Part of #3513 (the Strider.getDismountLocationForPassenger row).

Game::dismount_mount used one rule for every mount except the happy ghast. It tried a spot on each side of the mount's body, then its back, and checked only for full blocks at the feet and head. It had no lava check and no floor check. Pressing shift on a strider in a lava lake put the rider beside it, in the lava, even when the shore was right in front of them. In survival that burns the player and their items.

Striders now follow vanilla's own rule:

  • It walks five columns: along the rider's facing, then 22.5 and 45 degrees to either side (Entity.getCollisionHorizontalEscapeVector). Each column runs from the top of the strider's box down to half a block below its feet. Blocks are visited once each, in the order first reached (vanilla's LinkedHashSet).
  • It skips any block whose fluid is lava. It keeps blocks with a valid floor (BlockGetter.getBlockFloorHeight, DismountHelper.isBlockFloorValid) where the rider's box fits standing, crouching or crawling (Player.getDismountPoses, DismountHelper.canDismountTo). The rider lands at Vec3.upFromBottomCenterOf and takes the pose that fit.
  • If no block passes, the rider lands on top of the strider (x, maxY, z), as in vanilla. In the middle of an open lava sea the rider still falls into the lava, because striders cannot be stood on. Vanilla does the same.

The block collision shape (BlockState.getCollisionShape under the empty context) and canDismountTo (no block collision and inside the world border) were inline in the respawn anchor's safe_dismount_location. They are now two small Game helpers that both callers use, and the anchor's behaviour is unchanged. Block collisions are checked under the empty collision context, as the anchor already did; vanilla's canDismountTo passes the rider, which only changes context-dependent shapes such as scaffolding and powder snow. The dismount decision is a pure function behind a small DismountWorld trait, so it can be tested without a world. Other mounts keep their current rule, unchanged.

The single player window and LAN guests both get off through the server's guest_vehicle_tick → dismount_mount, so the fix covers both.

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

Read with javap from the 26.3 client jar:

  • net.minecraft.world.entity.monster.Strider.getDismountLocationForPassenger(LivingEntity)
  • net.minecraft.world.entity.Entity.getCollisionHorizontalEscapeVector(double, double, float) (uses the Mth.sin/Mth.cos table, horizon_core::geometry::trig)
  • net.minecraft.world.level.BlockGetter.getBlockFloorHeight(BlockPos)
  • net.minecraft.world.entity.vehicle.DismountHelper.isBlockFloorValid(double) and canDismountTo(CollisionGetter, LivingEntity, AABB)
  • net.minecraft.world.entity.player.Player.getDismountPoses() (standing, crouching, swimming)

No parity harness covers dismounting. New bin-target unit tests in game::mounts::tests check it:

  • a_strider_in_open_lava_puts_its_rider_on_its_back: vanilla's fallback on top of the strider, not the lava beside it.
  • a_strider_by_the_shore_puts_its_rider_on_the_shore: the shore is found in the 45-degree column, at its floor.
  • a_low_ceiling_on_the_shore_makes_the_rider_crawl_off: the swimming (crawl) pose is picked when standing and crouching do not fit.
  • the_escape_vector_reaches_the_edge_of_the_square

Self-check

Windows 11. tools/pr_ready.py does not run on Windows (it needs SIGHUP), so I ran its steps by hand:

  • cargo fmt --all -- --check: clean.
  • cargo clippy --profile fast -p horizon-client --all-targets -- -D warnings: clean.
  • cargo test --profile fast -p horizon-client --bin horizon-client game::mounts:
    • After the fix: test result: ok. 4 passed; 0 failed.
    • Before (only the strider branch of dismount_location removed, so striders use the old generic rule; the tests unchanged): test result: FAILED. 1 passed; 3 failed. The rider lands at x: -0.35, y: 30.89, z: 0.5, beside the strider in the lava (dismounted into lava at Vec3 { x: -0.34999998807907107, y: 30.88888888888889, z: 0.5 }).
  • In game, single player with its server thread (the window joins it as a guest):
    • Setup: a 21×21 lava pool with a netherrack shore. A strider with no AI is summoned in the lava 0.7 blocks from the shore with /summon, and the player mounts it with /ride @s mount, facing the shore, in survival. Then shift.
    • Before (v0.2.97, which has the same generic rule as main): the player lands at (200.65, 100.0, 528.3) in the lava, burning, with health 6 a second later.
    • After: the player lands at (201.5, 101.0, 529.5) on the shore, standing, health 20.
    • A temporary log (since removed) showed the server picking Some(Standing) at that spot. In open lava it picked (x, maxY, z) on the strider's back, as vanilla does.

Screenshots

before: sneaking off a strider in a lava lake drops the player into the lava

after: with no safe spot around, the player stays on the strider, unhurt

Each shot is taken one second after pressing shift, in survival, looking back at the strider:

  • Before: the player is in the lava, the screen is orange with the fire overlay, and only 3 hearts are left.
  • After: the player stands on the netherrack shore facing the strider, with full health.

🤖 Generated with Claude Code


🔄 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/4205 **Author:** [@d3grando](https://github.com/d3grando) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix-3513-strider-dismount-lava` --- ### 📝 Commits (6) - [`91aa9c7`](https://github.com/horizon-rust/horizon/commit/91aa9c790f55f051c8ee824669ad88c0a1fe0bb1) Get off a strider onto the shore, not into the lava beside it - [`83f723f`](https://github.com/horizon-rust/horizon/commit/83f723f666918d9ee0c826eea738ae319ed53a1e) Merge hr/main into fix-3513-strider-dismount-lava - [`b5ad463`](https://github.com/horizon-rust/horizon/commit/b5ad463d2d5e3af796535657c0ca3cf580333ef2) Fix main's test build: Aabb in_water stub in end_gateway, duplicate tests module and Items::load args in creatures - [`7cee64a`](https://github.com/horizon-rust/horizon/commit/7cee64a389ebeed28b57e052957610ff8d9184fb) Fix main's test build: Aabb in_water stub in end_gateway - [`53259f6`](https://github.com/horizon-rust/horizon/commit/53259f6b0790d7f6eaba0f7239cba02c73e4d776) Merge hr/main into fix-3513-strider-dismount-lava - [`da1f0fb`](https://github.com/horizon-rust/horizon/commit/da1f0fb3a449b7eafb12e6d43892b886de3a702d) Merge hr/main into fix-3513-strider-dismount-lava ### 📊 Changes **2 files changed** (+340 additions, -37 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/mounts.rs` (+316 -27) 📝 `crates/horizon-client/src/game/respawn_anchor.rs` (+24 -10) </details> ### 📄 Description > 🤖 Opened by d3grando's AI agent (Claude Code, Claude Opus 5.5), not by d3grando personally. ## What and why Part of #3513 (the `Strider.getDismountLocationForPassenger` row). `Game::dismount_mount` used one rule for every mount except the happy ghast. It tried a spot on each side of the mount's body, then its back, and checked only for full blocks at the feet and head. It had no lava check and no floor check. Pressing shift on a strider in a lava lake put the rider beside it, in the lava, even when the shore was right in front of them. In survival that burns the player and their items. Striders now follow vanilla's own rule: - It walks five columns: along the rider's facing, then 22.5 and 45 degrees to either side (`Entity.getCollisionHorizontalEscapeVector`). Each column runs from the top of the strider's box down to half a block below its feet. Blocks are visited once each, in the order first reached (vanilla's `LinkedHashSet`). - It skips any block whose fluid is lava. It keeps blocks with a valid floor (`BlockGetter.getBlockFloorHeight`, `DismountHelper.isBlockFloorValid`) where the rider's box fits standing, crouching or crawling (`Player.getDismountPoses`, `DismountHelper.canDismountTo`). The rider lands at `Vec3.upFromBottomCenterOf` and takes the pose that fit. - If no block passes, the rider lands on top of the strider (`x, maxY, z`), as in vanilla. In the middle of an open lava sea the rider still falls into the lava, because striders cannot be stood on. Vanilla does the same. The block collision shape (`BlockState.getCollisionShape` under the empty context) and `canDismountTo` (no block collision and inside the world border) were inline in the respawn anchor's `safe_dismount_location`. They are now two small `Game` helpers that both callers use, and the anchor's behaviour is unchanged. Block collisions are checked under the empty collision context, as the anchor already did; vanilla's `canDismountTo` passes the rider, which only changes context-dependent shapes such as scaffolding and powder snow. The dismount decision is a pure function behind a small `DismountWorld` trait, so it can be tested without a world. Other mounts keep their current rule, unchanged. The single player window and LAN guests both get off through the server's `guest_vehicle_tick` → `dismount_mount`, so the fix covers both. ## 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 Read with javap from the 26.3 client jar: - `net.minecraft.world.entity.monster.Strider.getDismountLocationForPassenger(LivingEntity)` - `net.minecraft.world.entity.Entity.getCollisionHorizontalEscapeVector(double, double, float)` (uses the `Mth.sin`/`Mth.cos` table, `horizon_core::geometry::trig`) - `net.minecraft.world.level.BlockGetter.getBlockFloorHeight(BlockPos)` - `net.minecraft.world.entity.vehicle.DismountHelper.isBlockFloorValid(double)` and `canDismountTo(CollisionGetter, LivingEntity, AABB)` - `net.minecraft.world.entity.player.Player.getDismountPoses()` (standing, crouching, swimming) No parity harness covers dismounting. New bin-target unit tests in `game::mounts::tests` check it: - `a_strider_in_open_lava_puts_its_rider_on_its_back`: vanilla's fallback on top of the strider, not the lava beside it. - `a_strider_by_the_shore_puts_its_rider_on_the_shore`: the shore is found in the 45-degree column, at its floor. - `a_low_ceiling_on_the_shore_makes_the_rider_crawl_off`: the swimming (crawl) pose is picked when standing and crouching do not fit. - `the_escape_vector_reaches_the_edge_of_the_square` ## Self-check Windows 11. `tools/pr_ready.py` does not run on Windows (it needs SIGHUP), so I ran its steps by hand: - `cargo fmt --all -- --check`: clean. - `cargo clippy --profile fast -p horizon-client --all-targets -- -D warnings`: clean. - `cargo test --profile fast -p horizon-client --bin horizon-client game::mounts`: - After the fix: `test result: ok. 4 passed; 0 failed`. - Before (only the strider branch of `dismount_location` removed, so striders use the old generic rule; the tests unchanged): `test result: FAILED. 1 passed; 3 failed`. The rider lands at `x: -0.35, y: 30.89, z: 0.5`, beside the strider in the lava (`dismounted into lava at Vec3 { x: -0.34999998807907107, y: 30.88888888888889, z: 0.5 }`). - In game, single player with its server thread (the window joins it as a guest): - Setup: a 21×21 lava pool with a netherrack shore. A strider with no AI is summoned in the lava 0.7 blocks from the shore with `/summon`, and the player mounts it with `/ride @s mount`, facing the shore, in survival. Then shift. - Before (v0.2.97, which has the same generic rule as main): the player lands at `(200.65, 100.0, 528.3)` in the lava, burning, with health 6 a second later. - After: the player lands at `(201.5, 101.0, 529.5)` on the shore, standing, health 20. - A temporary log (since removed) showed the server picking `Some(Standing)` at that spot. In open lava it picked `(x, maxY, z)` on the strider's back, as vanilla does. ## Screenshots ![before: sneaking off a strider in a lava lake drops the player into the lava](https://raw.githubusercontent.com/d3grando/horizon/pr-assets/3513-strider-dismount-lava-1.png) ![after: with no safe spot around, the player stays on the strider, unhurt](https://raw.githubusercontent.com/d3grando/horizon/pr-assets/3513-strider-dismount-lava-2.png) Each shot is taken one second after pressing shift, in survival, looking back at the strider: - Before: the player is in the lava, the screen is orange with the fire overlay, and only 3 hearts are left. - After: the player stands on the netherrack shore facing the strider, with full health. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:12:54 +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#5483
No description provided.