[PR #6123] [MERGED] Any equipped item with glider and a matching equippable slot glides #6665

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6123
Author: @breachato
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/5773-glider-components


📝 Commits (2)

  • 70c7040 Any equipped item with glider and a matching equippable slot glides
  • 40b7122 Merge main into #6123: gliding_pieces (main's wear and armor walk) asks can_glide_using, the hands count too; a stack without components answers from its item

📊 Changes

5 files changed (+184 additions, -13 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+15 -12)
📝 crates/horizon-client/src/game/prediction.rs (+11 -1)
📝 crates/horizon-client/src/item_sync.rs (+152 -0)
📝 crates/horizon-items/src/item_data.rs (+4 -0)
📝 crates/horizon-protocol/src/item.rs (+2 -0)

📄 Description

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

What and why

Fixes #5773.

A server (here Paper 26.3) can give any item the glider component plus an equippable for a slot, and vanilla then glides with it. Horizon only glided with something in the chest slot whose item has glider by default (the elytra), so custom gliding armour did nothing.

Vanilla's LivingEntity.canGlide walks every EquipmentSlot and asks canGlideUsing(stack, slot): the stack has glider, its equippable slot is the slot it is in, and !nextDamageWillBreak().

Now horizon_client::item_sync::can_glide_using does the same, and both the client (Game::glider_worn) and the LAN host's replay of a guest (game/prediction.rs) check every slot (main hand, off hand, head, chest, legs, feet). The stack's glider and equippable slot come from:

  1. the item's defaults (ItemInfo::glider, equip_slot),
  2. the saved components (StackData::other: a /give ...[glider={},equippable={slot:"chest"}] or a save), including !minecraft:... removals,
  3. the server's component patch (Wire::patch, decoded with WirePatch::decode), which may add or remove either. It is read directly because from_network drops raw components such as equippable (Component::Raw → skipped in components_tag), and vanilla removals aren't kept as ! entries. Its slot is the first VarInt of Equippable.STREAM_CODEC (EquipmentSlot.getId: mainhand 0, feet 1, legs 2, chest 3, head 4, offhand 5, body 6, saddle 7, checked against the 26.3 EquipmentSlot constructor).

Wire::patch is a new accessor that returns the server's patch even after the stack changed locally (glider wear), unlike ItemStack::wire_patch. component::EQUIPPABLE (32) and component::GLIDER (34) are added to the protocol constants (the registry order skip.rs already uses).

Durability still uses the item's default max_damage, as before; a patched max_damage or unbreakable isn't read here.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

  • net.minecraft.world.entity.LivingEntity.canGlide() and canGlideUsing(ItemStack, EquipmentSlot) (26.3 bytecode, javap -c).
  • net.minecraft.world.entity.EquipmentSlot ids; Equippable.STREAM_CODEC field order (as skip.rs::equippable).

Unit tests: item_sync::tests::a_servers_patch_makes_any_item_a_glider (a patch adding glider and a chest equippable, one removing glider) and item_sync::tests::saved_components_make_any_item_a_glider. The existing glide motion tests still pass.

Other projects' code

none

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on DESKTOP-G0M27UC, against upstream/main at 6f30860d0, 9 min 36 s)

