[PR #2258] [MERGED] Play the rain sound the way vanilla picks it #4152

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2258
Author: @kacpherek
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: fix/rain-sound-vanilla


📝 Commits (4)

  • 147e526 Play the rain sound the way vanilla picks it
  • 53ea3e7 Play the rain sound for this client only
  • 751f242 Merge origin/main into fix/rain-sound-vanilla
  • cacd393 Merge origin/main into fix/rain-sound-vanilla

📊 Changes

2 files changed (+32 additions, -38 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+4 -34)
📝 crates/horizon-client/src/game/render_tick.rs (+28 -4)

📄 Description

What and why

The rain sound was rolled on its own with a made-up rule (a one-in-five chance per tick, no relation to the rain splashes) and played the louder, normal sound even when the player stood under a roof. Vanilla ties it to the last rain splash column of the tick: a counter that grows each rainy tick makes the sound more likely the longer it has been quiet, and when the player is under cover and the rain column is above them it plays the quieter weather.rain.above instead.

The sound now comes out of the rain splash loop in tick_particles (which already follows ClientLevel.tickWeatherEffects with the same seeded random), so it also runs for the server thread's client, which had no rain sound at all.

Vanilla reference

  • ClientLevel.tickWeatherEffects: rainParticlePosition, random.nextInt(3) < rainSoundTime++, WEATHER_RAIN_ABOVE (0.1, 0.5) when the column is more than one block above the camera and the camera column is roofed, otherwise WEATHER_RAIN (0.2, 1.0)

Self-check

cargo check -p horizon-client passes.


🔄 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/2258 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/rain-sound-vanilla` --- ### 📝 Commits (4) - [`147e526`](https://github.com/horizon-rust/horizon/commit/147e5269c76430060007b13a1dc947a99062896c) Play the rain sound the way vanilla picks it - [`53ea3e7`](https://github.com/horizon-rust/horizon/commit/53ea3e7224480c6e72c73a7fd4404bd0cde04fb1) Play the rain sound for this client only - [`751f242`](https://github.com/horizon-rust/horizon/commit/751f2428248ec983775f59f5902160adc4c83776) Merge origin/main into fix/rain-sound-vanilla - [`cacd393`](https://github.com/horizon-rust/horizon/commit/cacd39338fd9648d568cecf1ea674796dafe8329) Merge origin/main into fix/rain-sound-vanilla ### 📊 Changes **2 files changed** (+32 additions, -38 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+4 -34) 📝 `crates/horizon-client/src/game/render_tick.rs` (+28 -4) </details> ### 📄 Description ## What and why The rain sound was rolled on its own with a made-up rule (a one-in-five chance per tick, no relation to the rain splashes) and played the louder, normal sound even when the player stood under a roof. Vanilla ties it to the last rain splash column of the tick: a counter that grows each rainy tick makes the sound more likely the longer it has been quiet, and when the player is under cover and the rain column is above them it plays the quieter `weather.rain.above` instead. The sound now comes out of the rain splash loop in `tick_particles` (which already follows `ClientLevel.tickWeatherEffects` with the same seeded random), so it also runs for the server thread's client, which had no rain sound at all. ## Vanilla reference - `ClientLevel.tickWeatherEffects`: `rainParticlePosition`, `random.nextInt(3) < rainSoundTime++`, `WEATHER_RAIN_ABOVE` (0.1, 0.5) when the column is more than one block above the camera and the camera column is roofed, otherwise `WEATHER_RAIN` (0.2, 1.0) ## Self-check `cargo check -p horizon-client` passes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:15:03 +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#4152
No description provided.