[PR #6219] [MERGED] ETF blinking textures: mobs blink with their pack's _blink frames #6725

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6219
Author: @some-du6e
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: optifine/etf-blink


📝 Commits (10+)

  • e190856 OptiFine emissive textures: mobs' _e overlays glow at full brightness
  • 352b2d0 OptiFine emissive textures: parenthesise the test's light value
  • d4fde1a ETF blinking textures: mobs blink with their pack's _blink frames
  • b1a756e OptiFine random entities: vanilla on a miss, custom-model and warden textures choose too
  • ead5f88 Merge main into optifine/etf-emissive
  • 5eac2ed Merge main into optifine/etf-blink
  • d1df8b8 Merge optifine/etf-fixes into optifine/etf-emissive
  • afe44e4 Merge optifine/etf-emissive into optifine/etf-blink
  • 12aa338 OptiFine random entities: budget every variant, one cem key, and a miss answered once a check
  • 509bf3c OptiFine emissive textures: players' armour glows too

📊 Changes

14 files changed (+1498 additions, -129 deletions)

View changed files

📝 crates/horizon-client-render/src/hud.rs (+132 -3)
📝 crates/horizon-client/src/game/armor_stands.rs (+19 -5)
📝 crates/horizon-client/src/game/packs.rs (+17 -4)
📝 crates/horizon-client/src/game/perspective.rs (+3 -1)
📝 crates/horizon-client/src/game/random_textures.rs (+8 -6)
📝 crates/horizon-client/src/mobs/cem.rs (+2 -0)
📝 crates/horizon-client/src/mobs/data.rs (+13 -3)
📝 crates/horizon-client/src/mobs/random_textures.rs (+324 -80)
📝 crates/horizon-client/src/mobs/render.rs (+454 -19)
➕ crates/horizon-optifine/src/blink.rs (+224 -0)
➕ crates/horizon-optifine/src/emissive.rs (+265 -0)
📝 crates/horizon-optifine/src/lib.rs (+5 -2)
📝 crates/horizon-optifine/src/random.rs (+13 -3)
📝 crates/horizon-optifine/src/random_textures.rs (+19 -3)

📄 Description

Entity Texture Features lets packs make mobs blink. A <texture>_blink.png with the eyes shut, and optionally a <texture>_blink2.png half shut, sits beside the texture, and the mob wears them for a few ticks now and then. Horizon ignored them. With this PR, mobs blink when the pack ships these frames.

What players get:

  • Frames: <name>_blink.png (eyes shut) and optionally <name>_blink2.png (half shut), beside any entity texture. A random variant blinks with its own: optifine/random/entity/zombie/zombie3_blink.png for zombie3.
  • Timing: <name>_blink.properties beside them sets blinkLength and blinkFrequency, in ticks.
    • Without one, a blink lasts 5 ticks every 150. Those are the values of ETF's documented example; its docs give no defaults.
    • With a half-shut frame, a blink of 3 ticks or more shows it on its first and last ticks.
    • Each mob blinks at its own phase (from its entity id), so a herd doesn't blink in step.
  • Sleeping villagers keep their eyes shut, as ETF's README says sleeping mobs do.
  • No _blink files: nothing changes.

How:

  • horizon_optifine::blink::Blinks::scan finds the frames and their properties while the entity atlas packs, which also packs the variants' frames. The pack reload hands the scan to MobData.blinks.
  • render_visible picks the sprite in order: the mob's random variant, then that variant's blink frame on the current tick (age plus phase, simple arithmetic). An emissive overlay follows the drawn frame, so a <name>_blink_e.png glows over a shut eye.

Not in this PR:

  • Blindness closing the eyes, which ETF also does.
  • ETF's player-skin blinking, which reads pixels of the uploaded skin.

Docs I wrote it from (no mod source read): ETF's README, "Blinking textures", and its blink-properties.png example (blinkLength=5, blinkFrequency=150).

Checks:

  • cargo fmt: clean
  • cargo test -p horizon-optifine blink: 2 passed.
    • With blinkLength=4 and blinkFrequency=100, ticks 0-3 show half, shut, shut, half; tick 101 is shut again; a phase of 30 moves the blink to ticks 70-73.
    • The defaults apply without a properties file, and a frame with no texture to blink over is ignored.
    • A variant has its own frames; out-of-range values clamp to one tick every other tick.
  • A render test (mobs::render::emissive_tests::a_blink_frame_replaces_the_texture_for_a_few_ticks): entity 1's phase is 0x9E3779B1 % 150 = 61, so it shows the shut frame at ages 89-93 and 239, and its own texture at 88 and 94.
  • CI on my fork (verify): run linked in a comment once it finishes.
  • Not run: no live game test (no .local/ vanilla data here).

Stacked on #6217 and #6215; this branch includes their commits until they merge.

Note

Filed by Opus 5.5 using Claude Code.


🔄 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/6219 **Author:** [@some-du6e](https://github.com/some-du6e) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `optifine/etf-blink` --- ### 📝 Commits (10+) - [`e190856`](https://github.com/horizon-rust/horizon/commit/e1908564c5cf77aeb094a1d007159a0a2a1a5633) OptiFine emissive textures: mobs' _e overlays glow at full brightness - [`352b2d0`](https://github.com/horizon-rust/horizon/commit/352b2d08a8b9c742fb9ebeb661dfd2755f72175f) OptiFine emissive textures: parenthesise the test's light value - [`d4fde1a`](https://github.com/horizon-rust/horizon/commit/d4fde1af7b8b1235f963d825eb67c6bf22d96ad5) ETF blinking textures: mobs blink with their pack's _blink frames - [`b1a756e`](https://github.com/horizon-rust/horizon/commit/b1a756ee59bc7ad3ad138b32e970f6d398fc6a45) OptiFine random entities: vanilla on a miss, custom-model and warden textures choose too - [`ead5f88`](https://github.com/horizon-rust/horizon/commit/ead5f88ea36ee4972a3853cf5b6fa12cbe80dddf) Merge main into optifine/etf-emissive - [`5eac2ed`](https://github.com/horizon-rust/horizon/commit/5eac2ed4e0fe0773d9b77b0d454bec9904dec21c) Merge main into optifine/etf-blink - [`d1df8b8`](https://github.com/horizon-rust/horizon/commit/d1df8b899626b5339f98b9ed407016a077755242) Merge optifine/etf-fixes into optifine/etf-emissive - [`afe44e4`](https://github.com/horizon-rust/horizon/commit/afe44e4d77ac37667dabe561363025e9030302e6) Merge optifine/etf-emissive into optifine/etf-blink - [`12aa338`](https://github.com/horizon-rust/horizon/commit/12aa3388627b490c79cdf460fae0557cb8e73254) OptiFine random entities: budget every variant, one cem key, and a miss answered once a check - [`509bf3c`](https://github.com/horizon-rust/horizon/commit/509bf3c9e160b19350c39ff023fe42c06fdc72ec) OptiFine emissive textures: players' armour glows too ### 📊 Changes **14 files changed** (+1498 additions, -129 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/hud.rs` (+132 -3) 📝 `crates/horizon-client/src/game/armor_stands.rs` (+19 -5) 📝 `crates/horizon-client/src/game/packs.rs` (+17 -4) 📝 `crates/horizon-client/src/game/perspective.rs` (+3 -1) 📝 `crates/horizon-client/src/game/random_textures.rs` (+8 -6) 📝 `crates/horizon-client/src/mobs/cem.rs` (+2 -0) 📝 `crates/horizon-client/src/mobs/data.rs` (+13 -3) 📝 `crates/horizon-client/src/mobs/random_textures.rs` (+324 -80) 📝 `crates/horizon-client/src/mobs/render.rs` (+454 -19) ➕ `crates/horizon-optifine/src/blink.rs` (+224 -0) ➕ `crates/horizon-optifine/src/emissive.rs` (+265 -0) 📝 `crates/horizon-optifine/src/lib.rs` (+5 -2) 📝 `crates/horizon-optifine/src/random.rs` (+13 -3) 📝 `crates/horizon-optifine/src/random_textures.rs` (+19 -3) </details> ### 📄 Description Entity Texture Features lets packs make mobs blink. A `<texture>_blink.png` with the eyes shut, and optionally a `<texture>_blink2.png` half shut, sits beside the texture, and the mob wears them for a few ticks now and then. Horizon ignored them. With this PR, mobs blink when the pack ships these frames. **What players get:** - **Frames:** `<name>_blink.png` (eyes shut) and optionally `<name>_blink2.png` (half shut), beside any entity texture. A random variant blinks with its own: `optifine/random/entity/zombie/zombie3_blink.png` for `zombie3`. - **Timing:** `<name>_blink.properties` beside them sets `blinkLength` and `blinkFrequency`, in ticks. - Without one, a blink lasts 5 ticks every 150. Those are the values of ETF's documented example; its docs give no defaults. - With a half-shut frame, a blink of 3 ticks or more shows it on its first and last ticks. - Each mob blinks at its own phase (from its entity id), so a herd doesn't blink in step. - **Sleeping villagers** keep their eyes shut, as ETF's README says sleeping mobs do. - **No `_blink` files:** nothing changes. **How:** - `horizon_optifine::blink::Blinks::scan` finds the frames and their properties while the entity atlas packs, which also packs the variants' frames. The pack reload hands the scan to `MobData.blinks`. - `render_visible` picks the sprite in order: the mob's random variant, then that variant's blink frame on the current tick (age plus phase, simple arithmetic). An emissive overlay follows the drawn frame, so a `<name>_blink_e.png` glows over a shut eye. **Not in this PR:** - Blindness closing the eyes, which ETF also does. - ETF's player-skin blinking, which reads pixels of the uploaded skin. **Docs I wrote it from** (no mod source read): ETF's README, "Blinking textures", and its `blink-properties.png` example (`blinkLength=5`, `blinkFrequency=150`). **Checks:** - `cargo fmt`: clean - `cargo test -p horizon-optifine blink`: 2 passed. - With `blinkLength=4` and `blinkFrequency=100`, ticks 0-3 show half, shut, shut, half; tick 101 is shut again; a phase of 30 moves the blink to ticks 70-73. - The defaults apply without a properties file, and a frame with no texture to blink over is ignored. - A variant has its own frames; out-of-range values clamp to one tick every other tick. - A render test (`mobs::render::emissive_tests::a_blink_frame_replaces_the_texture_for_a_few_ticks`): entity 1's phase is 0x9E3779B1 % 150 = 61, so it shows the shut frame at ages 89-93 and 239, and its own texture at 88 and 94. - CI on my fork (`verify`): run linked in a comment once it finishes. - Not run: no live game test (no `.local/` vanilla data here). Stacked on #6217 and #6215; this branch includes their commits until they merge. > [!NOTE] > Filed by Opus 5.5 using Claude Code. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:25:34 +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#6725
No description provided.