[GH-ISSUE #2488] Blocks don't animate in the inventory #641

Closed
opened 2026-11-02 15:40:45 +07:00 by bsakaguchi · 5 comments
Owner

Originally created by @ludovic111 on GitHub (Oct 26, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/2488

What I did: Open up creative inventory
What happened: blocks like sculk arent playing their animation in the inventory preview
What I expected: the blocks to animate the way they do in vanilla
Horizon version: 0.2.76
OS, CPU, GPU: windows x86, ryzen 9 3950x, rtx 4060ti 8gb

Reported on Discord by kevennever#5592 in #horizon-bugs · Discord thread
Tags: rendering

Opened by Kira from Discord. Replies from the reporter in the thread are added here as comments.

Originally created by @ludovic111 on GitHub (Oct 26, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/2488 > What I did: Open up creative inventory > What happened: blocks like sculk arent playing their animation in the inventory preview > What I expected: the blocks to animate the way they do in vanilla > Horizon version: 0.2.76 > OS, CPU, GPU: windows x86, ryzen 9 3950x, rtx 4060ti 8gb Reported on Discord by **kevennever#5592** in #horizon-bugs · [Discord thread](https://discord.com/channels/1559227979002028052/1564372732274147348) Tags: rendering <sub>Opened by Kira from Discord. Replies from the reporter in the thread are added here as comments.</sub><!-- kira -->
bsakaguchi 2026-11-02 15:40:45 +07:00
Author
Owner

@masa-masa-0314 commented on GitHub (Oct 26, 2026):

🤖 Agent: masa-masa-0314's AI agent (ZCode), not by masa-masa-0314 personally. Taking this one. Plan: the shared atlas packs animated block/item sprites as their first frame and only fire re-animates (HudAtlas's fire_animations); generalize that per-sprite frame re-upload to every animated sprite a GUI item samples, following the atlas's tick.

<!-- gh-comment-id:6426421824 --> @masa-masa-0314 commented on GitHub (Oct 26, 2026): 🤖 Agent: masa-masa-0314's AI agent (ZCode), not by masa-masa-0314 personally. Taking this one. Plan: the shared atlas packs animated block/item sprites as their first frame and only fire re-animates (HudAtlas's fire_animations); generalize that per-sprite frame re-upload to every animated sprite a GUI item samples, following the atlas's tick.
Author
Owner

@kacpherek commented on GitHub (Oct 27, 2026):

This looks fixed by #2506 (animated block and item sprites, like sculk, now animate in the inventory and when held).

<!-- gh-comment-id:6434374533 --> @kacpherek commented on GitHub (Oct 27, 2026): This looks fixed by #2506 (animated block and item sprites, like sculk, now animate in the inventory and when held).
Author
Owner

@levzzz5154 commented on GitHub (Oct 27, 2026):

🤖 Agent: levzzz5154's AI agent (Claude Code). Found and fixed: the GUI draws a block item with the HUD atlas's own copy of the block's texture (the HUD has one texture; vanilla's GUI draws the block model with the block atlas), and the atlas packed every animated block and item texture once, as its first frame. Only the four fire textures were kept playing, so sculk, the lanterns, prismarine, magma and the rest of the animated blocks stood still in the inventory while they moved in the world.

The fix (#2645) keeps every animated block and item texture the HUD atlas holds and writes the frame of the tick into it, mixed with the next one when the animation interpolates - the same mix the block atlas does for the world.

$ cargo test -p horizon-client --lib -- hud::
test hud::tests::an_animated_block_texture_animates_in_the_gui ... ok
test result: ok. 15 passed; 0 failed; 0 ignored; 0 measured; 1150 filtered out; finished in 0.44s

The new test fails without the fix (the atlas only collected the fire textures, so the sculk texture was not among the animated ones):

thread 'hud::tests::an_animated_block_texture_animates_in_the_gui' panicked at crates/horizon-client/src/hud.rs:1547:14:
the animated block texture is in the atlas
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 1164 filtered out; finished in 0.04s

Vanilla: SpriteContents.AnimationState.tick advances the frame, needsToDraw says when the atlas has to be redrawn, and drawToAtlas mixes the frame with the next one by (int)(frameProgress * 1000.0F) when the animation interpolates; the GUI's block item is the block model, so it uses those block atlas sprites.

I have no permission to close issues, so I am leaving this open for the maintainer.

<!-- gh-comment-id:6434450825 --> @levzzz5154 commented on GitHub (Oct 27, 2026): 🤖 Agent: levzzz5154's AI agent (Claude Code). Found and fixed: the GUI draws a block item with the HUD atlas's own copy of the block's texture (the HUD has one texture; vanilla's GUI draws the block model with the block atlas), and the atlas packed every animated block and item texture once, as its first frame. Only the four fire textures were kept playing, so sculk, the lanterns, prismarine, magma and the rest of the animated blocks stood still in the inventory while they moved in the world. The fix (#2645) keeps every animated block and item texture the HUD atlas holds and writes the frame of the tick into it, mixed with the next one when the animation interpolates - the same mix the block atlas does for the world. ``` $ cargo test -p horizon-client --lib -- hud:: test hud::tests::an_animated_block_texture_animates_in_the_gui ... ok test result: ok. 15 passed; 0 failed; 0 ignored; 0 measured; 1150 filtered out; finished in 0.44s ``` The new test fails without the fix (the atlas only collected the fire textures, so the sculk texture was not among the animated ones): ``` thread 'hud::tests::an_animated_block_texture_animates_in_the_gui' panicked at crates/horizon-client/src/hud.rs:1547:14: the animated block texture is in the atlas test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 1164 filtered out; finished in 0.04s ``` Vanilla: `SpriteContents.AnimationState.tick` advances the frame, `needsToDraw` says when the atlas has to be redrawn, and `drawToAtlas` mixes the frame with the next one by `(int)(frameProgress * 1000.0F)` when the animation interpolates; the GUI's block item is the block model, so it uses those block atlas sprites. I have no permission to close issues, so I am leaving this open for the maintainer.
Author
Owner

@socksprox commented on GitHub (Oct 27, 2026):

🤖 Agent: Covered by open PR #2742 ("Keep the animated textures on in every graphics preset") — animated block/item textures (including in the inventory) were gated by the graphics preset.

<!-- gh-comment-id:6443391204 --> @socksprox commented on GitHub (Oct 27, 2026): 🤖 Agent: Covered by open PR #2742 ("Keep the animated textures on in every graphics preset") — animated block/item textures (including in the inventory) were gated by the graphics preset.
Author
Owner

@kacpherek commented on GitHub (Oct 27, 2026):

Fixed by #2506: animated blocks such as sculk now animate in the inventory.

<!-- gh-comment-id:6453967485 --> @kacpherek commented on GitHub (Oct 27, 2026): Fixed by #2506: animated blocks such as sculk now animate in the inventory.
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#641
No description provided.