[PR #5809] [MERGED] feat(mods): custom item icon decorations #6513

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5809
Author: @Xmilon
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @levzzz5154

Base: main ← Head: native/item-decorations


📝 Commits (2)

  • c411dcd feat(mods): append custom item icon decorations
  • ccc8d4a Merge main into native/item-decorations; the batch takes GUI units

📊 Changes

3 files changed (+27 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+1 -0)
📝 crates/horizon-client/src/game/native_hooks.rs (+14 -0)
➕ tools/native-hook-fragments/item_decorations.json (+12 -0)

📄 Description

🤖 Opened by Xmilon's AI agent (Codex), not by Xmilon personally.

What and why

Fixes #5807; part of #4953's item decorations beyond the bar. Adds native_item_decorations(stack, x, y, batch) after default item decorations have been painted. Mods can append badges, text or overlays through existing GUI helpers. Coordinates are the icon's top-left in GUI units; the batch is in screen space with the item-local translation popped.

The shared path serves hotbar/carried items, menus, recipe book and tooltip item icons. Existing count, cooldown and native_item_bar behavior is preserved. This is an append-only drawing point, not per-item decorator registration.

Related open PR #5755 fixes unbreakable durability bars earlier in the same method. This PR only appends a call after paint and does not modify its damage calculation or sync path; the two changes compose.

Kind

  • feature: something new for players

Vanilla reference

The existing GuiGraphicsExtractor.itemDecorations path; public RegisterItemDecorationsEvent API listed at https://aldak0.ru/javadoc/26.3.x/net/neoforged/neoforge/client/event/package-summary.html . Pinned-bytecode validation not run locally.

Other projects' code

None; public javadoc only.

Self-check

Client lib/bin/test Clippy, touched-file rustfmt/diff checks, and all four API fragment stamping tests passed. Traced every caller of the shared decoration method. Only a no-op hook and after-paint call are added; no default drawing logic changes. API fragment only. No in-game/screenshot or LAN/dedicated run; CI pending.

🤖 Generated with Codex


🔄 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/5809 **Author:** [@Xmilon](https://github.com/Xmilon) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `native/item-decorations` --- ### 📝 Commits (2) - [`c411dcd`](https://github.com/horizon-rust/horizon/commit/c411dcd917a90d6fdd3f9e08cee72ca5dbd8ec78) feat(mods): append custom item icon decorations - [`ccc8d4a`](https://github.com/horizon-rust/horizon/commit/ccc8d4a9ae55d7c16a3231a235ee5c501d4df76e) Merge main into native/item-decorations; the batch takes GUI units ### 📊 Changes **3 files changed** (+27 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+1 -0) 📝 `crates/horizon-client/src/game/native_hooks.rs` (+14 -0) ➕ `tools/native-hook-fragments/item_decorations.json` (+12 -0) </details> ### 📄 Description > 🤖 Opened by Xmilon's AI agent (Codex), not by Xmilon personally. ## What and why Fixes #5807; part of #4953's item decorations beyond the bar. Adds `native_item_decorations(stack, x, y, batch)` after default item decorations have been painted. Mods can append badges, text or overlays through existing GUI helpers. Coordinates are the icon's top-left in GUI units; the batch is in screen space with the item-local translation popped. The shared path serves hotbar/carried items, menus, recipe book and tooltip item icons. Existing count, cooldown and `native_item_bar` behavior is preserved. This is an append-only drawing point, not per-item decorator registration. Related open PR #5755 fixes unbreakable durability bars earlier in the same method. This PR only appends a call after paint and does not modify its damage calculation or sync path; the two changes compose. ## Kind - [x] feature: something new for players ## Vanilla reference The existing GuiGraphicsExtractor.itemDecorations path; public RegisterItemDecorationsEvent API listed at https://aldak0.ru/javadoc/26.3.x/net/neoforged/neoforge/client/event/package-summary.html . Pinned-bytecode validation not run locally. ## Other projects' code None; public javadoc only. ## Self-check Client lib/bin/test Clippy, touched-file rustfmt/diff checks, and all four API fragment stamping tests passed. Traced every caller of the shared decoration method. Only a no-op hook and after-paint call are added; no default drawing logic changes. API fragment only. No in-game/screenshot or LAN/dedicated run; CI pending. 🤖 Generated with [Codex](https://openai.com/codex/) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:22:01 +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#6513
No description provided.