[PR #5433] [MERGED] Smoke where a bucket's water evaporates in the Nether (#5288) #6286

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5433
Author: @k3yh
Created: 10/31/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/nether-water-evaporate


📝 Commits (2)

📊 Changes

6 files changed (+93 additions, -28 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+5 -0)
📝 crates/horizon-client/src/game/creatures.rs (+1 -0)
📝 crates/horizon-client/src/game/dispenser.rs (+1 -16)
📝 crates/horizon-client/src/game/fishing.rs (+1 -0)
📝 crates/horizon-client/src/game/lan_particles.rs (+84 -12)
📝 crates/horizon-client/src/game/native_hooks.rs (+1 -0)

📄 Description

🤖 Opened by k3yh's AI agent (Claude Code, Claude Opus 5.5), not by k3yh personally.

What and why

Fixes #5288.

When water is emptied in the Nether, vanilla's BucketItem.emptyContents plays the hiss and then calls ServerLevel.sendParticles(LARGE_SMOKE, x, y, z, 8, 1, 1, 1, 0, ALTERNATIVE), where x, y, z is the block's corner. Each client then puts every puff at corner + nextDouble() on each axis (ClientPacketListener.handleParticleEvent), so the 8 puffs land inside the block.

On main the hiss plays, but no smoke reaches anyone:

  • A player's bucket sent no particles at all.
  • A dispenser drew its smoke with ParticleEngine on the game that runs the level. In single player that's the integrated server, which has no window, and nothing was sent to the players. Its spread was also nextDouble() * 2 - 1 around the corner, which is up to a block too wide on each side.

The water itself is already right on main: it isn't placed, and the bucket comes back empty. The issue also says the water "briefly appears"; I didn't see that on main 2d39fb84c.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Change

  • lan_particles.rs:
    • evaporation_smoke(pos) draws the window's 8 puffs and sends the packet as vanilla does. It replaces the dispenser's own loop, and the bucket path calls it too.

    • QueuedParticle gets randomization, which goes into the packet. The five existing callers pass 0 (DEFAULT), as they did.

    • remote_level_particles now honours the packet's randomization type through the new spread, as handleParticleEvent does:

      • ALTERNATIVE (1) and ALTERNATIVE_WITH_SPEED (2) spread positions over [0, dist).
      • ALTERNATIVE keeps the speeds; ALTERNATIVE_WITH_SPEED scales each by nextDouble().
      • DEFAULT is the Gaussian it was.

      This also matters for a vanilla server's ALTERNATIVE particles.

  • game.rs: the bucket path calls evaporation_smoke when water evaporates (Dim::Nether, water or a fish bucket), as the dispenser path already checked.

Vanilla reference

Checked in the 26.3 bytecode with javap:

  • BucketItem.emptyContents: the WATER_EVAPORATES branch, playSound(user, pos, FIRE_EXTINGUISH, …), then if (level instanceof ServerLevel) serverLevel.sendParticles(LARGE_SMOKE, x, y, z, 8, 1.0, 1.0, 1.0, 0.0, RandomizationType.ALTERNATIVE).
  • ClientPacketListener.handleParticleEvent: with count > 0 and randomizationType().isAlternative(), the offset is nextDouble() * dist per axis and the speed is maxSpeed, multiplied by nextDouble() only for ALTERNATIVE_WITH_SPEED. Otherwise both are nextGaussian() times the distance and the speed.

Test

lan_particles::tests::alternative_particles_spread_from_the_corner_over_dist: over 200 draws, ALTERNATIVE keeps every puff inside [corner, corner + 1) with no speed, ALTERNATIVE_WITH_SPEED keeps each speed within [0, max), and DEFAULT still goes below the position.

In game (single player, Windows). Each case is in the Nether on an obsidian floor, then a screenshot:

water placed bucket after smoke
player's water bucket, main 2d39fb84c no empty none
player's water bucket, this branch no empty 8 puffs at the target block
dispenser facing up, main no empty none
dispenser facing up, this branch no empty puffs in the block above the dispenser
dispenser facing up, vanilla 26.3 no empty puffs in the block above the dispenser

Vanilla was driven by a data pack, which refilled and powered a dispenser every 2 seconds, and its window was captured with ffmpeg's gfxcapture. I compared vanilla through the dispenser because a data pack can't empty a player's bucket. Both go through the same emptyContents.

Self-check

pr_ready (tools/pr_ready.py --quick --base 2d39fb84c on DESKTOP-S9O4938, against 2d39fb84c at 2d39fb84c, 5 min 15 s)

Check Result
Scope ✅ 6 files, +93 −28
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 505 run, FAILED (errors=1, skipped=1) (53 s)
rustfmt ✅ (8 s)
clippy ❌ failed (5 s), in horizon-threads
tests: horizon-client ❌ 1036 passed, 1 failed (4 min 3 s)
doc tests ✅ 0 passed (1 s)
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses

None of the three failures is in this change:

  • main doesn't build horizon-client on Windows today: horizon-threads/src/boot_paint.rs uses windows-sys features its Cargo.toml doesn't turn on (#5299 and #5374 fix it). I turned them on locally to build and test, and left that out of this PR.
    • clippy then fails on boot_paint.rs (unnecessary_mut_passed).
    • cargo clippy -p horizon-client --all-targets -- -D warnings, with that one lint allowed, is clean.
  • title::tests::title_screen_keyboard_navigation_and_activation fails the same way on 2d39fb84c without this change.
  • test_port_ledger cannot import tests.test_class_index, as on main on this machine.

🤖 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/5433 **Author:** [@k3yh](https://github.com/k3yh) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/nether-water-evaporate` --- ### 📝 Commits (2) - [`ad85e99`](https://github.com/horizon-rust/horizon/commit/ad85e9960009f23650ff2371ab81d8547a40d1f8) Smoke where a bucket's water evaporates in the Nether (#5288) - [`8b9d323`](https://github.com/horizon-rust/horizon/commit/8b9d3235e19d8d3facb4a9b33a96dead7c5d3b58) Merge main into #5433 ### 📊 Changes **6 files changed** (+93 additions, -28 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+5 -0) 📝 `crates/horizon-client/src/game/creatures.rs` (+1 -0) 📝 `crates/horizon-client/src/game/dispenser.rs` (+1 -16) 📝 `crates/horizon-client/src/game/fishing.rs` (+1 -0) 📝 `crates/horizon-client/src/game/lan_particles.rs` (+84 -12) 📝 `crates/horizon-client/src/game/native_hooks.rs` (+1 -0) </details> ### 📄 Description > 🤖 Opened by k3yh's AI agent (Claude Code, Claude Opus 5.5), not by k3yh personally. ## What and why Fixes #5288. When water is emptied in the Nether, vanilla's `BucketItem.emptyContents` plays the hiss and then calls `ServerLevel.sendParticles(LARGE_SMOKE, x, y, z, 8, 1, 1, 1, 0, ALTERNATIVE)`, where `x, y, z` is the block's corner. Each client then puts every puff at `corner + nextDouble()` on each axis (`ClientPacketListener.handleParticleEvent`), so the 8 puffs land inside the block. On main the hiss plays, but no smoke reaches anyone: - A player's bucket sent no particles at all. - A dispenser drew its smoke with `ParticleEngine` on the game that runs the level. In single player that's the integrated server, which has no window, and nothing was sent to the players. Its spread was also `nextDouble() * 2 - 1` around the corner, which is up to a block too wide on each side. The water itself is already right on main: it isn't placed, and the bucket comes back empty. The issue also says the water "briefly appears"; I didn't see that on main 2d39fb84c. ## Kind - [x] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Change - `lan_particles.rs`: - `evaporation_smoke(pos)` draws the window's 8 puffs and sends the packet as vanilla does. It replaces the dispenser's own loop, and the bucket path calls it too. - `QueuedParticle` gets `randomization`, which goes into the packet. The five existing callers pass 0 (DEFAULT), as they did. - `remote_level_particles` now honours the packet's randomization type through the new `spread`, as `handleParticleEvent` does: - ALTERNATIVE (1) and ALTERNATIVE_WITH_SPEED (2) spread positions over `[0, dist)`. - ALTERNATIVE keeps the speeds; ALTERNATIVE_WITH_SPEED scales each by `nextDouble()`. - DEFAULT is the Gaussian it was. This also matters for a vanilla server's ALTERNATIVE particles. - `game.rs`: the bucket path calls `evaporation_smoke` when water evaporates (`Dim::Nether`, water or a fish bucket), as the dispenser path already checked. ## Vanilla reference Checked in the 26.3 bytecode with `javap`: - `BucketItem.emptyContents`: the `WATER_EVAPORATES` branch, `playSound(user, pos, FIRE_EXTINGUISH, …)`, then `if (level instanceof ServerLevel) serverLevel.sendParticles(LARGE_SMOKE, x, y, z, 8, 1.0, 1.0, 1.0, 0.0, RandomizationType.ALTERNATIVE)`. - `ClientPacketListener.handleParticleEvent`: with `count > 0` and `randomizationType().isAlternative()`, the offset is `nextDouble() * dist` per axis and the speed is `maxSpeed`, multiplied by `nextDouble()` only for `ALTERNATIVE_WITH_SPEED`. Otherwise both are `nextGaussian()` times the distance and the speed. ## Test `lan_particles::tests::alternative_particles_spread_from_the_corner_over_dist`: over 200 draws, ALTERNATIVE keeps every puff inside `[corner, corner + 1)` with no speed, ALTERNATIVE_WITH_SPEED keeps each speed within `[0, max)`, and DEFAULT still goes below the position. **In game** (single player, Windows). Each case is in the Nether on an obsidian floor, then a screenshot: | | water placed | bucket after | smoke | |---|---|---|---| | player's water bucket, main 2d39fb84c | no | empty | **none** | | player's water bucket, this branch | no | empty | 8 puffs at the target block | | dispenser facing up, main | no | empty | **none** | | dispenser facing up, this branch | no | empty | puffs in the block above the dispenser | | dispenser facing up, vanilla 26.3 | no | empty | puffs in the block above the dispenser | Vanilla was driven by a data pack, which refilled and powered a dispenser every 2 seconds, and its window was captured with ffmpeg's `gfxcapture`. I compared vanilla through the dispenser because a data pack can't empty a player's bucket. Both go through the same `emptyContents`. ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base 2d39fb84c` on DESKTOP-S9O4938, against 2d39fb84c at 2d39fb84c, 5 min 15 s) | Check | Result | | --- | --- | | Scope | ✅ 6 files, +93 −28 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 505 run, FAILED (errors=1, skipped=1) (53 s) | | rustfmt | ✅ (8 s) | | clippy | ❌ failed (5 s), in `horizon-threads` | | tests: horizon-client | ❌ 1036 passed, 1 failed (4 min 3 s) | | doc tests | ✅ 0 passed (1 s) | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | None of the three failures is in this change: - main doesn't build `horizon-client` on Windows today: `horizon-threads/src/boot_paint.rs` uses `windows-sys` features its `Cargo.toml` doesn't turn on (#5299 and #5374 fix it). I turned them on locally to build and test, and left that out of this PR. - clippy then fails on `boot_paint.rs` (`unnecessary_mut_passed`). - `cargo clippy -p horizon-client --all-targets -- -D warnings`, with that one lint allowed, is clean. - `title::tests::title_screen_keyboard_navigation_and_activation` fails the same way on 2d39fb84c without this change. - `test_port_ledger` cannot import `tests.test_class_index`, as on main on this machine. 🤖 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-03 06:17:45 +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#6286
No description provided.