[PR #6086] [MERGED] Minecarts with a mob or guest aboard keep their speed #6645

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

📋 Pull Request Information

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

Base: main ← Head: fix/minecart-mob-rider


📝 Commits (1)

  • 26dc0d8 Minecarts with a mob or guest aboard keep their speed

📊 Changes

2 files changed (+51 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/game/minecarts.rs (+13 -2)
📝 tools/lan_e2e.py (+38 -0)

📄 Description

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

What and why

A minecart with a mob in it dragged like an empty one: the slowdown (0.96 empty, 0.997 occupied) and the 0.75 speed scale were chosen by Some(c.id) == self.riding, which is true only for the local player. A mob passenger, and a LAN guest riding a cart the host simulates, were both treated as empty. A pig in a cart at Motion x 0.4 stopped about 3.3 blocks short after 40 ticks. New helper cart_is_vehicle (local player, LAN guest or a mob mounted on the cart) is used in tick_cart's two movement paths (new and old behavior).

Fixes #6085

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

AbstractMinecart.getSlowdownFactor returns 0.997 when isVehicle() (any passenger) and the behavior's own factor otherwise; NewMinecartBehavior / OldMinecartBehavior read the same isVehicle() for the max-speed scale. Checked with tools/rea_vanilla.py.

Test

  • Side-by-side scene (cart with a pig, straight rail, Motion x 0.4), real 26.3 server vs Horizon dedicated server: cart x/Motion at tick 10 and 40.
    • Before: tick 10 x -4.148, Motion 0.2659; tick 40 x 0.546, Motion 0.0781.
    • After: tick 10 x -4.540, Motion 0.3882; tick 40 x 3.824, Motion 0.3547.
    • Vanilla: tick 10 x -4.540, Motion 0.3882; tick 40 x 3.824, Motion 0.3547. After equals vanilla to full double precision.
  • tools/lan_e2e.py --check cart_mob_rider (new): an empty cart and a cart with a pig, same push, 40 ticks. With the fix: empty 7.788, with pig 10.521 blocks travelled (passes, gap over 2). Fix reverted: 7.788 vs 7.792 (fails).
  • python3 tools/pr_ready.py --quick passes.

What wasn't compared

  • A guest player as rider has the same fixed path (ridden_by_guest) but no run compared it with vanilla.
  • Other cart kinds (chest, furnace, hopper) with a passenger, and the rest of the minecart scene's known differences (powered rail kick-off against a redstone block, curve and water carts under 0.05 blocks), were not touched.
  • Mobs entering a cart by pushing (pickup) were not re-tested; only a passenger present at spawn.

Proved by script against the real 26.3 server; no human played this change.

Other projects' code

none

Self-check

pr_ready (tools/pr_ready.py --quick on Valhalla, against origin/main at 308ef6527, 3 min 13 s)

Check Result
Scope ✅ 3 files, +51 −2
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 533 passed (23 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 ✅ (9 s)
tests: horizon-client ✅ 1751 passed (2 min 32 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 ➖ 323 affected, to run in CI (--quick): armor_stand_frost, block_removal, boat_paddle_reset, boat_submerged, bulk_section, bundle_weight, camera, canyon_carver, carving_geometry, carving_mask, cauldron, cave_carver and 311 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/6086 **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/minecart-mob-rider` --- ### 📝 Commits (1) - [`26dc0d8`](https://github.com/horizon-rust/horizon/commit/26dc0d815fbf215f4d804d7c8112a8d7b77c6873) Minecarts with a mob or guest aboard keep their speed ### 📊 Changes **2 files changed** (+51 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/minecarts.rs` (+13 -2) 📝 `tools/lan_e2e.py` (+38 -0) </details> ### 📄 Description > 🤖 Opened by Valkyrie's AI agent (Claude Code, Opus 5.5), not by Valkyrie herself. ## What and why A minecart with a mob in it dragged like an empty one: the slowdown (0.96 empty, 0.997 occupied) and the 0.75 speed scale were chosen by `Some(c.id) == self.riding`, which is true only for the local player. A mob passenger, and a LAN guest riding a cart the host simulates, were both treated as empty. A pig in a cart at Motion x 0.4 stopped about 3.3 blocks short after 40 ticks. New helper `cart_is_vehicle` (local player, LAN guest or a mob mounted on the cart) is used in `tick_cart`'s two movement paths (new and old behavior). Fixes #6085 ## 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 `AbstractMinecart.getSlowdownFactor` returns 0.997 when `isVehicle()` (any passenger) and the behavior's own factor otherwise; `NewMinecartBehavior` / `OldMinecartBehavior` read the same `isVehicle()` for the max-speed scale. Checked with `tools/rea_vanilla.py`. ## Test - Side-by-side scene (cart with a pig, straight rail, Motion x 0.4), real 26.3 server vs Horizon dedicated server: cart x/Motion at tick 10 and 40. - Before: tick 10 x -4.148, Motion 0.2659; tick 40 x 0.546, Motion 0.0781. - After: tick 10 x -4.540, Motion 0.3882; tick 40 x 3.824, Motion 0.3547. - Vanilla: tick 10 x -4.540, Motion 0.3882; tick 40 x 3.824, Motion 0.3547. After equals vanilla to full double precision. - `tools/lan_e2e.py --check cart_mob_rider` (new): an empty cart and a cart with a pig, same push, 40 ticks. With the fix: empty 7.788, with pig 10.521 blocks travelled (passes, gap over 2). Fix reverted: 7.788 vs 7.792 (fails). - `python3 tools/pr_ready.py --quick` passes. ## What wasn't compared - A guest player as rider has the same fixed path (`ridden_by_guest`) but no run compared it with vanilla. - Other cart kinds (chest, furnace, hopper) with a passenger, and the rest of the minecart scene's known differences (powered rail kick-off against a redstone block, curve and water carts under 0.05 blocks), were not touched. - Mobs entering a cart by pushing (pickup) were not re-tested; only a passenger present at spawn. Proved by script against the real 26.3 server; no human played this change. ## Other projects' code none ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on Valhalla, against origin/main at 308ef6527, 3 min 13 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +51 −2 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 533 passed (23 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 | ✅ (9 s) | | tests: horizon-client | ✅ 1751 passed (2 min 32 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 | ➖ 323 affected, to run in CI (--quick): armor_stand_frost, block_removal, boat_paddle_reset, boat_submerged, bulk_section, bundle_weight, camera, canyon_carver, carving_geometry, carving_mask, cauldron, cave_carver and 311 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:24:16 +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#6645
No description provided.