[PR #1671] [MERGED] Multiplayer: keep firework flight duration, boost gliding players #3677

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1671
Author: @socksprox
Created: 10/24/2026
Status: ✅ Merged
Merged: 10/25/2026
Merged by: @ludovic111

Base: main ← Head: fix/elytra-fireworks


📝 Commits (10+)

  • 372f918 Multiplayer: keep firework flight duration, boost gliding players
  • 90ae953 Rockets: collapse the boost's nested if (clippy::collapsible_if)
  • 272e230 Merge main into the elytra fireworks branch
  • c99de82 Merge main into fix/elytra-fireworks: keep firework components beside trim/raw passthrough
  • 1103533 Server: a gliding player's rocket boosts them
  • e7ca664 Server: a guest's boost rocket is theirs
  • c879c22 Merge the branch's own main merge
  • 9ec5f1d Rockets: a guest's boost rocket hurts them; fireworks sent to a server's clients
  • 3d8a8f7 Merge remote-tracking branch 'origin/main' into cg14/pr1671
  • 2364bd3 Merge origin/main into fix/elytra-fireworks

📊 Changes

7 files changed (+271 additions, -8 deletions)

View changed files

📝 crates/horizon-client/src/game/fireworks.rs (+38 -5)
📝 crates/horizon-client/src/game/lan_actions.rs (+2 -0)
📝 crates/horizon-client/src/game/lan_entities.rs (+10 -2)
📝 crates/horizon-client/src/game/remote_projectiles.rs (+53 -1)
📝 crates/horizon-client/src/item_sync.rs (+31 -0)
📝 crates/horizon-client/src/lan/guest.rs (+38 -0)
📝 crates/horizon-protocol/src/item.rs (+99 -0)

📄 Description

🤖 Opened by an AI agent (Devin), not by the user themselves.

Closes #1663.

Summary

Both halves of FireworkRocketEntity were missing on a server:

  • Flight duration: SetCreativeModeSlot encoded only damage, so a creative-picked rocket reached the server without its minecraft:fireworks component — and the wire codec couldn't decode minecraft:fireworks/firework_explosion at all (unsupported item component), so a stack carrying them failed wholesale. Both now follow Fireworks.STREAM_CODEC/FireworkExplosion.STREAM_CODEC (component ids 71/70).
  • Elytra boost: a remote rocket never read DATA_ATTACHED_TO_TARGET, DATA_ID_FIREWORKS_ITEM or DATA_SHOT_AT_ANGLE, so a boost rocket was an inert marker. attached_to now follows EntityDataSerializers.OPTIONAL_UNSIGNED_INT (id + 1, 0 = empty), the firework item feeds its explosion list, and FireworkRocketEntity.tick's isFallFlying boost applies to the gliding local player client-side, as vanilla does.

Vanilla classes followed: Fireworks/FireworkExplosion stream codecs, FireworkRocketEntity synched data + tick, EntityDataSerializers.OPTIONAL_UNSIGNED_INT, FireworkRocketItem.use.

Test plan

  • cargo check, cargo fmt --check, cargo clippy --lib clean
  • cargo test -p horizon-protocol --lib incl. new fireworks_components_round_trip
  • In-game (creative, server-thread world via horizon-ctl): /give a fireworks={flight_duration:3} rocket — the clientbound component now decodes (previously unsupported item component)
  • In-game: elytra glide + firework use boosts — velocity ramped |v| 0.61 → 1.65 toward the look direction across two uses (FireworkRocketEntity.tick's look * 1.5 pull), while fall_flying stayed true
  • Not exercised: a real (non-integrated) server, and the creative-tab click path that sends SetCreativeModeSlot (the encode shares the same codec as the verified decode)

🤖 Generated with Devin


🔄 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/1671 **Author:** [@socksprox](https://github.com/socksprox) **Created:** 10/24/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/elytra-fireworks` --- ### 📝 Commits (10+) - [`372f918`](https://github.com/horizon-rust/horizon/commit/372f918e44a14f984e1359001d4285a5ed3958ef) Multiplayer: keep firework flight duration, boost gliding players - [`90ae953`](https://github.com/horizon-rust/horizon/commit/90ae953747a746cc32b20bc1cf4cf73cd21ce8c0) Rockets: collapse the boost's nested if (clippy::collapsible_if) - [`272e230`](https://github.com/horizon-rust/horizon/commit/272e23037149b1af4e3049e25a61c12df3bb31f3) Merge main into the elytra fireworks branch - [`c99de82`](https://github.com/horizon-rust/horizon/commit/c99de82044c0cc3bb4d0e2c014f2c88b930f79af) Merge main into fix/elytra-fireworks: keep firework components beside trim/raw passthrough - [`1103533`](https://github.com/horizon-rust/horizon/commit/11035336a0115e7fbf4444934500c06ae93c66a4) Server: a gliding player's rocket boosts them - [`e7ca664`](https://github.com/horizon-rust/horizon/commit/e7ca664e01471d6c8e3581c411138d336c1ffff1) Server: a guest's boost rocket is theirs - [`c879c22`](https://github.com/horizon-rust/horizon/commit/c879c22a6a582a7e14f5dc00a243793268dccf78) Merge the branch's own main merge - [`9ec5f1d`](https://github.com/horizon-rust/horizon/commit/9ec5f1ddbc31908eaa27735a01ecd8ba9cf44182) Rockets: a guest's boost rocket hurts them; fireworks sent to a server's clients - [`3d8a8f7`](https://github.com/horizon-rust/horizon/commit/3d8a8f7d028673b7c863933f031174b7b47bc739) Merge remote-tracking branch 'origin/main' into cg14/pr1671 - [`2364bd3`](https://github.com/horizon-rust/horizon/commit/2364bd3504d773b4510ce46851a2cd023aa7ec33) Merge origin/main into fix/elytra-fireworks ### 📊 Changes **7 files changed** (+271 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/fireworks.rs` (+38 -5) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+2 -0) 📝 `crates/horizon-client/src/game/lan_entities.rs` (+10 -2) 📝 `crates/horizon-client/src/game/remote_projectiles.rs` (+53 -1) 📝 `crates/horizon-client/src/item_sync.rs` (+31 -0) 📝 `crates/horizon-client/src/lan/guest.rs` (+38 -0) 📝 `crates/horizon-protocol/src/item.rs` (+99 -0) </details> ### 📄 Description > 🤖 Opened by an AI agent (Devin), not by the user themselves. Closes #1663. ## Summary Both halves of `FireworkRocketEntity` were missing on a server: - **Flight duration:** `SetCreativeModeSlot` encoded only `damage`, so a creative-picked rocket reached the server without its `minecraft:fireworks` component — and the wire codec couldn't decode `minecraft:fireworks`/`firework_explosion` at all (`unsupported item component`), so a stack carrying them failed wholesale. Both now follow `Fireworks.STREAM_CODEC`/`FireworkExplosion.STREAM_CODEC` (component ids 71/70). - **Elytra boost:** a remote rocket never read `DATA_ATTACHED_TO_TARGET`, `DATA_ID_FIREWORKS_ITEM` or `DATA_SHOT_AT_ANGLE`, so a boost rocket was an inert marker. `attached_to` now follows `EntityDataSerializers.OPTIONAL_UNSIGNED_INT` (id + 1, 0 = empty), the firework item feeds its explosion list, and `FireworkRocketEntity.tick`'s `isFallFlying` boost applies to the gliding local player client-side, as vanilla does. Vanilla classes followed: `Fireworks`/`FireworkExplosion` stream codecs, `FireworkRocketEntity` synched data + `tick`, `EntityDataSerializers.OPTIONAL_UNSIGNED_INT`, `FireworkRocketItem.use`. #### Test plan - [x] `cargo check`, `cargo fmt --check`, `cargo clippy --lib` clean - [x] `cargo test -p horizon-protocol --lib` incl. new `fireworks_components_round_trip` - [x] In-game (creative, server-thread world via horizon-ctl): `/give` a `fireworks={flight_duration:3}` rocket — the clientbound component now decodes (previously `unsupported item component`) - [x] In-game: elytra glide + firework use boosts — velocity ramped `|v|` 0.61 → 1.65 toward the look direction across two uses (`FireworkRocketEntity.tick`'s `look * 1.5` pull), while `fall_flying` stayed true - [ ] Not exercised: a real (non-integrated) server, and the creative-tab click path that sends `SetCreativeModeSlot` (the encode shares the same codec as the verified decode) 🤖 Generated with Devin --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:11:21 +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#3677
No description provided.