[PR #1083] [MERGED] Firework tooltips: flight duration and explosions (Fireworks.addToTooltip) #3032

Closed
opened 2026-11-02 16:00:57 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: fix/firework-tooltips


📝 Commits (1)

  • 8f13b2b Firework tooltips: flight duration and explosions (Fireworks.addToTooltip)

📊 Changes

8 files changed (+264 additions, -24 deletions)

View changed files

➕ crates/horizon-client/examples/firework_tooltip_fixture.rs (+29 -0)
📝 crates/horizon-client/src/crafting.rs (+3 -9)
📝 crates/horizon-client/src/game/raids.rs (+1 -7)
📝 crates/horizon-client/src/game/stations.rs (+4 -0)
📝 crates/horizon-client/src/item_tooltip.rs (+96 -8)
📝 crates/horizon-client/src/particles.rs (+19 -0)
➕ mods/horizon/src/test/java/dev/horizonlab/parity/VanillaFireworkTooltipOracle.java (+40 -0)
➕ tools/test_firework_tooltip_parity.py (+72 -0)

📄 Description

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

Fixes #1047. Reported by Visivel on Discord: thanks!

What

Firework rocket and firework star tooltips now match vanilla:

  • Rockets: Flight Duration: N (only when it's above 0; a rocket without the component counts as 1), then each run of equal explosions as Shape or Shape xN (single_star / multiple_stars), with its details indented two spaces.
  • Explosion details (FireworkExplosion.addAdditionalTooltip): colours by dye name (DyeColor.byFireworkColor, else Custom, joined with ", "), Fade to …, Trail, Twinkle.
  • Stars list their explosion. Both honour tooltip_display (minecraft:fireworks / minecraft:firework_explosion hidden). The lines sit where ItemStack.addDetailsToTooltip puts them: after pot decorations, before potion contents. This applies to the inventory and station tooltips.

How

  • item_tooltip.rs: firework_lines, replacing the old flight-only line; game/stations.rs uses it too.
  • particles.rs: one DYE_FIREWORK_COLORS table with names, shared by crafting and raids (they had their own copies).
  • New harness tools/test_firework_tooltip_parity.py: VanillaFireworkTooltipOracle calls the components' addToTooltip on 3000 random rockets and stars (several explosions, runs, dye and custom colours, fades, trail, twinkle, hidden components, missing components). examples/firework_tooltip_fixture.rs prints Horizon's lines with the real en_us language.

Proof

Run on one integration commit holding all five B3 branches, rebased on origin/main 85f65a69, on the Mac mini:

cargo fmt --all --check                                         ok
set -o pipefail; cargo clippy --workspace --all-targets -- -D warnings   exit 0, 0 errors
cargo test -p horizon-client                                    1052 passed, 0 failed
  • tools/test_firework_tooltip_parity.py: 3,000 cases match the pinned client (3,000 output lines).

tools/parity.py --changed origin/main: this branch changes game.rs, so it selects all 325 harnesses. Today's Mac mini (load ~70 from other agents' parity runs) couldn't finish the main baseline within the 2 h job limit; it was still building probes. CI's parity job runs the same --changed selection for this PR on the runner. Known failure on main: mob_ai drowned_* (#290).

Needs Ludovic

Nothing.

🤖 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/1083 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/firework-tooltips` --- ### 📝 Commits (1) - [`8f13b2b`](https://github.com/horizon-rust/horizon/commit/8f13b2be8ca57845941d69da75d7e043ae04ab5b) Firework tooltips: flight duration and explosions (Fireworks.addToTooltip) ### 📊 Changes **8 files changed** (+264 additions, -24 deletions) <details> <summary>View changed files</summary> ➕ `crates/horizon-client/examples/firework_tooltip_fixture.rs` (+29 -0) 📝 `crates/horizon-client/src/crafting.rs` (+3 -9) 📝 `crates/horizon-client/src/game/raids.rs` (+1 -7) 📝 `crates/horizon-client/src/game/stations.rs` (+4 -0) 📝 `crates/horizon-client/src/item_tooltip.rs` (+96 -8) 📝 `crates/horizon-client/src/particles.rs` (+19 -0) ➕ `mods/horizon/src/test/java/dev/horizonlab/parity/VanillaFireworkTooltipOracle.java` (+40 -0) ➕ `tools/test_firework_tooltip_parity.py` (+72 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Fixes #1047. Reported by **Visivel** on Discord: thanks! ## What Firework rocket and firework star tooltips now match vanilla: - Rockets: `Flight Duration: N` (only when it's above 0; a rocket without the component counts as 1), then each run of equal explosions as `Shape` or `Shape xN` (`single_star` / `multiple_stars`), with its details indented two spaces. - Explosion details (`FireworkExplosion.addAdditionalTooltip`): colours by dye name (`DyeColor.byFireworkColor`, else `Custom`, joined with ", "), `Fade to …`, `Trail`, `Twinkle`. - Stars list their explosion. Both honour `tooltip_display` (`minecraft:fireworks` / `minecraft:firework_explosion` hidden). The lines sit where `ItemStack.addDetailsToTooltip` puts them: after pot decorations, before potion contents. This applies to the inventory and station tooltips. ## How - `item_tooltip.rs`: `firework_lines`, replacing the old flight-only line; `game/stations.rs` uses it too. - `particles.rs`: one `DYE_FIREWORK_COLORS` table with names, shared by crafting and raids (they had their own copies). - New harness `tools/test_firework_tooltip_parity.py`: `VanillaFireworkTooltipOracle` calls the components' `addToTooltip` on 3000 random rockets and stars (several explosions, runs, dye and custom colours, fades, trail, twinkle, hidden components, missing components). `examples/firework_tooltip_fixture.rs` prints Horizon's lines with the real `en_us` language. ## Proof Run on one integration commit holding all five B3 branches, rebased on origin/main `85f65a69`, on the Mac mini: ``` cargo fmt --all --check ok set -o pipefail; cargo clippy --workspace --all-targets -- -D warnings exit 0, 0 errors cargo test -p horizon-client 1052 passed, 0 failed ``` - `tools/test_firework_tooltip_parity.py`: **3,000 cases match** the pinned client (3,000 output lines). `tools/parity.py --changed origin/main`: this branch changes `game.rs`, so it selects all 325 harnesses. Today's Mac mini (load ~70 from other agents' parity runs) couldn't finish the main baseline within the 2 h job limit; it was still building probes. CI's parity job runs the same `--changed` selection for this PR on the runner. Known failure on main: mob_ai drowned_* (#290). ## Needs Ludovic Nothing. 🤖 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-02 16:00:57 +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#3032
No description provided.