[PR #7018] [MERGED] Fix two rockets used when right-clicking a block while gliding (LAN guest) #7275

Closed
opened 2026-11-03 06:36:54 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7018
Author: @DUzzL
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: fix/6963-elytra-firework


📝 Commits (1)

  • 29f7d45 Fix a gliding guest's rocket launching on the clicked block as well as boosting

📊 Changes

1 file changed (+18 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/game/fireworks.rs (+18 -1)

📄 Description

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

Fixes #6963

What / why

A LAN guest flying with an elytra and right-clicking a block with a firework rocket sends UseItemOn and then UseItem. The host handled UseItemOn with launch_firework, which did not check gliding, so a second rocket was launched from the clicked point (shooting upward), in addition to the elytra boost from UseItem. launch_firework now passes while the player is fall flying. The single-player path already tries the boost first, so it is unchanged.

Vanilla reference

  • FireworkRocketItem.useOn: returns InteractionResult.PASS when player.isFallFlying().
  • FireworkRocketItem.use: while fall flying spawns the attached rocket and consumes one.
    (Checked with tools/rea_vanilla.py method net.minecraft.world.item.FireworkRocketItem useOn|use.)

Verification

  • Before: code reading of use_item_as_player shows the guest OnBlock path reaches launch_firework while gliding. No in-game run was done.
  • After: unit test game::fireworks::tests::use_on_passes_only_while_gliding passes. A full guest-flow parity harness was not added.

pr_ready --quick result: mod API check failed on xtask mod_api tests (generated_output_is_current, new_hook_placeholder_is_reported_then_filled), a file I did not touch, likely the known Windows CRLF issue. Everything else passed.

pr_ready (tools/pr_ready.py --quick --base upstream/main, against upstream/main at 3819db72c)

Check Result
Scope ✅ 1 files, +18 −1
Cargo.lock ✅ unchanged
Python tests ✅ 611 passed
rustfmt ✅
clippy ✅
tests: horizon-client ✅ 654 passed
mod API up to date ❌ failed (xtask tests, untouched code)
Parity ➖ 91 affected, to run in CI (--quick)

🔄 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/7018 **Author:** [@DUzzL](https://github.com/DUzzL) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/6963-elytra-firework` --- ### 📝 Commits (1) - [`29f7d45`](https://github.com/horizon-rust/horizon/commit/29f7d45ac80947e1397dd707171e33d378f11faa) Fix a gliding guest's rocket launching on the clicked block as well as boosting ### 📊 Changes **1 file changed** (+18 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/fireworks.rs` (+18 -1) </details> ### 📄 Description > 🤖 Opened by DUzzL's AI agent (Claude Code), not by DUzzL himself. Fixes #6963 ## What / why A LAN guest flying with an elytra and right-clicking a block with a firework rocket sends `UseItemOn` and then `UseItem`. The host handled `UseItemOn` with `launch_firework`, which did not check gliding, so a second rocket was launched from the clicked point (shooting upward), in addition to the elytra boost from `UseItem`. `launch_firework` now passes while the player is fall flying. The single-player path already tries the boost first, so it is unchanged. ## Vanilla reference - `FireworkRocketItem.useOn`: returns `InteractionResult.PASS` when `player.isFallFlying()`. - `FireworkRocketItem.use`: while fall flying spawns the attached rocket and consumes one. (Checked with `tools/rea_vanilla.py method net.minecraft.world.item.FireworkRocketItem useOn|use`.) ## Verification - Before: code reading of `use_item_as_player` shows the guest `OnBlock` path reaches `launch_firework` while gliding. No in-game run was done. - After: unit test `game::fireworks::tests::use_on_passes_only_while_gliding` passes. A full guest-flow parity harness was not added. pr_ready `--quick` result: mod API check failed on `xtask` mod_api tests (`generated_output_is_current`, `new_hook_placeholder_is_reported_then_filled`), a file I did not touch, likely the known Windows CRLF issue. Everything else passed. **pr_ready** (`tools/pr_ready.py --quick --base upstream/main`, against upstream/main at 3819db72c) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +18 −1 | | Cargo.lock | ✅ unchanged | | Python tests | ✅ 611 passed | | rustfmt | ✅ | | clippy | ✅ | | tests: horizon-client | ✅ 654 passed | | mod API up to date | ❌ failed (xtask tests, untouched code) | | Parity | ➖ 91 affected, to run in CI (--quick) | --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:36:54 +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#7275
No description provided.