[PR #2111] [MERGED] Show a hit-back fireball turning at once #4014

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2111
Author: @kacpherek
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: fix/2067-deflect-fireballs


📝 Commits (2)

  • 9e39562 Send a deflected fireball's new direction to the player at once
  • 3114fc6 Merge origin/main into fix/2067-deflect-fireballs

📊 Changes

4 files changed (+13 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game/deflect.rs (+5 -0)
📝 crates/horizon-client/src/game/lan.rs (+3 -0)
📝 crates/horizon-client/src/game/lan_entities.rs (+1 -0)
📝 crates/horizon-client/src/projectiles.rs (+4 -0)

📄 Description

What and why

Hitting a ghast's fireball (or a wind charge) back looked like it did nothing in single player and on a LAN or dedicated server.

The server did turn the fireball, but the window kept drawing it flying on at the player. A fireball only gets its velocity and position sent every 10 ticks, and the turn was not marked to be sent at once. So for up to half a second the fireball seemed to fly through you, then it jumped back to where the server had really turned it. In my test the fireball went several blocks past the player before it snapped back.

Vanilla marks the turn to be sent right away: ProjectileDeflection.AIM_DEFLECT sets needsSync, and ServerEntity then sends the motion in the same tick. Projectile here had no such flag. This adds one, sets it when a fireball or wind charge is deflected, passes it to the entity tracker (the same way mobs already do) and clears it after the tick.

AbstractHurtingProjectile.onDeflection also sets the acceleration power back to 0.1 when the deflection is an attack, so that is set too.

Checked in game (single player, offscreen build, tick rate slowed so the timing is easy to follow): a ghast fired at me, I aimed at the fireball and clicked it at about 3.4 blocks. Before the change the fireball kept moving toward me for several ticks and flew past. After the change its velocity flips to the direction I was looking on the very next update, and it flies away from me.

Fixes #2067.

Vanilla reference

  • ProjectileDeflection.AIM_DEFLECT: sets the movement to the look vector and projectile.needsSync = true.
  • ServerEntity.sendChanges: entity.needsSync sends the position and motion now instead of at updateInterval.
  • AbstractHurtingProjectile.onDeflection(byAttack): accelerationPower = 0.1 for an attack.

Self-check

cargo check -p horizon-client passes.

In game: a ghast's fireball clicked at about 3.4 blocks turns away from the player at once.


🔄 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/2111 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/2067-deflect-fireballs` --- ### 📝 Commits (2) - [`9e39562`](https://github.com/horizon-rust/horizon/commit/9e3956282abf29f49ba9e0e1f0f04b3622a9b900) Send a deflected fireball's new direction to the player at once - [`3114fc6`](https://github.com/horizon-rust/horizon/commit/3114fc66e96dd8f98b208563aca7f74d908667b4) Merge origin/main into fix/2067-deflect-fireballs ### 📊 Changes **4 files changed** (+13 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/deflect.rs` (+5 -0) 📝 `crates/horizon-client/src/game/lan.rs` (+3 -0) 📝 `crates/horizon-client/src/game/lan_entities.rs` (+1 -0) 📝 `crates/horizon-client/src/projectiles.rs` (+4 -0) </details> ### 📄 Description ## What and why Hitting a ghast's fireball (or a wind charge) back looked like it did nothing in single player and on a LAN or dedicated server. The server did turn the fireball, but the window kept drawing it flying on at the player. A fireball only gets its velocity and position sent every 10 ticks, and the turn was not marked to be sent at once. So for up to half a second the fireball seemed to fly through you, then it jumped back to where the server had really turned it. In my test the fireball went several blocks past the player before it snapped back. Vanilla marks the turn to be sent right away: `ProjectileDeflection.AIM_DEFLECT` sets `needsSync`, and `ServerEntity` then sends the motion in the same tick. `Projectile` here had no such flag. This adds one, sets it when a fireball or wind charge is deflected, passes it to the entity tracker (the same way mobs already do) and clears it after the tick. `AbstractHurtingProjectile.onDeflection` also sets the acceleration power back to 0.1 when the deflection is an attack, so that is set too. Checked in game (single player, offscreen build, tick rate slowed so the timing is easy to follow): a ghast fired at me, I aimed at the fireball and clicked it at about 3.4 blocks. Before the change the fireball kept moving toward me for several ticks and flew past. After the change its velocity flips to the direction I was looking on the very next update, and it flies away from me. Fixes #2067. ## Vanilla reference - `ProjectileDeflection.AIM_DEFLECT`: sets the movement to the look vector and `projectile.needsSync = true`. - `ServerEntity.sendChanges`: `entity.needsSync` sends the position and motion now instead of at `updateInterval`. - `AbstractHurtingProjectile.onDeflection(byAttack)`: `accelerationPower = 0.1` for an attack. ## Self-check `cargo check -p horizon-client` passes. In game: a ghast's fireball clicked at about 3.4 blocks turns away from the player at once. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:14:01 +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#4014
No description provided.