[PR #2430] [MERGED] Show the missing item tooltip lines in vanilla order #4308

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2430
Author: @kacpherek
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: fix/item-tooltip-lines


📝 Commits (1)

  • 00cb813 Show the missing item tooltip lines in vanilla order

📊 Changes

4 files changed (+498 additions, -98 deletions)

View changed files

📝 crates/horizon-client/src/enchant.rs (+26 -0)
📝 crates/horizon-client/src/game/stations.rs (+200 -53)
📝 crates/horizon-client/src/item_tooltip.rs (+266 -45)
📝 crates/horizon-client/src/items.rs (+6 -0)

📄 Description

What and why

Item tooltips left out many lines vanilla shows. Now they appear, in vanilla order:

  • a custom name is italic, and a signed book shows its title;
  • Unbreakable (blue) and Dyed (gray italic; with F3+H the Color: #RRGGBB line);
  • written book by <author> and the generation;
  • the music disc song, the goat horn instrument;
  • a loaded crossbow's Projectile: lines, with the projectile's own details indented under them;
  • a beehive or bee nest's Bees: n / 3 (the real count) and Honey: n / 5;
  • the potion When Applied: block (Speed, Slowness, Strength, Weakness, Leaping, Luck, Invisibility);
  • enchantment attribute modifiers merged into the attribute lines (Efficiency V: +26 Mining Efficiency under When in Main Hand:; Fire Protection, Respiration and the others the same way);
  • with F3+H, the item id and N component(s) at the end;
  • attribute line colours follow the attribute's sentiment (gravity, scale and waypoint ranges gray; burning time and fall damage negative).

The banner pattern lines and the spawner line also moved to their vanilla positions. The recipe book's lines (item_tooltip::detail_lines) now use the same helpers, so a bee nest lists its bees there too and a music disc uses the jukebox song key.

Cause: Game::stack_tooltip only built a subset of ItemStack.getTooltipLines. Fix: small helpers in item_tooltip.rs for each component line, called from stack_tooltip in vanilla order; Enchantments::modifier_rows gives the enchantment modifiers; ItemInfo.components holds an item's default component ids for the component count. Hidden components in tooltip_display are respected.

Vanilla reference

  • ItemStack.getTooltipLines, getStyledHoverName, getCustomName, addDetailsToTooltipComponents, addDetailsToTooltipTail, addAttributeTooltips, forEachModifier
  • InstrumentComponent, Bees, WrittenBookContent, ChargedProjectiles.addToTooltip / addProjectileTooltip, PotionContents.addPotionTooltip, JukeboxPlayable, DyedItemColor, BlockItemStateProperties
  • EnchantmentHelper.forEachModifier, ItemAttributeModifiers.Display.Default.apply, Attribute.Sentiment.getStyle

Self-check

cargo check -p horizon-client passes.


🔄 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/2430 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/item-tooltip-lines` --- ### 📝 Commits (1) - [`00cb813`](https://github.com/horizon-rust/horizon/commit/00cb813dc88ff067912e574ae02c7fcbc6cd10b3) Show the missing item tooltip lines in vanilla order ### 📊 Changes **4 files changed** (+498 additions, -98 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/enchant.rs` (+26 -0) 📝 `crates/horizon-client/src/game/stations.rs` (+200 -53) 📝 `crates/horizon-client/src/item_tooltip.rs` (+266 -45) 📝 `crates/horizon-client/src/items.rs` (+6 -0) </details> ### 📄 Description ## What and why Item tooltips left out many lines vanilla shows. Now they appear, in vanilla order: - a custom name is italic, and a signed book shows its title; - `Unbreakable` (blue) and `Dyed` (gray italic; with F3+H the `Color: #RRGGBB` line); - written book `by <author>` and the generation; - the music disc song, the goat horn instrument; - a loaded crossbow's `Projectile:` lines, with the projectile's own details indented under them; - a beehive or bee nest's `Bees: n / 3` (the real count) and `Honey: n / 5`; - the potion `When Applied:` block (Speed, Slowness, Strength, Weakness, Leaping, Luck, Invisibility); - enchantment attribute modifiers merged into the attribute lines (Efficiency V: `+26 Mining Efficiency` under `When in Main Hand:`; Fire Protection, Respiration and the others the same way); - with F3+H, the item id and `N component(s)` at the end; - attribute line colours follow the attribute's sentiment (gravity, scale and waypoint ranges gray; burning time and fall damage negative). The banner pattern lines and the spawner line also moved to their vanilla positions. The recipe book's lines (`item_tooltip::detail_lines`) now use the same helpers, so a bee nest lists its bees there too and a music disc uses the jukebox song key. Cause: `Game::stack_tooltip` only built a subset of `ItemStack.getTooltipLines`. Fix: small helpers in `item_tooltip.rs` for each component line, called from `stack_tooltip` in vanilla order; `Enchantments::modifier_rows` gives the enchantment modifiers; `ItemInfo.components` holds an item's default component ids for the component count. Hidden components in `tooltip_display` are respected. ## Vanilla reference - `ItemStack.getTooltipLines`, `getStyledHoverName`, `getCustomName`, `addDetailsToTooltipComponents`, `addDetailsToTooltipTail`, `addAttributeTooltips`, `forEachModifier` - `InstrumentComponent`, `Bees`, `WrittenBookContent`, `ChargedProjectiles.addToTooltip` / `addProjectileTooltip`, `PotionContents.addPotionTooltip`, `JukeboxPlayable`, `DyedItemColor`, `BlockItemStateProperties` - `EnchantmentHelper.forEachModifier`, `ItemAttributeModifiers.Display.Default.apply`, `Attribute.Sentiment.getStyle` ## Self-check `cargo check -p horizon-client` passes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:16:14 +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#4308
No description provided.