[PR #6922] [MERGED] Wind bursts find their targets through the entity walk #7197

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

📋 Pull Request Information

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

Base: main ← Head: refactor/entity-walk-wind


📝 Commits (5)

  • 655e90a Entity interface 5: move wind onto the walk (#6540)
  • 8ea6879 Merge branch 'fix/pearl-test-drag' into refactor/entity-walk-wind
  • 44dce55 Merge remote-tracking branch 'origin/main' into refactor/entity-walk-wind
  • b5d5127 Merge origin/main into refactor/entity-walk-wind
  • 18d82b7 Merge origin/main into refactor/entity-walk-wind

📊 Changes

2 files changed (+98 additions, -214 deletions)

View changed files

📝 crates/horizon-client/src/game/entity.rs (+75 -0)
📝 crates/horizon-client/src/game/wind.rs (+23 -214)

📄 Description

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

Stacks on #6734: the commits up to its head belong to that PR, and this slice is the rest. A PR's base has to be a branch in this repo and ours are on a fork, so this targets main, and the diff shrinks to the slice once #6734 merges.

Part of #6509, slice 5 (#6540), stacked on slice 3 (#6538). Moves the wind burst's push onto for_each_entity.

wind_knockback in wind.rs took each of 11 lists with mem::take and pushed it with its own copy of the same arithmetic (one closure for projectiles and TNT, another for the rest, and a third loop for mobs). Now one loop over all entities does the push, and each kind states only where it differs:

  • ignores_explosion(Gust) for what a kind sits out: a dead mob, a stuck projectile or a wind charge, a trident in the ground, items and visible armor stands unless the burst affects block-like entities (a mace's), boats and minecarts for a breeze's burst with mob griefing off.
  • explosion_target() for the box exposure is measured through and the eye height the direction is taken from (default: eyes at 0.85 of the box, as Entity).

Rockets and tridents (#6647) are covered by the same loop, so a kind added to entity_lists! joins the wind without touching wind.rs. Behaviour is unchanged: the same arithmetic in the same form, so velocities are identical bit for bit in the scenes below. No dyn, nothing allocated per walk (the lists are moved out of Game and back, as before). wind.rs shrinks by 188 lines and entity.rs grows by 155; the diff is 395 changed lines.

Fixes #6540

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

ServerExplosion.hurtEntities calls Entity.pushFromExplosion on every entity in reach, after Entity.ignoreExplosion. Overrides, read with tools/rea_vanilla.py on the 26.3 server: VehicleEntity.ignoreExplosion is explosion.getIndirectSourceEntity() instanceof Mob && !MOB_GRIEFING; no other class in the survey of 54 entity classes declares it.

Side by side, wind_walk (a wind charge into the floor beside each of trident, rocket, arrow, TNT, boat, minecart, falling block, orb, snowball, pig and item, mob griefing on) and wind_breeze (the same with a breeze's charge and mob griefing off, where vehicles must sit out): the build before and the build after give byte-identical results, 99 probed values per scene. Both match the real server on 80 of 99; the 19 that differ are the same before and after. They are the position and motion of the arrow, TNT, falling block, orb and snowball after the burst (Horizon pushes these from their feet where the real server pushes from a higher point; this slice leaves that as is), and the trident, which does not exist in Horizon at all when summoned this way. Those are existing gaps and not part of this change.

Tick cost

Time spent in wind_knockback per burst, 2000 entities of eight kinds spread out of reach plus 16 in reach, 30 bursts per run, 6 interleaved runs per build, headless, machine load about 10 to 15 (so noisy). Median of each run's median, microseconds:

before after
per burst 137.0 134.6
range of run medians 120.5 to 165.4 112.2 to 168.7

No measurable difference: the ranges overlap almost entirely and the load varied more than the gap. Raw runs are in the bench log.

Harnesses

Run locally, the ones that cover wind: CI runs the full --changed set on the merge with main.

arrow_wind_charge, mace, pearl_wind_charge and dispenser pass. remote_fireball could not run here (the game exited before opening its control socket, twice, in this environment), so it is left to CI.

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 769a7f368, 3 min 55 s)

Check Result
Scope ⚠️ 5 files, +367 −367; 734 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 610 passed (28 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 ✅ (1 min 34 s)
tests: horizon-client ✅ 651 passed (1 min 31 s)
doc tests ✅ 0 passed (1 s)
content root tests ➖ content root untouched
mod API up to date ✅ (13 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 273 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, armor_stand_frost, armor_stand_turtle_egg, arrow, arrow_wind_charge, attribute_health, attribute_map_queries, attribute, attribute_updates and 261 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/6922 **Author:** [@HrafnaValkyrja](https://github.com/HrafnaValkyrja) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `refactor/entity-walk-wind` --- ### 📝 Commits (5) - [`655e90a`](https://github.com/horizon-rust/horizon/commit/655e90a041e0257e3d0360098346a36ebde6250d) Entity interface 5: move wind onto the walk (#6540) - [`8ea6879`](https://github.com/horizon-rust/horizon/commit/8ea68796ef143d164e612d50478bf958a1ee5041) Merge branch 'fix/pearl-test-drag' into refactor/entity-walk-wind - [`44dce55`](https://github.com/horizon-rust/horizon/commit/44dce559b1346609c35aaa2ff538601eeccbdf41) Merge remote-tracking branch 'origin/main' into refactor/entity-walk-wind - [`b5d5127`](https://github.com/horizon-rust/horizon/commit/b5d5127455c9cb9831c28289c97c7e350bf146c4) Merge origin/main into refactor/entity-walk-wind - [`18d82b7`](https://github.com/horizon-rust/horizon/commit/18d82b7fa5e31cf9214cbd54ab1c4304a837bc10) Merge origin/main into refactor/entity-walk-wind ### 📊 Changes **2 files changed** (+98 additions, -214 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/entity.rs` (+75 -0) 📝 `crates/horizon-client/src/game/wind.rs` (+23 -214) </details> ### 📄 Description > 🤖 Opened by Valkyrie's AI agent (Claude Code, Opus 5.5), not by Valkyrie herself. Stacks on #6734: the commits up to its head belong to that PR, and this slice is the rest. A PR's base has to be a branch in this repo and ours are on a fork, so this targets main, and the diff shrinks to the slice once #6734 merges. Part of #6509, slice 5 (#6540), stacked on slice 3 (#6538). Moves the wind burst's push onto `for_each_entity`. `wind_knockback` in `wind.rs` took each of 11 lists with `mem::take` and pushed it with its own copy of the same arithmetic (one closure for projectiles and TNT, another for the rest, and a third loop for mobs). Now one loop over all entities does the push, and each kind states only where it differs: - `ignores_explosion(Gust)` for what a kind sits out: a dead mob, a stuck projectile or a wind charge, a trident in the ground, items and visible armor stands unless the burst affects block-like entities (a mace's), boats and minecarts for a breeze's burst with mob griefing off. - `explosion_target()` for the box exposure is measured through and the eye height the direction is taken from (default: eyes at 0.85 of the box, as `Entity`). Rockets and tridents (#6647) are covered by the same loop, so a kind added to `entity_lists!` joins the wind without touching `wind.rs`. Behaviour is unchanged: the same arithmetic in the same form, so velocities are identical bit for bit in the scenes below. No `dyn`, nothing allocated per walk (the lists are moved out of `Game` and back, as before). `wind.rs` shrinks by 188 lines and `entity.rs` grows by 155; the diff is 395 changed lines. Fixes #6540 ## 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 `ServerExplosion.hurtEntities` calls `Entity.pushFromExplosion` on every entity in reach, after `Entity.ignoreExplosion`. Overrides, read with `tools/rea_vanilla.py` on the 26.3 server: `VehicleEntity.ignoreExplosion` is `explosion.getIndirectSourceEntity() instanceof Mob && !MOB_GRIEFING`; no other class in the survey of 54 entity classes declares it. Side by side, `wind_walk` (a wind charge into the floor beside each of trident, rocket, arrow, TNT, boat, minecart, falling block, orb, snowball, pig and item, mob griefing on) and `wind_breeze` (the same with a breeze's charge and mob griefing off, where vehicles must sit out): the build before and the build after give byte-identical results, 99 probed values per scene. Both match the real server on 80 of 99; the 19 that differ are the same before and after. They are the position and motion of the arrow, TNT, falling block, orb and snowball after the burst (Horizon pushes these from their feet where the real server pushes from a higher point; this slice leaves that as is), and the trident, which does not exist in Horizon at all when summoned this way. Those are existing gaps and not part of this change. ## Tick cost Time spent in `wind_knockback` per burst, 2000 entities of eight kinds spread out of reach plus 16 in reach, 30 bursts per run, 6 interleaved runs per build, headless, machine load about 10 to 15 (so noisy). Median of each run's median, microseconds: | | before | after | |---|---|---| | per burst | 137.0 | 134.6 | | range of run medians | 120.5 to 165.4 | 112.2 to 168.7 | No measurable difference: the ranges overlap almost entirely and the load varied more than the gap. Raw runs are in the bench log. ## Harnesses Run locally, the ones that cover wind: CI runs the full `--changed` set on the merge with main. arrow_wind_charge, mace, pearl_wind_charge and dispenser pass. remote_fireball could not run here (the game exited before opening its control socket, twice, in this environment), so it is left to CI. 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 769a7f368, 3 min 55 s) | Check | Result | | --- | --- | | Scope | ⚠️ 5 files, +367 −367; 734 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 610 passed (28 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 | ✅ (1 min 34 s) | | tests: horizon-client | ✅ 651 passed (1 min 31 s) | | doc tests | ✅ 0 passed (1 s) | | content root tests | ➖ content root untouched | | mod API up to date | ✅ (13 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 273 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, armor_stand_frost, armor_stand_turtle_egg, arrow, arrow_wind_charge, attribute_health, attribute_map_queries, attribute, attribute_updates and 261 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:35:34 +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#7197
No description provided.