[PR #7514] [MERGED] port_map: object components are parsed and drawn #7638

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

📋 Pull Request Information

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

Base: main ← Head: chore/led2-rest-011


📝 Commits (2)

  • ca74c26 port_map: flip the rows main already implements
  • aa5b198 notes: rewrite the gaps that closed

📊 Changes

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

View changed files

📝 tools/port_map/rest-011.tsv (+8 -8)

📄 Description

tools/port_map/rest-011.tsv: six rows that said object components are never parsed or drawn now name the code that does it, and two notes whose gap has closed are rewritten.

Rows flipped (all missing -> a fn)

  • Component.object -> crates/horizon-client-core/src/component.rs::to_text_with — the object / player / sprite branch keeps the object's JSON on the span's style, and inline_object turns it into the span's fallback text.
  • ObjectContents.resolve -> crates/horizon-client-core/src/component.rs::inline_object — the fallback per object kind: [sprite] for a sprite and [name head] for a player head, which the drawn sprite replaces.
  • ObjectContents.visit -> crates/horizon-client-render/src/hud.rs::draw_inline_object — the sprite or player head is drawn at the text's U+FFFC placeholder span, with the hat toggle and the span's tint.
  • AtlasSprite.toShortName -> crates/horizon-client-core/src/component.rs::inline_object — a minecraft: id drops its namespace, any other id keeps it.
  • AtlasSprite.defaultFallback -> crates/horizon-client-core/src/component.rs::inline_object — [sprite], or [sprite@atlas] when the atlas is not minecraft:blocks.
  • PlayerSprite.defaultFallback -> crates/horizon-client-core/src/component.rs::inline_object — [name head], or [unknown player head] for a profile with no name.

inline_object's own comments name PlayerSprite.defaultFallback and AtlasSprite.defaultFallback, and its tests read [item/porkchop], [Steve head] and [hud/heart/full@gui] back out of Text::plain().

Notes rewritten

  • Varint21FrameDecoder.decode: the zero-length gap is gone. crates/horizon-protocol/src/frame.rs::header returns Frame length cannot be zero for a zero prefix and split cuts the frame at the length it read.
  • HoverEvent.Action.filterForSerialization: show_entity is no longer dropped. component.rs::object_style keeps it on the style as hover_entity, and crates/horizon-client/src/game/chat.rs draws its tooltip (only with advanced item tooltips on, as ChatScreen does).

The file's other missing rows were rechecked and stay: the rate-limit kick (rate_limit_packets_per_second is read, nothing kicks), ComponentUtils.resolveStyle (a selector inside a show_text hover is still resolved to its literal text), the FilterMask rows and the unsigned-content rows (no text filter and no decorator).

Map-check:

PORT_LEDGER_OUT=/tmp/led-led python3 tools/port_ledger.py map-check tools/port_map/rest-011.tsv
150 rows, no problems.

Proven: the Horizon side read at the cites (to_text_with's object branch, inline_object's two fallbacks and its short closure, hud.rs::draw_inline_object, frame.rs::header's zero check, object_style's show_entity arm and chat.rs's hover_entity tooltip); every where cell resolves under map-check; rest-011.tsv stays at 150 rows.

Not proven: no in-game check. Nothing here draws a chat line with an inline sprite or a renamed head, and nothing feeds a zero-length frame to the decoder.


🔄 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/7514 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `chore/led2-rest-011` --- ### 📝 Commits (2) - [`ca74c26`](https://github.com/horizon-rust/horizon/commit/ca74c261760a1b18d093128e2a75607d6717abb6) port_map: flip the rows main already implements - [`aa5b198`](https://github.com/horizon-rust/horizon/commit/aa5b198b4c5112695b766fddb4f354112d1d5604) notes: rewrite the gaps that closed ### 📊 Changes **1 file changed** (+8 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `tools/port_map/rest-011.tsv` (+8 -8) </details> ### 📄 Description `tools/port_map/rest-011.tsv`: six rows that said object components are never parsed or drawn now name the code that does it, and two notes whose gap has closed are rewritten. **Rows flipped** (all `missing` -> a fn) - `Component.object` -> `crates/horizon-client-core/src/component.rs::to_text_with` — the `object` / `player` / `sprite` branch keeps the object's JSON on the span's style, and `inline_object` turns it into the span's fallback text. - `ObjectContents.resolve` -> `crates/horizon-client-core/src/component.rs::inline_object` — the fallback per object kind: `[sprite]` for a sprite and `[name head]` for a player head, which the drawn sprite replaces. - `ObjectContents.visit` -> `crates/horizon-client-render/src/hud.rs::draw_inline_object` — the sprite or player head is drawn at the text's U+FFFC placeholder span, with the hat toggle and the span's tint. - `AtlasSprite.toShortName` -> `crates/horizon-client-core/src/component.rs::inline_object` — a `minecraft:` id drops its namespace, any other id keeps it. - `AtlasSprite.defaultFallback` -> `crates/horizon-client-core/src/component.rs::inline_object` — `[sprite]`, or `[sprite@atlas]` when the atlas is not `minecraft:blocks`. - `PlayerSprite.defaultFallback` -> `crates/horizon-client-core/src/component.rs::inline_object` — `[name head]`, or `[unknown player head]` for a profile with no name. `inline_object`'s own comments name `PlayerSprite.defaultFallback` and `AtlasSprite.defaultFallback`, and its tests read `[item/porkchop]`, `[Steve head]` and `[hud/heart/full@gui]` back out of `Text::plain()`. **Notes rewritten** - `Varint21FrameDecoder.decode`: the zero-length gap is gone. `crates/horizon-protocol/src/frame.rs::header` returns `Frame length cannot be zero` for a zero prefix and `split` cuts the frame at the length it read. - `HoverEvent.Action.filterForSerialization`: `show_entity` is no longer dropped. `component.rs::object_style` keeps it on the style as `hover_entity`, and `crates/horizon-client/src/game/chat.rs` draws its tooltip (only with advanced item tooltips on, as `ChatScreen` does). The file's other `missing` rows were rechecked and stay: the rate-limit kick (`rate_limit_packets_per_second` is read, nothing kicks), `ComponentUtils.resolveStyle` (a selector inside a `show_text` hover is still resolved to its literal text), the `FilterMask` rows and the unsigned-content rows (no text filter and no decorator). Map-check: ``` PORT_LEDGER_OUT=/tmp/led-led python3 tools/port_ledger.py map-check tools/port_map/rest-011.tsv 150 rows, no problems. ``` **Proven:** the Horizon side read at the cites (`to_text_with`'s object branch, `inline_object`'s two fallbacks and its `short` closure, `hud.rs::draw_inline_object`, `frame.rs::header`'s zero check, `object_style`'s `show_entity` arm and `chat.rs`'s `hover_entity` tooltip); every `where` cell resolves under map-check; `rest-011.tsv` stays at 150 rows. **Not proven:** no in-game check. Nothing here draws a chat line with an inline sprite or a renamed head, and nothing feeds a zero-length frame to the decoder. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 07:21:12 +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#7638
No description provided.