[PR #1508] [MERGED] Wind charges push a server's players: the burst's packet carries each one's push #3555

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1508
Author: @ludovic111
Created: 10/23/2026
Status: ✅ Merged
Merged: 10/24/2026
Merged by: @ludovic111

Base: main ← Head: fix/st-wind-charge


📝 Commits (3)

  • fe70ff9 Merge remote-tracking branch 'origin/main' into fix/st-wind-charge
  • 4daa91c Wind charges push a server's players: the burst's packet carries each one's push
  • 221545e Merge remote-tracking branch 'origin/main' into fix/st-wind-charge

📊 Changes

7 files changed (+297 additions, -70 deletions)

View changed files

📝 crates/horizon-client/src/game/creatures.rs (+3 -1)
📝 crates/horizon-client/src/game/lan.rs (+2 -0)
📝 crates/horizon-client/src/game/lan_actions.rs (+1 -0)
📝 crates/horizon-client/src/game/lan_particles.rs (+111 -33)
📝 crates/horizon-client/src/game/wind.rs (+117 -36)
📝 crates/horizon-client/src/particles.rs (+10 -0)
📝 tools/lan_e2e.py (+53 -0)

📄 Description

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

Fixes #1386.

What

A wind charge's burst now pushes every player near it, not only the game's own player. LAN guests, and single player's window on its server thread, are launched by a charge thrown at their feet and land unhurt, as in vanilla.

Why

Checked against vanilla 26.3 first:

  • ServerExplosion.hurtEntities pushes every entity in reach and records each player's push in hitPlayers (not for spectators or creative players who fly). The push is scaled by 1 - EXPLOSION_KNOCKBACK_RESISTANCE.
  • ServerLevel.explode then sends ClientboundExplodePacket to every player within 64 blocks, each with its own playerKnockback. The client adds it (ClientPacketListener.handleExplosion → Entity.pushFromExplosion).
  • ServerPlayer.onExplosionHit gives the fall-damage grace for a wind charge's burst.

Horizon's burst (wind_knockback) pushed only self.player. On a server, that is no player at all (server thread) or the host only (in-frame LAN). So the guest's body never moved, and nothing was sent to it. On top of that, a guest's own charge lands during the guest's turn (guest_projectile_hit runs as_guest). In that turn the host holds the other players, so the burst could not reach anyone else either.

How

  • wind_push_player: the player's push, now with explosion knockback resistance, plus onExplosionHit. wind_knockback runs it for the game's player, then for each guest swapped in (as_guest), as explosion_hurt_entities already does for TNT. It returns each guest's push.
  • The packet (lan_wind_burst): ClientboundExplodePacket to every player within 64 blocks (distanceToSqr < 4096), carrying that player's push. It also carries the gust emitter (small or large) and no block particles, as AbstractWindCharge.explode asks. The sound stays the level's, as for TNT. lan_explode (TNT) shares the packet builder and is unchanged on the wire.
  • The client (remote_explode): adds the push to its player's motion. It also draws the packet's own centre particle and skips the block particles when the list is empty. Before, it always drew the TNT emitter.
  • A burst from a guest's turn (their charge landing, their mace's wind burst) is queued (creatures.wind_bursts). It runs once the turn is over: after the projectile hits, and at the end of tick_lan. Then it reaches the host and every guest, the thrower included.
  • Guest flight: enter_guest now sets the body's flying from the guest's abilities. So a flying creative guest is not pushed, here and by TNT.

Evidence

lan_e2e --check wind: each player stands on stone, looks straight down and throws one charge. The check samples its height over 60 ticks, waits for it to land, then reads its client health, its health on the server and the charges left.

in-frame host in-frame guest --server-thread host --server-thread guest
before (stack top fe70ff90b) rose 6.0, landed unhurt rose 0.0 rose 0.0 rose 0.0
after rose 6.1, unhurt rose 6.1, unhurt rose 6.0, unhurt rose 6.0, unhurt

