[PR #3119] [MERGED] Fix gray textures on blocks carried by endermen #4811

Closed
opened 2026-11-03 05:08:07 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3119
Author: @NetuosoDEV
Created: 10/28/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @ludovic111

Base: main ← Head: fix/enderman-carried-block-tints


📝 Commits (7)

  • f852985 Fix enderman carried block textures and item tints
  • 818a2ec Align the carried block between the enderman hands
  • d3e2fe8 Render enderman carried block states with vanilla tints
  • ddc2a6d Merge origin/main into fix/enderman-carried-block-tints
  • 240ac19 Compute default grass colour once per block-model draw
  • 267b921 Format the hoisted block tint lookup
  • c32dddb Merge main into the branch: default tints through the tint closure

📊 Changes

8 files changed (+305 additions, -37 deletions)

View changed files

📝 crates/horizon-client-render/src/mesher.rs (+31 -9)
➕ crates/horizon-client/examples/probe/block_tint_probe.rs (+37 -0)
📝 crates/horizon-client/examples/probe/main.rs (+2 -0)
📝 crates/horizon-client/src/game/minecarts.rs (+5 -16)
📝 crates/horizon-client/src/game/mob_blocks.rs (+51 -12)
➕ mods/horizon/src/test/java/dev/horizonlab/parity/VanillaBlockTintOracle.java (+34 -0)
➕ tools/enderman_render_e2e.py (+107 -0)
➕ tools/test_block_tint_parity.py (+38 -0)

📄 Description

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

What and why

An enderman carrying grass or leaves showed gray faces. The old renderer stretched one sprite over a custom cube, losing the block's distinct textures and per-face tints.

The carried block now uses the baked block-state model, through the same block_model_vertices path as worn blocks. Each face keeps its own texture and receives the vanilla default block colour only when it has a tint index. Flowers, mushrooms, fungi and roots retain their cross geometry; state properties such as a carved pumpkin's facing are preserved.

The carry transform matches Minecraft 26.3 and positions the block between both hands. The obsolete single-sprite cube renderer is removed.

Review follow-up

Fixed in d3e2fe8bf following the review by pr-triage-2:

  • Replaced the earlier item-model implementation with the actual block-state model path.
  • Removed the +0.5 item-centering compensation because block models already use [0, 1] coordinates.
  • Added MeshTables::default_tint, matching BlockTintSource.color(state) without a level. Grass uses the active pack's GrassColor.getDefaultColor() sample; leaves use vanilla default colours. Untinted faces stay white. In-world sugar cane and lily pad colours are preserved.
  • Uses BlockModelResolver's fixed model seed 42.
  • Retained the captured-vertex carry-transform regression and added a differential tint harness plus a reproducible offscreen screenshot driver.

NetuosoDEV manually tested the fix in game and confirmed that it works. The code and follow-up fixes were implemented by OpenAI Codex.

Vanilla reference

Inspected the installed Minecraft 26.3 bytecode with javap: CarriedBlockLayer.submit, EndermanRenderer.extractRenderState, BlockModelResolver.update, BlockColors.createDefault, BlockTintSources, and GrassColor.getDefaultColor. The carried render state is a BlockModelRenderState; its model comes from the carried block state, not its item.

The transform regression compares six points captured from the actual CarriedBlockLayer.submit, with both identity and translated/rotated/flipped entity roots. VanillaBlockTintOracle calls the pinned client's actual tint sources on the same states and tint indices as the Rust probe.

Related: #2986 also changes carried-block geometry; maintainers should account for the overlap when integrating.

Validation

  • NetuosoDEV manually tested the fix in game and confirmed it works.
  • python3 tools/test_block_tint_parity.py: 6,616 cases match Minecraft 26.3, covering every state of registered tinted blocks and representative untinted carried blocks at indices -1, 0, 1 and 2. This checks tint values, not full framebuffer parity.
  • cargo test --locked -p horizon-client --features horizon-client/mods --tests: 1,262 passed, 36 ignored. The initial restricted-process run ended with SIGSEGV; the same command completed successfully outside the sandbox.
  • pr_ready --quick completed public-tree validation, 398 Python tests, formatting, workspace clippy with mods, server clippy, and doc tests. Its Rust-test result is superseded by the successful command above.
  • Linux client build completed. tools/enderman_render_e2e.py captures grass/poppy and spruce-leaves/east-facing-pumpkin scenes using a scratch vanilla server and an offscreen Horizon client.

The complete affected parity suite has not been run. This is a fork PR: a maintainer must review the current head and add run-parity to run it on the self-hosted runner. vanilla-parity and jfr-analysis are manual jobs; their skipped status on PR events is expected.

🤖 Generated with OpenAI 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/3119 **Author:** [@NetuosoDEV](https://github.com/NetuosoDEV) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/enderman-carried-block-tints` --- ### 📝 Commits (7) - [`f852985`](https://github.com/horizon-rust/horizon/commit/f8529856938de3fab4ffa03311ee187ace65ce9c) Fix enderman carried block textures and item tints - [`818a2ec`](https://github.com/horizon-rust/horizon/commit/818a2ec52af13f7c0c977e2d7bc94fbadbcf1ff5) Align the carried block between the enderman hands - [`d3e2fe8`](https://github.com/horizon-rust/horizon/commit/d3e2fe8bf39b529eb9c3289a1435fcc824d2c62e) Render enderman carried block states with vanilla tints - [`ddc2a6d`](https://github.com/horizon-rust/horizon/commit/ddc2a6d7e6f2b46bd394ab7b269f6ba76dff2c71) Merge origin/main into fix/enderman-carried-block-tints - [`240ac19`](https://github.com/horizon-rust/horizon/commit/240ac19e3c452a2cd97f646e2c37420134228ff5) Compute default grass colour once per block-model draw - [`267b921`](https://github.com/horizon-rust/horizon/commit/267b92182ea3e8bd089e34761845c06bf6f5efba) Format the hoisted block tint lookup - [`c32dddb`](https://github.com/horizon-rust/horizon/commit/c32dddb1fef4520862634efa9fb96da85d8bdb59) Merge main into the branch: default tints through the tint closure ### 📊 Changes **8 files changed** (+305 additions, -37 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/mesher.rs` (+31 -9) ➕ `crates/horizon-client/examples/probe/block_tint_probe.rs` (+37 -0) 📝 `crates/horizon-client/examples/probe/main.rs` (+2 -0) 📝 `crates/horizon-client/src/game/minecarts.rs` (+5 -16) 📝 `crates/horizon-client/src/game/mob_blocks.rs` (+51 -12) ➕ `mods/horizon/src/test/java/dev/horizonlab/parity/VanillaBlockTintOracle.java` (+34 -0) ➕ `tools/enderman_render_e2e.py` (+107 -0) ➕ `tools/test_block_tint_parity.py` (+38 -0) </details> ### 📄 Description > 🤖 Opened by NetuosoDEV's AI agent (OpenAI Codex), not by NetuosoDEV personally. ## What and why An enderman carrying grass or leaves showed gray faces. The old renderer stretched one sprite over a custom cube, losing the block's distinct textures and per-face tints. The carried block now uses the baked **block-state model**, through the same `block_model_vertices` path as worn blocks. Each face keeps its own texture and receives the vanilla default block colour only when it has a tint index. Flowers, mushrooms, fungi and roots retain their cross geometry; state properties such as a carved pumpkin's facing are preserved. The carry transform matches Minecraft 26.3 and positions the block between both hands. The obsolete single-sprite cube renderer is removed. ## Review follow-up Fixed in d3e2fe8bf following the review by pr-triage-2: - Replaced the earlier item-model implementation with the actual block-state model path. - Removed the `+0.5` item-centering compensation because block models already use `[0, 1]` coordinates. - Added `MeshTables::default_tint`, matching `BlockTintSource.color(state)` without a level. Grass uses the active pack's `GrassColor.getDefaultColor()` sample; leaves use vanilla default colours. Untinted faces stay white. In-world sugar cane and lily pad colours are preserved. - Uses `BlockModelResolver`'s fixed model seed 42. - Retained the captured-vertex carry-transform regression and added a differential tint harness plus a reproducible offscreen screenshot driver. NetuosoDEV manually tested the fix in game and confirmed that it works. The code and follow-up fixes were implemented by OpenAI Codex. ## Vanilla reference Inspected the installed Minecraft 26.3 bytecode with `javap`: `CarriedBlockLayer.submit`, `EndermanRenderer.extractRenderState`, `BlockModelResolver.update`, `BlockColors.createDefault`, `BlockTintSources`, and `GrassColor.getDefaultColor`. The carried render state is a `BlockModelRenderState`; its model comes from the carried block state, not its item. The transform regression compares six points captured from the actual `CarriedBlockLayer.submit`, with both identity and translated/rotated/flipped entity roots. `VanillaBlockTintOracle` calls the pinned client's actual tint sources on the same states and tint indices as the Rust probe. Related: #2986 also changes carried-block geometry; maintainers should account for the overlap when integrating. ## Validation - NetuosoDEV manually tested the fix in game and confirmed it works. - `python3 tools/test_block_tint_parity.py`: **6,616 cases match Minecraft 26.3**, covering every state of registered tinted blocks and representative untinted carried blocks at indices -1, 0, 1 and 2. This checks tint values, not full framebuffer parity. - `cargo test --locked -p horizon-client --features horizon-client/mods --tests`: **1,262 passed**, 36 ignored. The initial restricted-process run ended with SIGSEGV; the same command completed successfully outside the sandbox. - `pr_ready --quick` completed public-tree validation, 398 Python tests, formatting, workspace clippy with mods, server clippy, and doc tests. Its Rust-test result is superseded by the successful command above. - Linux client build completed. `tools/enderman_render_e2e.py` captures grass/poppy and spruce-leaves/east-facing-pumpkin scenes using a scratch vanilla server and an offscreen Horizon client. The complete affected parity suite has not been run. This is a fork PR: a maintainer must review the current head and add `run-parity` to run it on the self-hosted runner. `vanilla-parity` and `jfr-analysis` are manual jobs; their skipped status on PR events is expected. 🤖 Generated with [OpenAI 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 05:08:07 +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#4811
No description provided.