[PR #2506] [MERGED] Inventory: animate every animated block and item sprite #4375

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

📋 Pull Request Information

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

Base: main ← Head: fix/animated-inventory-blocks


📝 Commits (4)

  • 024415e Inventory: animate every animated block and item sprite
  • 18b5447 Inventory: frame strips by the mcmeta's frame size
  • 9777b52 Merge #2296 (enchantment glint)
  • be5d7ef Merge main into fix/animated-inventory-blocks

📊 Changes

3 files changed (+194 additions, -56 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+6 -6)
📝 crates/horizon-client/src/gfx.rs (+1 -1)
📝 crates/horizon-client/src/hud.rs (+187 -49)

📄 Description

🤖 Opened by masa-masa-0314's AI agent (ZCode), not by masa-masa-0314 personally.

What and why

Animated blocks (sculk, magma, ...) sit still when their item is held or previewed in a GUI: the shared atlas packs animated block and item textures as their first frame, and only fire re-drew itself (HudAtlas.fire_animations). In the world the same block animates, because the sprite arrays have their own animation path.

Fixes #2488 by generalizing the fire mechanism: the atlas now records every animated block/ and item/ sprite (mcmeta animation) with its frame list, and the renderer re-uploads the current frame into the sprite's atlas rect as the animation ticks — the same per-frame copy the fire sprites did, now for all of them. The mcmeta's interpolate flag mixes the frame into the next one by sub-frame thousandths, the way the world's sprite arrays already blend, so GUI items animate as smoothly as placed blocks. A static-item cache entry stays valid: the cache keeps vertices, and the animation changes the atlas pixels under them.

Vanilla reference

  • net.minecraft.client.renderer.texture.SpriteContents$AnimatedTexture / $AnimationState (26.3): tick-driven frame list from the mcmeta (frames, per-frame time, interpolate), re-uploaded into the stitched atlas per mip.
  • net.minecraft.client.resources.metadata.animation.AnimationMetadataSection: default frame time 1 tick, the frame list may repeat and reorder.
  • assets/minecraft/textures/block/magma.png.mcmeta: frametime 8, interpolate true — the case from the issue's family.

Self-check

pr_ready (tools/pr_ready.py --base upstream/main on DESKTOP-3050AHP, against upstream/main at cb43e3278, 3 min 13 s)

Check Result
Scope ✅ 3 files, +78 −50
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 320 run, FAILED (failures=2, errors=6, skipped=1) (1 min 32 s)
rustfmt ✅ (14 s)
clippy ✅ (3 s)
tests: horizon-client ❌ 1176 passed, 2 failed (15 s)
doc tests ✅ 0 passed (1 min 6 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix

Both failures are pre-existing on this Windows machine and unrelated to this change, which touches no Python:

  • tests: horizon-client: save::tests::session_lock_is_exclusive (the OS reports the lock file held) and crash::tests::stacks_start_at_the_panicking_frame (backtrace path format) also fail on a pristine upstream/main.
  • Python tests: python3 -m unittest discover -s tests on a pristine upstream/main checkout fails with the same tally (failures=2, errors=6, skipped=1).

Screenshots

Not attached: this machine's offscreen renderer produces a blank window, so no usable capture here. Verified in a live client instead: with the fix, a magma block in the hotbar animates continuously (per-0.2s frame captures of the hotbar icon differ, matching vanilla's interpolated atlas), where before this PR its icon held the static first frame.

🤖 Generated with ZCode


🔄 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/2506 **Author:** [@masa-masa-0314](https://github.com/masa-masa-0314) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/animated-inventory-blocks` --- ### 📝 Commits (4) - [`024415e`](https://github.com/horizon-rust/horizon/commit/024415e09dff8438725dfb68dd5fe78bb691ea91) Inventory: animate every animated block and item sprite - [`18b5447`](https://github.com/horizon-rust/horizon/commit/18b544770fa39df42ccd6c708f4b70d417c2cbff) Inventory: frame strips by the mcmeta's frame size - [`9777b52`](https://github.com/horizon-rust/horizon/commit/9777b525b7121fd814577ba7c456ca74f8636a9f) Merge #2296 (enchantment glint) - [`be5d7ef`](https://github.com/horizon-rust/horizon/commit/be5d7ef703ffea487a7d044ad9414ecc299dc289) Merge main into fix/animated-inventory-blocks ### 📊 Changes **3 files changed** (+194 additions, -56 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+6 -6) 📝 `crates/horizon-client/src/gfx.rs` (+1 -1) 📝 `crates/horizon-client/src/hud.rs` (+187 -49) </details> ### 📄 Description > 🤖 Opened by masa-masa-0314's AI agent (ZCode), not by masa-masa-0314 personally. ## What and why Animated blocks (sculk, magma, ...) sit still when their item is held or previewed in a GUI: the shared atlas packs animated block and item textures as their first frame, and only fire re-drew itself (`HudAtlas.fire_animations`). In the world the same block animates, because the sprite arrays have their own animation path. `Fixes #2488` by generalizing the fire mechanism: the atlas now records every animated `block/` and `item/` sprite (mcmeta `animation`) with its frame list, and the renderer re-uploads the current frame into the sprite's atlas rect as the animation ticks — the same per-frame copy the fire sprites did, now for all of them. The mcmeta's `interpolate` flag mixes the frame into the next one by sub-frame thousandths, the way the world's sprite arrays already blend, so GUI items animate as smoothly as placed blocks. A static-item cache entry stays valid: the cache keeps vertices, and the animation changes the atlas pixels under them. ## Vanilla reference - `net.minecraft.client.renderer.texture.SpriteContents$AnimatedTexture` / `$AnimationState` (26.3): tick-driven frame list from the mcmeta (`frames`, per-frame time, `interpolate`), re-uploaded into the stitched atlas per mip. - `net.minecraft.client.resources.metadata.animation.AnimationMetadataSection`: default frame time 1 tick, the frame list may repeat and reorder. - `assets/minecraft/textures/block/magma.png.mcmeta`: `frametime 8`, `interpolate true` — the case from the issue's family. ## Self-check **pr_ready** (`tools/pr_ready.py --base upstream/main` on DESKTOP-3050AHP, against upstream/main at cb43e3278, 3 min 13 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +78 −50 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 320 run, FAILED (failures=2, errors=6, skipped=1) (1 min 32 s) | | rustfmt | ✅ (14 s) | | clippy | ✅ (3 s) | | tests: horizon-client | ❌ 1176 passed, 2 failed (15 s) | | doc tests | ✅ 0 passed (1 min 6 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix | Both failures are pre-existing on this Windows machine and unrelated to this change, which touches no Python: - `tests: horizon-client`: `save::tests::session_lock_is_exclusive` (the OS reports the lock file held) and `crash::tests::stacks_start_at_the_panicking_frame` (backtrace path format) also fail on a pristine `upstream/main`. - Python tests: `python3 -m unittest discover -s tests` on a pristine `upstream/main` checkout fails with the same tally (failures=2, errors=6, skipped=1). ## Screenshots Not attached: this machine's offscreen renderer produces a blank window, so no usable capture here. Verified in a live client instead: with the fix, a magma block in the hotbar animates continuously (per-0.2s frame captures of the hotbar icon differ, matching vanilla's interpolated atlas), where before this PR its icon held the static first frame. 🤖 Generated with ZCode --- <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:43 +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#4375
No description provided.