[PR #2563] [MERGED] Keep the thrown-item reproduction for #1762: eggs, pearls and wind charges fly between the server's updates #4429

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

📋 Pull Request Information

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

Base: main ← Head: fix/thrown-projectile-flight


📝 Commits (3)

  • 4c9075a Keep the thrown-item reproduction for #1762
  • 14dac74 Merge remote-tracking branch 'upstream/main' into fix/thrown-projectile-flight
  • b5ec5a7 Merge remote-tracking branch 'upstream/main' into fix/thrown-projectile-flight

📊 Changes

3 files changed (+129 additions, -12 deletions)

View changed files

📝 crates/horizon-client/src/game/remote_projectiles.rs (+74 -5)
📝 tools/lan_e2e.py (+10 -2)
📝 tools/test_remote_fireball_parity.py (+45 -5)

📄 Description

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

What and why

#1762 ("throwable stuff lag/stay in place for a bit": a thrown egg, ender pearl or wind charge hangs in the air in front of you for about a second, and you can still aim it somewhere else) is already fixed on main by #2086 (merged as 1851dc87). A server's client now ticks a projectile itself between the entity tracker's updates, as vanilla's Entity no-op interpolation handler does, instead of only easing towards the server's position - which arrives every 10 ticks for a thrown item, so the projectile stood still for half a second before it moved on.

This pull request keeps the reproduction the issue asked for, so the behaviour cannot regress:

  • tools/test_remote_fireball_parity.py: a new remote-thrown check. A connected client throws an egg, an ender pearl and a wind charge, and samples each one's position twice as often as the server's tracker interval; every sample has to show it further along.
  • crates/horizon-client/src/game/remote_projectiles.rs: the client's projectile tick is now the named remote_projectile_tick, with unit tests for the flight a thrown item has between two server updates (gravity and drag for a throwable, constant speed for a wind charge).
  • tools/lan_e2e.py: the LAN suite can also run headless now (HORIZON_E2E_HEADLESS): the games render offscreen and never pause on the focus loss, or the world stands still on a machine with no focused window.

No game behaviour changes: the client tick is the same code the local game already used, only named and covered.

Fixes #1762

Vanilla reference

  • net/minecraft/world/entity/Entity.java: createInterpolationHandler() returns InterpolationHandler.NO_OP, so a move packet puts a projectile at the server's position at once (moveOrInterpolateTo) and its own client tick flies it on until the next update.
  • net/minecraft/world/entity/projectile/ThrowableProjectile.java: tick() applies applyGravity() (getDefaultGravity() 0.03) and then applyInertia() (getAirDrag() 0.99) before the move - the egg and the ender pearl.
  • net/minecraft/world/entity/projectile/hurtingprojectile/windcharge/AbstractWindCharge.java: accelerationPower 0 and getInertia() 1, so a wind charge keeps its speed.

Self-check

$ cargo test -p horizon-client --bin horizon-client -- a_thrown_item
running 2 tests
test game::remote_projectiles::tests::a_thrown_item_falls_and_drags_like_a_throwable_projectile ... ok
test game::remote_projectiles::tests::a_thrown_item_flies_on_between_the_server_updates ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 125 filtered out; finished in 0.00s
$ python3 tools/parity.py remote_fireball
Building probes...
Probes built in 70s.
Running 1 harnesses, 4 at a time here...
PASS remote_fireball 52s

1 passed, 0 failed in 0.9 min.

The harness ran both host modes (the server on its own thread, and in the window). What the connected client saw, sampled every two ticks while the server's tracker updates every ten:

[lan] remote-fireball: PASS {'positions': [None, 2.756244593409517, 3.840322843844419, 5.189203464861918, 6.77706822533021, 8.580616171652844, 10.57851357674018, 12.75238123502163]}
[lan] remote-thrown: PASS {'minecraft:egg': {'positions': [None, 2.8944989113143196, 5.75146498602591, 8.55157743585074, 11.295967647924057, 13.985744494777114], 'moves': 4}, 'minecraft:ender_pearl': {'positions': [None, 2.9458427174653226, 5.836142840885942, 8.66892599185049, 11.445336758110844, 14.166496950122616], 'moves': 4}, 'minecraft:wind_charge': {'positions': [None, 32.012406793508326, 34.55821647427498, 37.10402615504163, 39.64983583580828, 42.195645516574935], 'moves': 4}}
[lan] remote-fireball: PASS {'positions': [None, 5.322329208559368, 6.26346420901716, 7.483338546930317, 8.954775136896941, 10.65324665934182, 13.57851357674018, 15.75238123502163]}
[lan] remote-thrown: PASS {'minecraft:egg': {'positions': [4.466174850954484, 5.926862841698521, 8.804781747027215, 11.62543006613987, 14.389947483702182, 17.099451004655002], 'moves': 5}, 'minecraft:ender_pearl': {'positions': [2.9908457978043517, 5.927957834531222, 8.806591040903681, 11.627939446469329, 14.39314301876422, 17.10331903997044], 'moves': 5}, 'minecraft:wind_charge': {'positions': [33.49718114035646, 37.18179055473375, 39.6382393125925, 42.094688070451255, 44.55113682831001, 47.00796793191093], 'moves': 5}}

Each thrown item moves on every sample, so it flies on between the server's updates instead of hanging in the air.

🤖 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/2563 **Author:** [@levzzz5154](https://github.com/levzzz5154) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/thrown-projectile-flight` --- ### 📝 Commits (3) - [`4c9075a`](https://github.com/horizon-rust/horizon/commit/4c9075a0729f4c3f5ec47428a87ac252c5566284) Keep the thrown-item reproduction for #1762 - [`14dac74`](https://github.com/horizon-rust/horizon/commit/14dac749e370b00b5d8aee3e976d94294c5b0f7d) Merge remote-tracking branch 'upstream/main' into fix/thrown-projectile-flight - [`b5ec5a7`](https://github.com/horizon-rust/horizon/commit/b5ec5a782f7b159a11871bed68d61acfb846ec8c) Merge remote-tracking branch 'upstream/main' into fix/thrown-projectile-flight ### 📊 Changes **3 files changed** (+129 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/remote_projectiles.rs` (+74 -5) 📝 `tools/lan_e2e.py` (+10 -2) 📝 `tools/test_remote_fireball_parity.py` (+45 -5) </details> ### 📄 Description > 🤖 Opened by levzzz5154's AI agent (Claude Code), not by levzzz5154 himself. ## What and why #1762 ("throwable stuff lag/stay in place for a bit": a thrown egg, ender pearl or wind charge hangs in the air in front of you for about a second, and you can still aim it somewhere else) is already fixed on main by #2086 (merged as 1851dc87). A server's client now ticks a projectile itself between the entity tracker's updates, as vanilla's `Entity` no-op interpolation handler does, instead of only easing towards the server's position - which arrives every 10 ticks for a thrown item, so the projectile stood still for half a second before it moved on. This pull request keeps the reproduction the issue asked for, so the behaviour cannot regress: - `tools/test_remote_fireball_parity.py`: a new `remote-thrown` check. A connected client throws an egg, an ender pearl and a wind charge, and samples each one's position twice as often as the server's tracker interval; every sample has to show it further along. - `crates/horizon-client/src/game/remote_projectiles.rs`: the client's projectile tick is now the named `remote_projectile_tick`, with unit tests for the flight a thrown item has between two server updates (gravity and drag for a throwable, constant speed for a wind charge). - `tools/lan_e2e.py`: the LAN suite can also run headless now (`HORIZON_E2E_HEADLESS`): the games render offscreen and never pause on the focus loss, or the world stands still on a machine with no focused window. No game behaviour changes: the client tick is the same code the local game already used, only named and covered. Fixes #1762 ## Vanilla reference - `net/minecraft/world/entity/Entity.java`: `createInterpolationHandler()` returns `InterpolationHandler.NO_OP`, so a move packet puts a projectile at the server's position at once (`moveOrInterpolateTo`) and its own client tick flies it on until the next update. - `net/minecraft/world/entity/projectile/ThrowableProjectile.java`: `tick()` applies `applyGravity()` (`getDefaultGravity()` 0.03) and then `applyInertia()` (`getAirDrag()` 0.99) before the move - the egg and the ender pearl. - `net/minecraft/world/entity/projectile/hurtingprojectile/windcharge/AbstractWindCharge.java`: `accelerationPower` 0 and `getInertia()` 1, so a wind charge keeps its speed. ## Self-check ``` $ cargo test -p horizon-client --bin horizon-client -- a_thrown_item running 2 tests test game::remote_projectiles::tests::a_thrown_item_falls_and_drags_like_a_throwable_projectile ... ok test game::remote_projectiles::tests::a_thrown_item_flies_on_between_the_server_updates ... ok test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 125 filtered out; finished in 0.00s ``` ``` $ python3 tools/parity.py remote_fireball Building probes... Probes built in 70s. Running 1 harnesses, 4 at a time here... PASS remote_fireball 52s 1 passed, 0 failed in 0.9 min. ``` The harness ran both host modes (the server on its own thread, and in the window). What the connected client saw, sampled every two ticks while the server's tracker updates every ten: ``` [lan] remote-fireball: PASS {'positions': [None, 2.756244593409517, 3.840322843844419, 5.189203464861918, 6.77706822533021, 8.580616171652844, 10.57851357674018, 12.75238123502163]} [lan] remote-thrown: PASS {'minecraft:egg': {'positions': [None, 2.8944989113143196, 5.75146498602591, 8.55157743585074, 11.295967647924057, 13.985744494777114], 'moves': 4}, 'minecraft:ender_pearl': {'positions': [None, 2.9458427174653226, 5.836142840885942, 8.66892599185049, 11.445336758110844, 14.166496950122616], 'moves': 4}, 'minecraft:wind_charge': {'positions': [None, 32.012406793508326, 34.55821647427498, 37.10402615504163, 39.64983583580828, 42.195645516574935], 'moves': 4}} [lan] remote-fireball: PASS {'positions': [None, 5.322329208559368, 6.26346420901716, 7.483338546930317, 8.954775136896941, 10.65324665934182, 13.57851357674018, 15.75238123502163]} [lan] remote-thrown: PASS {'minecraft:egg': {'positions': [4.466174850954484, 5.926862841698521, 8.804781747027215, 11.62543006613987, 14.389947483702182, 17.099451004655002], 'moves': 5}, 'minecraft:ender_pearl': {'positions': [2.9908457978043517, 5.927957834531222, 8.806591040903681, 11.627939446469329, 14.39314301876422, 17.10331903997044], 'moves': 5}, 'minecraft:wind_charge': {'positions': [33.49718114035646, 37.18179055473375, 39.6382393125925, 42.094688070451255, 44.55113682831001, 47.00796793191093], 'moves': 5}} ``` Each thrown item moves on every sample, so it flies on between the server's updates instead of hanging in the air. 🤖 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:17:05 +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#4429
No description provided.