[PR #3555] [MERGED] Rockets: a rocket used while gliding no longer raises the off-hand shield #5045

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

📋 Pull Request Information

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

Base: main ← Head: fix-3424


📝 Commits (1)

  • b1d3c9b Rockets: a rocket used while gliding no longer raises the off-hand shield

📊 Changes

1 file changed (+37 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/game/remote.rs (+37 -2)

📄 Description

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

What and why

Fixes #3424

You are gliding with an elytra, with rockets in the main hand and a shield in the off hand. When you use a rocket, it boosts you and the shield goes up too. The shield stays raised as long as the button is held. Vanilla doesn't raise the shield.

FireworkRocketItem.use returns SUCCESS while the player is fall flying, because it launches the rocket that boosts them. Minecraft.startUseItem stops at the first hand whose result is a success, so the off hand never gets a turn. On a server client (single player on its server thread, LAN, multiplayer), remote_use_item decides whether the click ends at the main hand with item_has_use. That list has no firework rocket, so the main hand passed. The off hand's turn then raised the shield. The server got both UseItem packets (main hand, then off hand).

remote_use_item now asks use_ends_click(info, gliding). This is item_has_use, plus a firework rocket while the player is fall flying. On foot a rocket still passes (PASS), as in vanilla. Using it at the sky with a shield in the off hand still raises the shield. The in-frame path (use_item → boost_firework) already returned true here.

Holding the button while gliding now launches a rocket every 4 ticks, as vanilla's handleKeybinds does when isUsingItem() is false. Before, the raised shield kept the use going, so this never happened.

Vanilla reference

  • net.minecraft.world.item.FireworkRocketItem.use: isFallFlying() → spawn the rocket, consume, awardStat → InteractionResult.SUCCESS; otherwise InteractionResult.PASS.
  • net.minecraft.client.Minecraft.startUseItem: for each hand, if (result.consumesAction()) { ...; return; }, so the off hand is tried only after the main hand passes.

Read with javap -c -p on the 26.3 jars. No parity harness covers the client's hand loop. The new unit test checks the rule against the prepared item data.

Test: game::remote::tests::a_rocket_used_while_gliding_ends_the_click loads the prepared items. It checks that a rocket ends the click while gliding and passes on foot, and that a shield and a stick give the same answer either way.

Before (the helper answering item_has_use only, as main does):

test game::remote::tests::a_rocket_used_while_gliding_ends_the_click ... FAILED
thread 'game::remote::tests::a_rocket_used_while_gliding_ends_the_click' panicked at crates\horizon-client\src\game\remote.rs:6686:9:
gliding
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 145 filtered out

After:

test game::remote::tests::a_rocket_used_while_gliding_ends_the_click ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 145 filtered out

Self-check

Run on Windows 11. tools/pr_ready.py stops on Windows at signal.SIGHUP, so I ran the steps by hand:

cargo fmt --all -- --check                                                       ok
cargo clippy -p horizon-client --features mods --all-targets -- -D warnings      ok
cargo test -p horizon-client --features mods --bin horizon-client remote::       4 passed
python tools/check_public_tree.py                                                passed

In game

Default single player (server thread), survival. The player has an elytra, a shield in the off hand and rockets in slot 1. They are teleported to y 300, start gliding with a jump, then hold right-click. I checked the state 0.4 s later.

Before (v0.2.97): the rocket boosts the player (1.67 blocks/tick) and the shield comes up in the off hand. horizon-ctl state reports using: {slot: 40} (the off hand).

After (this branch): the rocket boosts the player, the main hand swings and the shield stays down (using: null). Back on the ground, aiming at the sky, the same click still raises the shield (using: {slot: 40}).

🤖 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/3555 **Author:** [@d3grando](https://github.com/d3grando) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix-3424` --- ### 📝 Commits (1) - [`b1d3c9b`](https://github.com/horizon-rust/horizon/commit/b1d3c9b92bde05a0deedafb481414ea8decf7ae7) Rockets: a rocket used while gliding no longer raises the off-hand shield ### 📊 Changes **1 file changed** (+37 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/remote.rs` (+37 -2) </details> ### 📄 Description > 🤖 Opened by d3grando's AI agent (Claude Code, Claude Opus 5.5), not by d3grando themselves. ## What and why Fixes #3424 You are gliding with an elytra, with rockets in the main hand and a shield in the off hand. When you use a rocket, it boosts you and the shield goes up too. The shield stays raised as long as the button is held. Vanilla doesn't raise the shield. `FireworkRocketItem.use` returns `SUCCESS` while the player is fall flying, because it launches the rocket that boosts them. `Minecraft.startUseItem` stops at the first hand whose result is a success, so the off hand never gets a turn. On a server client (single player on its server thread, LAN, multiplayer), `remote_use_item` decides whether the click ends at the main hand with `item_has_use`. That list has no firework rocket, so the main hand passed. The off hand's turn then raised the shield. The server got both `UseItem` packets (main hand, then off hand). `remote_use_item` now asks `use_ends_click(info, gliding)`. This is `item_has_use`, plus a firework rocket while the player is fall flying. On foot a rocket still passes (`PASS`), as in vanilla. Using it at the sky with a shield in the off hand still raises the shield. The in-frame path (`use_item` → `boost_firework`) already returned true here. Holding the button while gliding now launches a rocket every 4 ticks, as vanilla's `handleKeybinds` does when `isUsingItem()` is false. Before, the raised shield kept the use going, so this never happened. ## Vanilla reference - `net.minecraft.world.item.FireworkRocketItem.use`: `isFallFlying()` → spawn the rocket, `consume`, `awardStat` → `InteractionResult.SUCCESS`; otherwise `InteractionResult.PASS`. - `net.minecraft.client.Minecraft.startUseItem`: for each hand, `if (result.consumesAction()) { ...; return; }`, so the off hand is tried only after the main hand passes. Read with `javap -c -p` on the 26.3 jars. No parity harness covers the client's hand loop. The new unit test checks the rule against the prepared item data. **Test:** `game::remote::tests::a_rocket_used_while_gliding_ends_the_click` loads the prepared items. It checks that a rocket ends the click while gliding and passes on foot, and that a shield and a stick give the same answer either way. Before (the helper answering `item_has_use` only, as main does): ``` test game::remote::tests::a_rocket_used_while_gliding_ends_the_click ... FAILED thread 'game::remote::tests::a_rocket_used_while_gliding_ends_the_click' panicked at crates\horizon-client\src\game\remote.rs:6686:9: gliding test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 145 filtered out ``` After: ``` test game::remote::tests::a_rocket_used_while_gliding_ends_the_click ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 145 filtered out ``` ## Self-check Run on Windows 11. `tools/pr_ready.py` stops on Windows at `signal.SIGHUP`, so I ran the steps by hand: ``` cargo fmt --all -- --check ok cargo clippy -p horizon-client --features mods --all-targets -- -D warnings ok cargo test -p horizon-client --features mods --bin horizon-client remote:: 4 passed python tools/check_public_tree.py passed ``` ## In game Default single player (server thread), survival. The player has an elytra, a shield in the off hand and rockets in slot 1. They are teleported to y 300, start gliding with a jump, then hold right-click. I checked the state 0.4 s later. Before (v0.2.97): the rocket boosts the player (1.67 blocks/tick) and the shield comes up in the off hand. `horizon-ctl state` reports `using: {slot: 40}` (the off hand). After (this branch): the rocket boosts the player, the main hand swings and the shield stays down (`using: null`). Back on the ground, aiming at the sky, the same click still raises the shield (`using: {slot: 40}`). 🤖 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 05:09:51 +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#5045
No description provided.