[PR #5547] [MERGED] lan_e2e: punch vehicles at full charge, so they break #6347

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5547
Author: @navinor
Created: 10/31/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/lan-e2e-vehicle-punches


📝 Commits (1)

  • 968d157 lan_e2e: punch vehicles at full charge, so they break

📊 Changes

1 file changed (+9 additions, -5 deletions)

View changed files

📝 tools/lan_e2e.py (+9 -5)

📄 Description

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

What and why

Fixes #5526: tools/lan_e2e.py --check boats and --check minecarts fail on main at their last step, "ten hits left the boat/minecart in place".

break_vehicle punches ten times, two ticks apart. Since bd09f8b03 the punches run in one horizon-ctl script, so they really are two ticks apart; before, one horizon-ctl call per punch left longer gaps by accident. At that pace vanilla doesn't break the vehicle either:

  • Player.attack scales a hit by 0.2 + s² × 0.8, s = (attackStrengthTicker + 0.5) / (20 / attack speed). A fist (attack speed 4) charges in 5 ticks, so a punch 2 ticks after the last has s = 0.5 and does 0.4.
  • VehicleEntity.hurtServer adds damage × 10 and destroys past 40; AbstractBoat.tick and AbstractMinecart.tick take 1 off a tick.
  • So 10 for the first punch, then +4 −2 a punch: 28 after ten. It would take 17.

The punches are now 5 ticks apart, fully charged, twelve of them, still in one script: 10, then +10 −5 a punch, past 40 on the 8th. wait counts the client's ticks, so the server may see 4 or 6 between two punches; either still nets at least 4 (8.5 − 4, or 10 − 6). The docstring says why.

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

Player.attack, Player.getAttackStrengthScale, Player.getCurrentItemAttackStrengthDelay, VehicleEntity.hurtServer, AbstractBoat.tick, AbstractMinecart.tick.

Other projects' code

none

Self-check

pr_ready (tools/pr_ready.py --quick on Aaron, against origin/main at a4873dec4, 1 min 32 s)

Check Result
Scope ✅ 2 files, +14 −5
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 510 passed (1 min 31 s)
rustfmt ➖ no Rust change
clippy ➖ no Rust change
tests ➖ no crate touched
doc tests ➖ no crate touched
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 skip-release

python3 tools/lan_e2e.py --check boats --check minecarts, fast builds, Windows 11:

  • main at 6335ad584: both fail, "ten hits left the boat in place" and "ten hits left the minecart in place";
  • this branch (main at a4873dec4): both pass, for the host (single player server thread) and the guest. Each boat was paddled 8.81 blocks first, and both boats and both minecarts broke.

🤖 Generated with OpenCode


🔄 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/5547 **Author:** [@navinor](https://github.com/navinor) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/lan-e2e-vehicle-punches` --- ### 📝 Commits (1) - [`968d157`](https://github.com/horizon-rust/horizon/commit/968d157f9746f41b83b590cc560a9fb1b1cff0c0) lan_e2e: punch vehicles at full charge, so they break ### 📊 Changes **1 file changed** (+9 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `tools/lan_e2e.py` (+9 -5) </details> ### 📄 Description > 🤖 Opened by navinor's AI agent (OpenCode, Claude Opus 5.5), not by navinor personally. ## What and why Fixes #5526: `tools/lan_e2e.py --check boats` and `--check minecarts` fail on main at their last step, "ten hits left the boat/minecart in place". `break_vehicle` punches ten times, two ticks apart. Since bd09f8b03 the punches run in one `horizon-ctl` script, so they really are two ticks apart; before, one `horizon-ctl` call per punch left longer gaps by accident. At that pace vanilla doesn't break the vehicle either: - `Player.attack` scales a hit by `0.2 + s² × 0.8`, `s = (attackStrengthTicker + 0.5) / (20 / attack speed)`. A fist (attack speed 4) charges in 5 ticks, so a punch 2 ticks after the last has `s = 0.5` and does 0.4. - `VehicleEntity.hurtServer` adds `damage × 10` and destroys past 40; `AbstractBoat.tick` and `AbstractMinecart.tick` take 1 off a tick. - So 10 for the first punch, then +4 −2 a punch: 28 after ten. It would take 17. The punches are now 5 ticks apart, fully charged, twelve of them, still in one script: 10, then +10 −5 a punch, past 40 on the 8th. `wait` counts the client's ticks, so the server may see 4 or 6 between two punches; either still nets at least 4 (8.5 − 4, or 10 − 6). The docstring says why. ## 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 - [x] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference `Player.attack`, `Player.getAttackStrengthScale`, `Player.getCurrentItemAttackStrengthDelay`, `VehicleEntity.hurtServer`, `AbstractBoat.tick`, `AbstractMinecart.tick`. ## Other projects' code none ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on Aaron, against origin/main at a4873dec4, 1 min 32 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +14 −5 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 510 passed (1 min 31 s) | | rustfmt | ➖ no Rust change | | clippy | ➖ no Rust change | | tests | ➖ no crate touched | | doc tests | ➖ no crate touched | | 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 | `skip-release` | `python3 tools/lan_e2e.py --check boats --check minecarts`, fast builds, Windows 11: - main at `6335ad584`: both fail, "ten hits left the boat in place" and "ten hits left the minecart in place"; - this branch (main at `a4873dec4`): both pass, for the host (single player server thread) and the guest. Each boat was paddled 8.81 blocks first, and both boats and both minecarts broke. 🤖 Generated with [OpenCode](https://opencode.ai) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:19:03 +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#6347
No description provided.