Unhurt means health 20 on the client and on the server, with natural regeneration off, and 1 charge left. Vanilla rises about six blocks (#1386 measured Y 100 → 106.04 in old mode).

These checks still pass in both modes with this change: blast (TNT push and damage, shield), particles (the explosion's particles), deflect, fireball and projectiles.

How tested

On the top of the stack (feat/st-default a4a101ca9, which contains this branch), on the Mac mini:

  • cargo fmt --all -- --check: clean.
  • cargo clippy --workspace --all-targets -- -D warnings: clean.
  • cargo test -p horizon-client --lib --bins: 1064 + 98 + 18 passed.
  • tools/parity.py --changed origin/main: 106/106 passed on the maps head, then 30/30 for the harnesses whose inputs changed after that.
  • tools/lan_e2e.py in the frame and with --server-thread: wind, fishing, maps, body, strikes and cursor pass in both. boats and minecarts pass with --server-thread.
  • A scripted single player session (walk, mine, place, inventory, combat, eating, boats, minecarts, chests, furnaces, beds, chat, signs, books, totems, keep_inventory, fishing, maps, then save and reopen): 48/48 on the server thread and 48/48 with --in-frame.

Stack

This sits on #1476's branch (fix/st-held-use) with origin/main merged in (#1427 added ClientboundExplodePacket). Merge order (#1463 is merged): #1464 → #1465 → #1466 → #1475 → #1476 → this → the fishing PR → the maps PR. The new lan_e2e check goes after the stack's block at the end of the file. It leaves alone the lines #1419 and #1420 change.

Needs Ludovic

A review and a merge, in stack order.

🤖 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/1508 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/23/2026 **Status:** ✅ Merged **Merged:** 10/24/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/st-wind-charge` --- ### 📝 Commits (3) - [`fe70ff9`](https://github.com/horizon-rust/horizon/commit/fe70ff90b43bafd10e81299bfbc28dd582bf93c4) Merge remote-tracking branch 'origin/main' into fix/st-wind-charge - [`4daa91c`](https://github.com/horizon-rust/horizon/commit/4daa91cf520156ccf3dd4051a17da44a966e8fed) Wind charges push a server's players: the burst's packet carries each one's push - [`221545e`](https://github.com/horizon-rust/horizon/commit/221545e92b5b12e476e0cc62cf0e60057004b3b7) Merge remote-tracking branch 'origin/main' into fix/st-wind-charge ### 📊 Changes **7 files changed** (+297 additions, -70 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/creatures.rs` (+3 -1) 📝 `crates/horizon-client/src/game/lan.rs` (+2 -0) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+1 -0) 📝 `crates/horizon-client/src/game/lan_particles.rs` (+111 -33) 📝 `crates/horizon-client/src/game/wind.rs` (+117 -36) 📝 `crates/horizon-client/src/particles.rs` (+10 -0) 📝 `tools/lan_e2e.py` (+53 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Fixes #1386. ## What A wind charge's burst now pushes every player near it, not only the game's own player. LAN guests, and single player's window on its server thread, are launched by a charge thrown at their feet and land unhurt, as in vanilla. ## Why Checked against vanilla 26.3 first: - `ServerExplosion.hurtEntities` pushes every entity in reach and records each player's push in `hitPlayers` (not for spectators or creative players who fly). The push is scaled by `1 - EXPLOSION_KNOCKBACK_RESISTANCE`. - `ServerLevel.explode` then sends `ClientboundExplodePacket` to every player within 64 blocks, each with its own `playerKnockback`. The client adds it (`ClientPacketListener.handleExplosion` → `Entity.pushFromExplosion`). - `ServerPlayer.onExplosionHit` gives the fall-damage grace for a wind charge's burst. Horizon's burst (`wind_knockback`) pushed only `self.player`. On a server, that is no player at all (server thread) or the host only (in-frame LAN). So the guest's body never moved, and nothing was sent to it. On top of that, a guest's own charge lands during the guest's turn (`guest_projectile_hit` runs `as_guest`). In that turn the host holds the other players, so the burst could not reach anyone else either. ## How - **`wind_push_player`:** the player's push, now with explosion knockback resistance, plus `onExplosionHit`. `wind_knockback` runs it for the game's player, then for each guest swapped in (`as_guest`), as `explosion_hurt_entities` already does for TNT. It returns each guest's push. - **The packet** (`lan_wind_burst`): `ClientboundExplodePacket` to every player within 64 blocks (`distanceToSqr < 4096`), carrying that player's push. It also carries the gust emitter (small or large) and no block particles, as `AbstractWindCharge.explode` asks. The sound stays the level's, as for TNT. `lan_explode` (TNT) shares the packet builder and is unchanged on the wire. - **The client** (`remote_explode`): adds the push to its player's motion. It also draws the packet's own centre particle and skips the block particles when the list is empty. Before, it always drew the TNT emitter. - **A burst from a guest's turn** (their charge landing, their mace's wind burst) is queued (`creatures.wind_bursts`). It runs once the turn is over: after the projectile hits, and at the end of `tick_lan`. Then it reaches the host and every guest, the thrower included. - **Guest flight:** `enter_guest` now sets the body's `flying` from the guest's abilities. So a flying creative guest is not pushed, here and by TNT. ## Evidence `lan_e2e --check wind`: each player stands on stone, looks straight down and throws one charge. The check samples its height over 60 ticks, waits for it to land, then reads its client health, its health on the server and the charges left. | | in-frame host | in-frame guest | `--server-thread` host | `--server-thread` guest | |---|---|---|---|---| | **before** (stack top fe70ff90b) | rose 6.0, landed unhurt | **rose 0.0** | **rose 0.0** | **rose 0.0** | | **after** | rose 6.1, unhurt | rose 6.1, unhurt | rose 6.0, unhurt | rose 6.0, unhurt | Unhurt means health 20 on the client and on the server, with natural regeneration off, and 1 charge left. Vanilla rises about six blocks (#1386 measured Y 100 → 106.04 in old mode). These checks still pass in both modes with this change: `blast` (TNT push and damage, shield), `particles` (the explosion's particles), `deflect`, `fireball` and `projectiles`. ## How tested On the top of the stack (`feat/st-default` a4a101ca9, which contains this branch), on the Mac mini: - `cargo fmt --all -- --check`: clean. - `cargo clippy --workspace --all-targets -- -D warnings`: clean. - `cargo test -p horizon-client --lib --bins`: 1064 + 98 + 18 passed. - `tools/parity.py --changed origin/main`: 106/106 passed on the maps head, then 30/30 for the harnesses whose inputs changed after that. - `tools/lan_e2e.py` in the frame and with `--server-thread`: `wind`, `fishing`, `maps`, `body`, `strikes` and `cursor` pass in both. `boats` and `minecarts` pass with `--server-thread`. - A scripted single player session (walk, mine, place, inventory, combat, eating, boats, minecarts, chests, furnaces, beds, chat, signs, books, totems, keep_inventory, fishing, maps, then save and reopen): 48/48 on the server thread and 48/48 with `--in-frame`. ## Stack This sits on #1476's branch (fix/st-held-use) with origin/main merged in (#1427 added `ClientboundExplodePacket`). Merge order (#1463 is merged): #1464 → #1465 → #1466 → #1475 → #1476 → **this** → the fishing PR → the maps PR. The new lan_e2e check goes after the stack's block at the end of the file. It leaves alone the lines #1419 and #1420 change. ## Needs Ludovic A review and a merge, in stack order. 🤖 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 04:10:23 +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#3555
No description provided.