[PR #3779] [MERGED] Furnace minecart keeps its push length, as vanilla does (#3546) #5213

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3779
Author: @leifiyoo
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @ludovic111

Base: main ← Head: fix/powered-minecart-speed


📝 Commits (1)

  • 39b6aa4 Furnace minecart keeps its push length, as vanilla does

📊 Changes

1 file changed (+60 additions, -24 deletions)

View changed files

📝 crates/horizon-client/src/game/minecarts.rs (+60 -24)

📄 Description

🤖 Opened by leifiyoo's AI agent (Claude), not by leifiyoo himself.

What and why

Partial fix for #3546. The issue reports a powered minecart with coal taking 3:54 on a track where vanilla takes 3:00, with no fuel particles or burning.

Horizon stored the furnace minecart's push as x and z only. Vanilla keeps the push vector in 3D, and gravity gives the cart a vertical component, so in vanilla the push loses length per tick. In Horizon it kept its full length, which made a cart fuelled near the cart's own position slower than in vanilla.

This PR keeps the push as a Vec3 (push_along helper), saves only PushX and PushZ as before, and sets y to 0 on load and on refuel.

Measured in a flat-track simulation (not in the commit): at 3:00 of fuel, the Horizon/vanilla ratio goes from 0.56 at push 0.4 to 0.79 at push 0.5 and 1.00 at push 0.6. Whether this explains the reporter's 3:54 exactly is not verified.

Not in this PR: the fuel particles and burning. Horizon already spawns LargeSmoke for the furnace (minecarts.rs, around line 592), so "no particles" is not explained by this change. The front of the furnace is also not touched.

Vanilla reference

  • MinecartFurnace.applyNaturalSlowdown, calculateNewPushAlong, addFuel, addAdditionalSaveData / readAdditionalSaveData
  • AbstractMinecart.applyNaturalSlowdown
  • OldMinecartBehavior.moveAlongTrack, getMaxSpeed
  • Vec3.projectedOn, Vec3.normalize

Constants checked and equal to vanilla: 3600 ticks per coal, max speed 0.2 on land, slowdown 0.96 / 0.997.

Not verified

  • No game run.
  • No parity harness: there is none for minecarts, and no Java oracle was written. The change is a gameplay change without a harness.
  • Two new unit tests (length kept under gravity, save writes no y); both pass.
  • tools/parity.py (and so pr_ready's harness step) fails on this Windows machine with ModuleNotFoundError: No module named 'fcntl'. That is a Unix-only import in the tool, not this change.

Self-check

pr_ready (tools/pr_ready.py --base upstream/main, against upstream/main at 7e42cc8ec, 9 min 46 s)

Scope                         1 file, +60 -24
Cargo.lock                    unchanged
Public tree                   ok
Python tests                  416 passed (1 min 19 s)
rustfmt                       ok (10 s)
clippy                        ok (2 min 14 s)
tests: horizon-client         836 passed (5 min 42 s)
doc tests                     0 passed (12 s)
Parity                        FAIL on Windows: tools/parity.py imports fcntl (see Not verified)

🤖 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/3779 **Author:** [@leifiyoo](https://github.com/leifiyoo) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/powered-minecart-speed` --- ### 📝 Commits (1) - [`39b6aa4`](https://github.com/horizon-rust/horizon/commit/39b6aa46bc864b481bb4b3db2fb3b7bad700ef70) Furnace minecart keeps its push length, as vanilla does ### 📊 Changes **1 file changed** (+60 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/minecarts.rs` (+60 -24) </details> ### 📄 Description > 🤖 Opened by leifiyoo's AI agent (Claude), not by leifiyoo himself. ## What and why Partial fix for #3546. The issue reports a powered minecart with coal taking 3:54 on a track where vanilla takes 3:00, with no fuel particles or burning. Horizon stored the furnace minecart's push as x and z only. Vanilla keeps the push vector in 3D, and gravity gives the cart a vertical component, so in vanilla the push loses length per tick. In Horizon it kept its full length, which made a cart fuelled near the cart's own position slower than in vanilla. This PR keeps the push as a `Vec3` (`push_along` helper), saves only `PushX` and `PushZ` as before, and sets y to 0 on load and on refuel. Measured in a flat-track simulation (not in the commit): at 3:00 of fuel, the Horizon/vanilla ratio goes from 0.56 at push 0.4 to 0.79 at push 0.5 and 1.00 at push 0.6. **Whether this explains the reporter's 3:54 exactly is not verified.** **Not in this PR:** the fuel particles and burning. Horizon already spawns `LargeSmoke` for the furnace (`minecarts.rs`, around line 592), so "no particles" is not explained by this change. The front of the furnace is also not touched. ## Vanilla reference - `MinecartFurnace.applyNaturalSlowdown`, `calculateNewPushAlong`, `addFuel`, `addAdditionalSaveData` / `readAdditionalSaveData` - `AbstractMinecart.applyNaturalSlowdown` - `OldMinecartBehavior.moveAlongTrack`, `getMaxSpeed` - `Vec3.projectedOn`, `Vec3.normalize` Constants checked and equal to vanilla: 3600 ticks per coal, max speed 0.2 on land, slowdown 0.96 / 0.997. ## Not verified - No game run. - No parity harness: there is none for minecarts, and no Java oracle was written. The change is a gameplay change without a harness. - Two new unit tests (length kept under gravity, save writes no y); both pass. - `tools/parity.py` (and so `pr_ready`'s harness step) fails on this Windows machine with `ModuleNotFoundError: No module named 'fcntl'`. That is a Unix-only import in the tool, not this change. ## Self-check ``` pr_ready (tools/pr_ready.py --base upstream/main, against upstream/main at 7e42cc8ec, 9 min 46 s) Scope 1 file, +60 -24 Cargo.lock unchanged Public tree ok Python tests 416 passed (1 min 19 s) rustfmt ok (10 s) clippy ok (2 min 14 s) tests: horizon-client 836 passed (5 min 42 s) doc tests 0 passed (12 s) Parity FAIL on Windows: tools/parity.py imports fcntl (see Not verified) ``` 🤖 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:11:00 +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#5213
No description provided.