[PR #3085] [MERGED] Thrown pearls and other projectiles stop diving at random #4793

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

📋 Pull Request Information

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

Base: main ← Head: fix/throws-use-known-movement


📝 Commits (2)

  • cd2fea1 Throw projectiles with the thrower's known movement
  • c2c364f Merge main into fix/throws-use-known-movement

📊 Changes

7 files changed (+21 additions, -12 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+3 -4)
📝 crates/horizon-client/src/game/creatures.rs (+4 -1)
📝 crates/horizon-client/src/game/lan_actions.rs (+7 -0)
📝 crates/horizon-client/src/game/potions.rs (+1 -1)
📝 crates/horizon-client/src/game/spear.rs (+1 -1)
📝 crates/horizon-client/src/game/trident.rs (+3 -4)
📝 crates/horizon-client/src/game/wind.rs (+2 -1)

📄 Description

What and why

  • Reported on Discord: some ender pearls fly oddly downward, others fine.
  • Projectile.shootFromRotation adds the thrower's movement to the projectile: getKnownMovement(), which for a ServerPlayer is the move its client last sent (zero after a tick without one), with the vertical part only when not on the ground.
  • Horizon added self.player.velocity instead. On the server thread a player is a guest whose server-side velocity is not its movement: it keeps whatever the server last put there (knockback, an explosion, a fall). So some throws got a leftover downward push and dove.
  • Every player throw now adds known_player_movement() (the same helper the spear uses: the client's last move, or the mount's while riding): ender pearls, snowballs, eggs, splash and lingering potions, tridents, wind charges and arrows. A guest's UseItem refreshes it from the move the client just sent, as the spear's jab already does.

Vanilla reference

Projectile.java:183-190 (shootFromRotation), ServerPlayer.java:2405-2418 (getKnownMovement), ServerGamePacketListenerImpl.java:2300-2316 (known movement from the move packets, reset at tick end).

Self-check

fmt passes. Built and tested by this pull request's checks. Not run in game.


🔄 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/3085 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/throws-use-known-movement` --- ### 📝 Commits (2) - [`cd2fea1`](https://github.com/horizon-rust/horizon/commit/cd2fea1f029c1a076d445912ee95b8a17142b890) Throw projectiles with the thrower's known movement - [`c2c364f`](https://github.com/horizon-rust/horizon/commit/c2c364f195a69c62577ccaa867a9df6c3a6072d8) Merge main into fix/throws-use-known-movement ### 📊 Changes **7 files changed** (+21 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+3 -4) 📝 `crates/horizon-client/src/game/creatures.rs` (+4 -1) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+7 -0) 📝 `crates/horizon-client/src/game/potions.rs` (+1 -1) 📝 `crates/horizon-client/src/game/spear.rs` (+1 -1) 📝 `crates/horizon-client/src/game/trident.rs` (+3 -4) 📝 `crates/horizon-client/src/game/wind.rs` (+2 -1) </details> ### 📄 Description ## What and why - Reported on Discord: some ender pearls fly oddly downward, others fine. - `Projectile.shootFromRotation` adds the thrower's movement to the projectile: `getKnownMovement()`, which for a `ServerPlayer` is the move its client last sent (zero after a tick without one), with the vertical part only when not on the ground. - Horizon added `self.player.velocity` instead. On the server thread a player is a guest whose server-side velocity is not its movement: it keeps whatever the server last put there (knockback, an explosion, a fall). So some throws got a leftover downward push and dove. - Every player throw now adds `known_player_movement()` (the same helper the spear uses: the client's last move, or the mount's while riding): ender pearls, snowballs, eggs, splash and lingering potions, tridents, wind charges and arrows. A guest's `UseItem` refreshes it from the move the client just sent, as the spear's jab already does. ## Vanilla reference `Projectile.java:183-190` (`shootFromRotation`), `ServerPlayer.java:2405-2418` (`getKnownMovement`), `ServerGamePacketListenerImpl.java:2300-2316` (known movement from the move packets, reset at tick end). ## Self-check fmt passes. Built and tested by this pull request's checks. Not run in game. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:07:59 +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#4793
No description provided.