[PR #3606] [MERGED] Splash sounds and particles when the player falls into water (#3028) #5092

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3606
Author: @degepie
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @levzzz5154

Base: main ← Head: fix/issue-3028-splash-sounds


📝 Commits (1)

  • 81445f5 Splash sounds and particles when the player falls into water

📊 Changes

1 file changed (+32 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game/remote.rs (+32 -0)

📄 Description

🤖 Opened by degepie's AI agent (Claude Code), not by degepie personally.

Fixes #3028.

What

Falling into water made no splash sound and showed no splash or bubble particles for the player. Mobs and dropped items already splashed.

Vanilla

Entity.doWaterSplashEffect runs when an entity starts touching water (Entity.updateInWaterStateAndDoFluidPushing, skipped on the first tick). It plays entity.player.splash, or entity.player.splash.high_speed when the volume is 0.25 or more (the volume comes from the velocity), and adds BUBBLE and SPLASH particles at the water surface.

For a player the sound goes through Player.playSound, which passes the player as the excluded listener. ServerLevel.playSeededSound therefore sends it to everyone except that player, and ClientLevel.playSeededSound plays it only when the excluded entity is the local player. So the local player's splash is played by its own client. The particles come from level.addParticle, which also happens on the client.

How

Singleplayer runs the player through the remote client path (game/remote.rs, the controlled_simulation_tick loop). The motion code already sends MotionEvent::Splash and MotionEvent::SplashParticle (motion/fluids.rs, the water_splash port), and the in-process tick in game.rs handles them, but the remote loop dropped both through its catch-all arm. This PR adds the two arms there, matching how game.rs handles them: the sound at the player's feet and the particles added locally.

Verified

Scratch home, --offscreen, HORIZON_NO_AUDIO=1. The sounds are read from horizon-ctl status → heard, which counts positional plays even with audio off. I built a 3-deep water pool with fill and teleported the player above it:

  • v0.2.91: falling in from y=115 → heard only has block.water.ambient and ui.hud.bubble_pop, and no bubble particles.
  • This branch: falling in from y=115 → entity.player.splash +1, bubble 0→13, splash 1→14. A short drop (y=104) → another entity.player.splash. A drop from y=160 → entity.player.splash.high_speed.
  • Mobs (cow, pig) and a dropped item already play entity.generic.splash from the server in v0.2.91, and they are untouched here.

Known differences

None known. The SPLASH game event stays the server's job, as before.

pr_ready (tools/pr_ready.py --quick on horizon-build, against origin/main at 8f0c17895, 7 min 33 s)

Check Result
Scope ✅ 1 files, +32 −0
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 408 passed (35 s)
rustfmt ✅ (8 s)
clippy ✅ (3 min 26 s)
tests: horizon-client ✅ 798 passed (3 min 5 s)
doc tests ✅ 0 passed (17 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 346 affected, to run in CI (--quick)
Label player-facing: no label (a fix)

🤖 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/3606 **Author:** [@degepie](https://github.com/degepie) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix/issue-3028-splash-sounds` --- ### 📝 Commits (1) - [`81445f5`](https://github.com/horizon-rust/horizon/commit/81445f5218f5dc080490697915ca202d7d59ada9) Splash sounds and particles when the player falls into water ### 📊 Changes **1 file changed** (+32 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/remote.rs` (+32 -0) </details> ### 📄 Description > 🤖 Opened by degepie's AI agent (Claude Code), not by degepie personally. Fixes #3028. ## What Falling into water made no splash sound and showed no splash or bubble particles for the player. Mobs and dropped items already splashed. ## Vanilla `Entity.doWaterSplashEffect` runs when an entity starts touching water (`Entity.updateInWaterStateAndDoFluidPushing`, skipped on the first tick). It plays `entity.player.splash`, or `entity.player.splash.high_speed` when the volume is 0.25 or more (the volume comes from the velocity), and adds BUBBLE and SPLASH particles at the water surface. For a player the sound goes through `Player.playSound`, which passes the player as the excluded listener. `ServerLevel.playSeededSound` therefore sends it to everyone except that player, and `ClientLevel.playSeededSound` plays it only when the excluded entity is the local player. So the local player's splash is played by its own client. The particles come from `level.addParticle`, which also happens on the client. ## How Singleplayer runs the player through the remote client path (`game/remote.rs`, the `controlled_simulation_tick` loop). The motion code already sends `MotionEvent::Splash` and `MotionEvent::SplashParticle` (`motion/fluids.rs`, the `water_splash` port), and the in-process tick in `game.rs` handles them, but the remote loop dropped both through its catch-all arm. This PR adds the two arms there, matching how `game.rs` handles them: the sound at the player's feet and the particles added locally. ## Verified Scratch home, `--offscreen`, `HORIZON_NO_AUDIO=1`. The sounds are read from `horizon-ctl status` → `heard`, which counts positional plays even with audio off. I built a 3-deep water pool with `fill` and teleported the player above it: - v0.2.91: falling in from y=115 → `heard` only has `block.water.ambient` and `ui.hud.bubble_pop`, and no `bubble` particles. - This branch: falling in from y=115 → `entity.player.splash` +1, `bubble` 0→13, `splash` 1→14. A short drop (y=104) → another `entity.player.splash`. A drop from y=160 → `entity.player.splash.high_speed`. - Mobs (cow, pig) and a dropped item already play `entity.generic.splash` from the server in v0.2.91, and they are untouched here. ## Known differences None known. The SPLASH game event stays the server's job, as before. **pr_ready** (`tools/pr_ready.py --quick` on horizon-build, against origin/main at 8f0c17895, 7 min 33 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +32 −0 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 408 passed (35 s) | | rustfmt | ✅ (8 s) | | clippy | ✅ (3 min 26 s) | | tests: horizon-client | ✅ 798 passed (3 min 5 s) | | doc tests | ✅ 0 passed (17 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 346 affected, to run in CI (--quick) | | Label | player-facing: no label (a fix) | 🤖 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 05:10:10 +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#5092
No description provided.