[PR #7573] Draw a breeze's ground particles by its pose #7683

Open
opened 2026-11-03 07:21:58 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7573
Author: @MSedgeMC
Created: 11/2/2026
Status: 🔄 Open

Base: main ← Head: fix/breeze-ground-particles


📝 Commits (3)

  • 88b767b fix: a breeze crumbles the block at its feet as its pose asks
  • fd7b453 test: the breeze's crumb count by pose, and the block it crumbles
  • 24a784e port_map: game2-003's breeze ground particles are drawn

📊 Changes

6 files changed (+194 additions, -18 deletions)

View changed files

📝 crates/horizon-client/src/game/creatures.rs (+4 -5)
📝 crates/horizon-client/src/mobs.rs (+5 -2)
📝 crates/horizon-client/src/mobs/ai.rs (+3 -3)
📝 crates/horizon-client/src/mobs/breeze.rs (+179 -7)
📝 crates/horizon-client/src/mobs/living.rs (+2 -0)
📝 tools/port_map/game2-003.tsv (+1 -1)

📄 Description

Breeze.tick picks the ground particles by pose, then emitGroundParticles(int) draws them. Horizon drew the count's random and dropped the particle — and drew it for the wrong poses.

Vanilla

Breeze.tick (javap -p -c -constants -cp /tmp/cj net.minecraft.world.entity.monster.breeze.Breeze), switch on getPose():

 13: tableswitch   { // 1 to 5
               1: 57      2: 57      3: 48      4: 57      5: 79
           default: 94 }
 48: bipush 20
 51: invokevirtual #178   // Method emitGroundParticles:(I)V          <- 3: INHALING
 57: invokevirtual #181   // Method resetJumpTrail:()L.../Breeze;
 61: iconst_1
 62: aload_0 / 63: invokevirtual #185  // getRandom
 66: iconst_1 / 67: invokeinterface #189 // RandomSource.nextInt:(I)I
 72: iadd
 73: invokevirtual #178   // emitGroundParticles:(I)V                 <- 1,2,4: STANDING, SHOOTING, SLIDING
 79: ... invokevirtual #195 // emitJumpTrailParticles:()V              <- 5: LONG_JUMPING

So inhaling asks for 20 crumbs and makes no random draw; standing, shooting and sliding ask for 1 + random.nextInt(1) (one 31-bit draw, taken whether or not the call draws anything); the long jump takes its own trail arm.

Breeze.emitGroundParticles(int):

  0: invokevirtual #276  // isPassenger:()Z            -> return
  8: getBoundingBox / 12: invokevirtual #283 // AABB.getCenter
 16: new Vec3(center.x, position().y, center.z)        -> astore_3
 39: getInBlockState   46: ifne 56                     // isAir ? getBlockStateOn : getInBlockState
 62: BlockState.getRenderShape  67: RenderShape.INVISIBLE / 70: if_acmpne 74 -> return
 74: for (i = 0; i < count; i++)
 87: new BlockParticleOption(ParticleTypes.BLOCK, state)
 99: aload_3 (x, y, z)  111-113: dconst_0 dconst_0 dconst_0
114: Level.addParticle:(Lnet/minecraft/core/particles/ParticleOptions;DDDDDD)V

One BLOCK particle per crumb, at rest, at the centre of the box on x and z and at position().y on y, of the block the breeze stands in or else the one it stands on.

What Horizon got wrong

mobs/breeze.rs::tick did

if matches!(pose(m), SHOOTING | INHALING | STANDING) {
    // emitGroundParticles(1 + random.nextInt(1))
    let _ = m.random.next_int_bound(1);
}
  • nothing was ever drawn, so a breeze had no dust at its feet;
  • INHALING drew the count's random, which vanilla's inhaling arm does not: the mob's random ran one draw ahead for the rest of the tick (the whirl clock and everything Breeze.tick and super.tick() draw after it);
  • SLIDING drew nothing, where vanilla draws the count.

MobEvent::LandingDust also carried no speed — the handler had the falling-dust crumbs' 0.15 hardcoded — so the event now carries it and the breeze passes 0.

Proven

  • the_pose_asks_for_its_crumb_count_and_draws_once_or_never: with the old pose set, inhaling asks for None where the test wants Some(20); and keeping the counts but dropping sliding's draw, sliding's next nextInt(1_000_000) is 948783 where the same random advanced by vanilla's one draw gives 986043.
  • a_breeze_crumbles_the_block_under_its_feet: one crumb event of the stone under the feet at [4.5, 64.0, 2.5] (feet y, box centre x/z) with speed 0; twenty while inhaling; none for a passenger; none over air (its render shape draws nothing).
  • cargo test -p horizon-client-lib --lib mobs::breeze passes; cargo clippy -q -p horizon-client-lib --lib and rustfmt --edition 2024 --check are clean.

Not proven

  • The stone-floor test needs the prepared vanilla data under .local/horizon-client/26.3, which is not in this checkout, so it skips here (as the other built-world tests do) and will run where that data is built.
  • The long jump's emitJumpTrailParticles arm is untouched: it needs jumpTrailStartedTick, which Horizon does not track yet (Breeze.emitJumpTrailParticles stays missing in tools/port_map/game2-003.tsv).
  • Nothing here was watched in a running client.

🔄 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/7573 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/breeze-ground-particles` --- ### 📝 Commits (3) - [`88b767b`](https://github.com/horizon-rust/horizon/commit/88b767b82ff1d182cde7c78ea2d9c5aad48757cf) fix: a breeze crumbles the block at its feet as its pose asks - [`fd7b453`](https://github.com/horizon-rust/horizon/commit/fd7b453f70d15bebf0231e2364d59a0f00acc52e) test: the breeze's crumb count by pose, and the block it crumbles - [`24a784e`](https://github.com/horizon-rust/horizon/commit/24a784ecaaa721a5bbdd69936f4dc0732de826d1) port_map: game2-003's breeze ground particles are drawn ### 📊 Changes **6 files changed** (+194 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/creatures.rs` (+4 -5) 📝 `crates/horizon-client/src/mobs.rs` (+5 -2) 📝 `crates/horizon-client/src/mobs/ai.rs` (+3 -3) 📝 `crates/horizon-client/src/mobs/breeze.rs` (+179 -7) 📝 `crates/horizon-client/src/mobs/living.rs` (+2 -0) 📝 `tools/port_map/game2-003.tsv` (+1 -1) </details> ### 📄 Description `Breeze.tick` picks the ground particles by pose, then `emitGroundParticles(int)` draws them. Horizon drew the count's random and dropped the particle — and drew it for the wrong poses. ## Vanilla `Breeze.tick` (`javap -p -c -constants -cp /tmp/cj net.minecraft.world.entity.monster.breeze.Breeze`), switch on `getPose()`: ``` 13: tableswitch { // 1 to 5 1: 57 2: 57 3: 48 4: 57 5: 79 default: 94 } 48: bipush 20 51: invokevirtual #178 // Method emitGroundParticles:(I)V <- 3: INHALING 57: invokevirtual #181 // Method resetJumpTrail:()L.../Breeze; 61: iconst_1 62: aload_0 / 63: invokevirtual #185 // getRandom 66: iconst_1 / 67: invokeinterface #189 // RandomSource.nextInt:(I)I 72: iadd 73: invokevirtual #178 // emitGroundParticles:(I)V <- 1,2,4: STANDING, SHOOTING, SLIDING 79: ... invokevirtual #195 // emitJumpTrailParticles:()V <- 5: LONG_JUMPING ``` So inhaling asks for 20 crumbs and makes **no** random draw; standing, shooting and sliding ask for `1 + random.nextInt(1)` (one 31-bit draw, taken whether or not the call draws anything); the long jump takes its own trail arm. `Breeze.emitGroundParticles(int)`: ``` 0: invokevirtual #276 // isPassenger:()Z -> return 8: getBoundingBox / 12: invokevirtual #283 // AABB.getCenter 16: new Vec3(center.x, position().y, center.z) -> astore_3 39: getInBlockState 46: ifne 56 // isAir ? getBlockStateOn : getInBlockState 62: BlockState.getRenderShape 67: RenderShape.INVISIBLE / 70: if_acmpne 74 -> return 74: for (i = 0; i < count; i++) 87: new BlockParticleOption(ParticleTypes.BLOCK, state) 99: aload_3 (x, y, z) 111-113: dconst_0 dconst_0 dconst_0 114: Level.addParticle:(Lnet/minecraft/core/particles/ParticleOptions;DDDDDD)V ``` One `BLOCK` particle per crumb, at rest, at the centre of the box on x and z and at `position().y` on y, of the block the breeze stands in or else the one it stands on. ## What Horizon got wrong `mobs/breeze.rs::tick` did ```rust if matches!(pose(m), SHOOTING | INHALING | STANDING) { // emitGroundParticles(1 + random.nextInt(1)) let _ = m.random.next_int_bound(1); } ``` - nothing was ever drawn, so a breeze had no dust at its feet; - `INHALING` drew the count's random, which vanilla's inhaling arm does not: the mob's random ran one draw ahead for the rest of the tick (the whirl clock and everything `Breeze.tick` and `super.tick()` draw after it); - `SLIDING` drew nothing, where vanilla draws the count. `MobEvent::LandingDust` also carried no speed — the handler had the falling-dust crumbs' `0.15` hardcoded — so the event now carries it and the breeze passes 0. ## Proven - `the_pose_asks_for_its_crumb_count_and_draws_once_or_never`: with the old pose set, inhaling asks for **None** where the test wants **Some(20)**; and keeping the counts but dropping sliding's draw, sliding's next `nextInt(1_000_000)` is **948783** where the same random advanced by vanilla's one draw gives **986043**. - `a_breeze_crumbles_the_block_under_its_feet`: one crumb event of the stone under the feet at `[4.5, 64.0, 2.5]` (feet y, box centre x/z) with speed 0; twenty while inhaling; none for a passenger; none over air (its render shape draws nothing). - `cargo test -p horizon-client-lib --lib mobs::breeze` passes; `cargo clippy -q -p horizon-client-lib --lib` and `rustfmt --edition 2024 --check` are clean. ## Not proven - The stone-floor test needs the prepared vanilla data under `.local/horizon-client/26.3`, which is not in this checkout, so it skips here (as the other built-world tests do) and will run where that data is built. - The long jump's `emitJumpTrailParticles` arm is untouched: it needs `jumpTrailStartedTick`, which Horizon does not track yet (`Breeze.emitJumpTrailParticles` stays `missing` in `tools/port_map/game2-003.tsv`). - Nothing here was watched in a running client. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#7683
No description provided.