[PR #6406] [MERGED] Fill three gaps in the native entity mount hook #6851

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

📋 Pull Request Information

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

Base: main ← Head: fix/6365-mount-hook-gaps


📝 Commits (2)

  • 4690ae1 Fill three gaps in the native entity mount hook
  • 3d8c14e Boat and minecart pickups walk the mobs by id

📊 Changes

6 files changed (+57 additions, -22 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+4 -0)
📝 crates/horizon-client/src/game/boat_passengers.rs (+16 -7)
📝 crates/horizon-client/src/game/cushions.rs (+5 -0)
📝 crates/horizon-client/src/game/lan_actions.rs (+9 -1)
📝 crates/horizon-client/src/game/minecarts.rs (+17 -11)
📝 crates/horizon-client/src/game/native_mounts.rs (+6 -3)

📄 Description

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

What and why

Fixes #6365: the three gaps in native_entity_mount (#6281).

  1. A guest's events carried entity id 0. native_acting_entity looked the acting guest up with lan_guest_entities(), which reads self.lan, and the hub is often out of self.lan while a guest's action runs. The guest swap (lan_actions.rs) already carries the guest's name, UUID and permission through the action (lan_acting_name, lan_acting_uuid, lan_acting_permission); it now carries its entity id too (lan_acting_entity), restored with the others. native_acting_entity reads it, and falls back to the hub lookup if it isn't set.
  2. A mob a boat or minecart picks up didn't fire the hook. The boat pickup (boat_passengers.rs) and the minecart pickup (minecarts.rs) set mount directly. Vanilla's go through Entity.startRiding, so both now ask native_mob_may_ride(mob, vehicle, true) first; a canceled one stays off (the boat pushes it as before). The mob is found again by id after the hook, and the loops stop if a mod's hook removed mobs, so a stale index can't panic.
  3. A canceled dismount was overwritten by a cushion. After native_may_board, cushions.rs called stop_riding() and then set riding unconditionally. Vanilla's startRiding stops when stopRiding left the passenger seated, so the cushion now does nothing when the player is still riding after stop_riding().

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

  • net.minecraft.world.entity.Entity.startRiding: the boat and minecart pickups go through it, and it returns early when stopRiding didn't dismount.

Not run in game here: the issue's checks need horizon-machine-sample logging native_entity_mount (a guest boarding, a pig pushed into a boat, a cushion boarded while a mod cancels the dismount).

Other projects' code

none

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on DESKTOP-G0M27UC, against upstream/main at 80dfb5f35, 9 min 8 s)

Check Result
Scope ✅ 6 files, +50 −17
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 594 passed (3 min 8 s)
rustfmt ✅ (17 s)
clippy ✅ (2 min 4 s)
tests: horizon-client ❌ 571 passed, 2 failed (3 min 31 s)
doc tests ✅ 0 passed (5 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 ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

The two failing tests, native_loot_kinds_stay_hookable and native_breathing_stays_hookable, are unrelated: both read a source file with include_str! and look for " } ", which a Windows core.autocrlf checkout doesn't have (#6372, fixed in #6375). CI (LF) is unaffected.

🤖 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/6406 **Author:** [@breachato](https://github.com/breachato) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/6365-mount-hook-gaps` --- ### 📝 Commits (2) - [`4690ae1`](https://github.com/horizon-rust/horizon/commit/4690ae1cdb62b6e2f68593f00e9172a9a8d7fdf5) Fill three gaps in the native entity mount hook - [`3d8c14e`](https://github.com/horizon-rust/horizon/commit/3d8c14eb04e3fcbfa16f306807f44823795ec7ca) Boat and minecart pickups walk the mobs by id ### 📊 Changes **6 files changed** (+57 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+4 -0) 📝 `crates/horizon-client/src/game/boat_passengers.rs` (+16 -7) 📝 `crates/horizon-client/src/game/cushions.rs` (+5 -0) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+9 -1) 📝 `crates/horizon-client/src/game/minecarts.rs` (+17 -11) 📝 `crates/horizon-client/src/game/native_mounts.rs` (+6 -3) </details> ### 📄 Description > 🤖 Opened by breachato's AI agent (Claude Code, Claude Opus 5.5), not by breachato personally. ## What and why Fixes #6365: the three gaps in `native_entity_mount` (#6281). 1. **A guest's events carried entity id 0.** `native_acting_entity` looked the acting guest up with `lan_guest_entities()`, which reads `self.lan`, and the hub is often out of `self.lan` while a guest's action runs. The guest swap (`lan_actions.rs`) already carries the guest's name, UUID and permission through the action (`lan_acting_name`, `lan_acting_uuid`, `lan_acting_permission`); it now carries its entity id too (`lan_acting_entity`), restored with the others. `native_acting_entity` reads it, and falls back to the hub lookup if it isn't set. 2. **A mob a boat or minecart picks up didn't fire the hook.** The boat pickup (`boat_passengers.rs`) and the minecart pickup (`minecarts.rs`) set `mount` directly. Vanilla's go through `Entity.startRiding`, so both now ask `native_mob_may_ride(mob, vehicle, true)` first; a canceled one stays off (the boat pushes it as before). The mob is found again by id after the hook, and the loops stop if a mod's hook removed mobs, so a stale index can't panic. 3. **A canceled dismount was overwritten by a cushion.** After `native_may_board`, `cushions.rs` called `stop_riding()` and then set `riding` unconditionally. Vanilla's `startRiding` stops when `stopRiding` left the passenger seated, so the cushion now does nothing when the player is still riding after `stop_riding()`. ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [x] 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 - `net.minecraft.world.entity.Entity.startRiding`: the boat and minecart pickups go through it, and it returns early when `stopRiding` didn't dismount. Not run in game here: the issue's checks need horizon-machine-sample logging `native_entity_mount` (a guest boarding, a pig pushed into a boat, a cushion boarded while a mod cancels the dismount). ## Other projects' code none ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on DESKTOP-G0M27UC, against upstream/main at 80dfb5f35, 9 min 8 s) | Check | Result | | --- | --- | | Scope | ✅ 6 files, +50 −17 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 594 passed (3 min 8 s) | | rustfmt | ✅ (17 s) | | clippy | ✅ (2 min 4 s) | | tests: horizon-client | ❌ 571 passed, 2 failed (3 min 31 s) | | doc tests | ✅ 0 passed (5 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 | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | The two failing tests, `native_loot_kinds_stay_hookable` and `native_breathing_stays_hookable`, are unrelated: both read a source file with `include_str!` and look for `" } "`, which a Windows `core.autocrlf` checkout doesn't have (#6372, fixed in #6375). CI (LF) is unaffected. 🤖 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 06:27:59 +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#6851
No description provided.