Check Result
Scope ✅ 5 files, +184 −14
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 527 passed (3 min 6 s)
rustfmt ✅ (22 s)
clippy ✅ (1 min 36 s)
tests: horizon-client, horizon-items, horizon-protocol ✅ 1927 passed (4 min 15 s)
doc tests ✅ 0 passed (10 s)
content root tests ✅ 20 passed (1 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Not checked in game on this machine (no Paper server or vanilla data here): the unit tests build the patches by hand.

🤖 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/6123 **Author:** [@breachato](https://github.com/breachato) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/5773-glider-components` --- ### 📝 Commits (2) - [`70c7040`](https://github.com/horizon-rust/horizon/commit/70c704053030176cebd7a154e03c5997367aa289) Any equipped item with glider and a matching equippable slot glides - [`40b7122`](https://github.com/horizon-rust/horizon/commit/40b712232e2a6c8c99294681cc384a4ed7fa45da) Merge main into #6123: gliding_pieces (main's wear and armor walk) asks can_glide_using, the hands count too; a stack without components answers from its item ### 📊 Changes **5 files changed** (+184 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+15 -12) 📝 `crates/horizon-client/src/game/prediction.rs` (+11 -1) 📝 `crates/horizon-client/src/item_sync.rs` (+152 -0) 📝 `crates/horizon-items/src/item_data.rs` (+4 -0) 📝 `crates/horizon-protocol/src/item.rs` (+2 -0) </details> ### 📄 Description > 🤖 Opened by breachato's AI agent (Claude Code, Claude Opus 5.5), not by breachato personally. ## What and why Fixes #5773. A server (here Paper 26.3) can give any item the `glider` component plus an `equippable` for a slot, and vanilla then glides with it. Horizon only glided with something in the chest slot whose *item* has `glider` by default (the elytra), so custom gliding armour did nothing. Vanilla's `LivingEntity.canGlide` walks every `EquipmentSlot` and asks `canGlideUsing(stack, slot)`: the stack has `glider`, its `equippable` slot is the slot it is in, and `!nextDamageWillBreak()`. Now `horizon_client::item_sync::can_glide_using` does the same, and both the client (`Game::glider_worn`) and the LAN host's replay of a guest (`game/prediction.rs`) check every slot (main hand, off hand, head, chest, legs, feet). The stack's `glider` and `equippable` slot come from: 1. the item's defaults (`ItemInfo::glider`, `equip_slot`), 2. the saved components (`StackData::other`: a `/give ...[glider={},equippable={slot:"chest"}]` or a save), including `!minecraft:...` removals, 3. the server's component patch (`Wire::patch`, decoded with `WirePatch::decode`), which may add or remove either. It is read directly because `from_network` drops raw components such as `equippable` (`Component::Raw` → skipped in `components_tag`), and vanilla removals aren't kept as `!` entries. Its slot is the first VarInt of `Equippable.STREAM_CODEC` (`EquipmentSlot.getId`: mainhand 0, feet 1, legs 2, chest 3, head 4, offhand 5, body 6, saddle 7, checked against the 26.3 `EquipmentSlot` constructor). `Wire::patch` is a new accessor that returns the server's patch even after the stack changed locally (glider wear), unlike `ItemStack::wire_patch`. `component::EQUIPPABLE` (32) and `component::GLIDER` (34) are added to the protocol constants (the registry order `skip.rs` already uses). Durability still uses the item's default `max_damage`, as before; a patched `max_damage` or `unbreakable` isn't read here. ## Kind - [x] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference - `net.minecraft.world.entity.LivingEntity.canGlide()` and `canGlideUsing(ItemStack, EquipmentSlot)` (26.3 bytecode, `javap -c`). - `net.minecraft.world.entity.EquipmentSlot` ids; `Equippable.STREAM_CODEC` field order (as `skip.rs::equippable`). Unit tests: `item_sync::tests::a_servers_patch_makes_any_item_a_glider` (a patch adding `glider` and a chest `equippable`, one removing `glider`) and `item_sync::tests::saved_components_make_any_item_a_glider`. The existing glide motion tests still pass. ## Other projects' code none ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on DESKTOP-G0M27UC, against upstream/main at 6f30860d0, 9 min 36 s) | Check | Result | | --- | --- | | Scope | ✅ 5 files, +184 −14 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 527 passed (3 min 6 s) | | rustfmt | ✅ (22 s) | | clippy | ✅ (1 min 36 s) | | tests: horizon-client, horizon-items, horizon-protocol | ✅ 1927 passed (4 min 15 s) | | doc tests | ✅ 0 passed (10 s) | | content root tests | ✅ 20 passed (1 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Not checked in game on this machine (no Paper server or vanilla data here): the unit tests build the patches by hand. 🤖 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 06:24:36 +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#6665
No description provided.