[PR #1115] [MERGED] Terrain particles: the model's particle sprite and vanilla tint (grass blocks break into dirt) #3061

Closed
opened 2026-11-02 16:01:12 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1115
Author: @ludovic111
Created: 10/21/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @ludovic111

Base: main ← Head: fix/break-particle-sprite


📝 Commits (1)

  • 38b16f4 Terrain particles: the model's particle sprite and vanilla tint sources

📊 Changes

13 files changed (+183 additions, -33 deletions)

View changed files

📝 crates/horizon-assets/src/blockstate/choice.rs (+13 -0)
📝 crates/horizon-client/src/game.rs (+56 -19)
📝 crates/horizon-client/src/game/breezes.rs (+4 -2)
📝 crates/horizon-client/src/game/commands/world_cmds.rs (+5 -1)
📝 crates/horizon-client/src/game/creaking.rs (+2 -1)
📝 crates/horizon-client/src/game/mace.rs (+2 -2)
📝 crates/horizon-client/src/game/mob_blocks.rs (+1 -1)
📝 crates/horizon-client/src/game/render_tick.rs (+5 -3)
📝 crates/horizon-client/src/game/sculk.rs (+1 -1)
📝 crates/horizon-client/src/game/sniffers.rs (+2 -1)
📝 crates/horizon-client/src/mesher.rs (+29 -2)
➕ crates/horizon-client/src/mesher/particle_tests.rs (+56 -0)
📝 crates/horizon-client/src/models/catalog.rs (+7 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Fixes #1034. Reported on Discord by skills.issue: breaking a grass block or foliage spawns particles that look like moss.

What and why

Vanilla's TerrainParticle takes its sprite from BlockStateModelSet.getParticleMaterial(state) (the model's particle texture of the state's first variant, or the first multipart selector) and its colour from layer 0 of the block's BlockTintSource: colorAsTerrainParticle, which is -1 (no tint) for BlockTintSources.grassBlock() and the in-world colour for everything else, times 0.6. Horizon used the block's up face with the up face's tint, so a grass block broke into tinted grass-top squares (the "moss") and plants used their face sprite.

  • CompiledChoices::particle_variant + StateModels::particle: the baked particle layer of the state's first variant / first multipart part.
  • MeshTables::terrain_particle_tint: the mesher's own tint lookup at the broken position (biome blend included), with a new Tint::GrassBlock that tints the block in the world but not its particles.
  • Game::particle_sprite(state, pos) uses both; every terrain-particle caller (break, fall, sprint/step, breeze, sniffer, mace, creaking, warden dig, /particle block) passes its position. Falling blocks and the enderman's carried block keep the old face lookup (block_face_sprite); block markers are untinted as in vanilla.

Screenshots (main vs this branch, same scene, creative instant break)

main this PR
grass block
short grass

Grass block now breaks into dirt crumbs (its particle is block/dirt), short grass into biome-tinted grass bits.

Tests

New mesher::particle_tests: particle sprites (grass_block -> minecraft:block/dirt, short_grass, oak_leaves) and tints (grass_block none, short_grass/oak_leaves biome colour, spruce leaves 0x619961, pink petals and stone none).

Self-check (all five B2 branches merged onto one integration commit, Mac mini)

  • On the branches rebased onto origin/main 252f877f:
  • cargo fmt --all -- --check: clean
  • set -o pipefail; cargo clippy --workspace --all-targets -- -D warnings: exit 0
  • cargo test -p horizon-assets -p horizon-client: all pass (960 + 84 + smaller suites, 0 failed)
  • tools/parity.py --changed origin/main (integration over e66c35b2): 238 of 268 harnesses PASS, including block_particles, particle_providers, emitter_particles, entity_particles, item_particles, marker_particles, entity_model, item_model, environment_render, section_mesh, translucency, block_entity_render, cloud_render, weather_render, world_border_render, sprite_animation, living_fluid. 1 FAIL: dedicated_server, which also fails on plain origin/main (--fresh, same machine; its server-timing lines differ from run to run under load). 29 non-rendering harnesses (server, sound, UI screens) were not reached locally before the run's time limit; CI runs them.
  • Screenshot comparison: main vs this branch from the same world, camera and commands (--offscreen + horizon-ctl screenshot), below.

Needs Ludovic: nothing.

🤖 Generated with 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/1115 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/break-particle-sprite` --- ### 📝 Commits (1) - [`38b16f4`](https://github.com/horizon-rust/horizon/commit/38b16f44cb9b763396b25d9a61c52cc232f98756) Terrain particles: the model's particle sprite and vanilla tint sources ### 📊 Changes **13 files changed** (+183 additions, -33 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-assets/src/blockstate/choice.rs` (+13 -0) 📝 `crates/horizon-client/src/game.rs` (+56 -19) 📝 `crates/horizon-client/src/game/breezes.rs` (+4 -2) 📝 `crates/horizon-client/src/game/commands/world_cmds.rs` (+5 -1) 📝 `crates/horizon-client/src/game/creaking.rs` (+2 -1) 📝 `crates/horizon-client/src/game/mace.rs` (+2 -2) 📝 `crates/horizon-client/src/game/mob_blocks.rs` (+1 -1) 📝 `crates/horizon-client/src/game/render_tick.rs` (+5 -3) 📝 `crates/horizon-client/src/game/sculk.rs` (+1 -1) 📝 `crates/horizon-client/src/game/sniffers.rs` (+2 -1) 📝 `crates/horizon-client/src/mesher.rs` (+29 -2) ➕ `crates/horizon-client/src/mesher/particle_tests.rs` (+56 -0) 📝 `crates/horizon-client/src/models/catalog.rs` (+7 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Fixes #1034. Reported on Discord by **skills.issue**: breaking a grass block or foliage spawns particles that look like moss. ## What and why Vanilla's `TerrainParticle` takes its sprite from `BlockStateModelSet.getParticleMaterial(state)` (the model's `particle` texture of the state's first variant, or the first multipart selector) and its colour from layer 0 of the block's `BlockTintSource`: `colorAsTerrainParticle`, which is `-1` (no tint) for `BlockTintSources.grassBlock()` and the in-world colour for everything else, times 0.6. Horizon used the block's up face with the up face's tint, so a grass block broke into tinted grass-top squares (the "moss") and plants used their face sprite. - `CompiledChoices::particle_variant` + `StateModels::particle`: the baked particle layer of the state's first variant / first multipart part. - `MeshTables::terrain_particle_tint`: the mesher's own tint lookup at the broken position (biome blend included), with a new `Tint::GrassBlock` that tints the block in the world but not its particles. - `Game::particle_sprite(state, pos)` uses both; every terrain-particle caller (break, fall, sprint/step, breeze, sniffer, mace, creaking, warden dig, `/particle block`) passes its position. Falling blocks and the enderman's carried block keep the old face lookup (`block_face_sprite`); block markers are untinted as in vanilla. ## Screenshots (main vs this branch, same scene, creative instant break) | | main | this PR | |---|---|---| | grass block | ![](https://raw.githubusercontent.com/ludovic111/horizon/b01dd34ad5343951d09ae41f01d7495b8db904b9/b2/1034-main-grass.png) | ![](https://raw.githubusercontent.com/ludovic111/horizon/b01dd34ad5343951d09ae41f01d7495b8db904b9/b2/1034-fix-grass.png) | | short grass | ![](https://raw.githubusercontent.com/ludovic111/horizon/b01dd34ad5343951d09ae41f01d7495b8db904b9/b2/1034-main-shortgrass.png) | ![](https://raw.githubusercontent.com/ludovic111/horizon/b01dd34ad5343951d09ae41f01d7495b8db904b9/b2/1034-fix-shortgrass.png) | Grass block now breaks into dirt crumbs (its `particle` is `block/dirt`), short grass into biome-tinted grass bits. ## Tests New `mesher::particle_tests`: particle sprites (grass_block -> `minecraft:block/dirt`, short_grass, oak_leaves) and tints (grass_block none, short_grass/oak_leaves biome colour, spruce leaves 0x619961, pink petals and stone none). ## Self-check (all five B2 branches merged onto one integration commit, Mac mini) - On the branches rebased onto origin/main 252f877f: - `cargo fmt --all -- --check`: clean - `set -o pipefail; cargo clippy --workspace --all-targets -- -D warnings`: exit 0 - `cargo test -p horizon-assets -p horizon-client`: all pass (960 + 84 + smaller suites, 0 failed) - `tools/parity.py --changed origin/main` (integration over e66c35b2): 238 of 268 harnesses PASS, including block_particles, particle_providers, emitter_particles, entity_particles, item_particles, marker_particles, entity_model, item_model, environment_render, section_mesh, translucency, block_entity_render, cloud_render, weather_render, world_border_render, sprite_animation, living_fluid. 1 FAIL: dedicated_server, which also fails on plain origin/main (`--fresh`, same machine; its server-timing lines differ from run to run under load). 29 non-rendering harnesses (server, sound, UI screens) were not reached locally before the run's time limit; CI runs them. - Screenshot comparison: main vs this branch from the same world, camera and commands (`--offscreen` + `horizon-ctl screenshot`), below. Needs Ludovic: nothing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 16:01:12 +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#3061
No description provided.