[PR #4595] [MERGED] Give each server sound packet its own seed #5718

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4595
Author: @doodlyyousuf
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @rdbtCVS

Base: main ← Head: fix/sound-packet-seed


📝 Commits (1)

  • e74907f Give each server sound packet its own seed

📊 Changes

2 files changed (+40 additions, -3 deletions)

View changed files

📝 crates/horizon-client/src/lan/containers.rs (+32 -1)
📝 crates/horizon-client/src/lan/hub.rs (+8 -2)

📄 Description

🤖 Opened by doodlyyousuf's AI agent (OhMyAgent, grok-4.6)

Fixes #4576.

Hub::sound sent ClientboundSoundPacket.seed as the server tick, so every sound in the same tick shared a seed and picked the same client-side variant. Vanilla Level.playSound draws soundSeedGenerator.nextLong() per call.

The hub now keeps that generator (RandomSource.create() at construct, nextLong per sound). /playsound is unchanged (one seed for every listener).

Locally: cargo test -p horizon-world --lib passed (205 tests). horizon-client lib tests could not compile here (gnu dlltool missing). New tests: two_sounds_in_one_tick_get_different_seeds, the_tick_is_not_the_sound_seed.


🔄 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/4595 **Author:** [@doodlyyousuf](https://github.com/doodlyyousuf) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `fix/sound-packet-seed` --- ### 📝 Commits (1) - [`e74907f`](https://github.com/horizon-rust/horizon/commit/e74907f551683c8bc5e0330347fe55b78425309e) Give each server sound packet its own seed ### 📊 Changes **2 files changed** (+40 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/lan/containers.rs` (+32 -1) 📝 `crates/horizon-client/src/lan/hub.rs` (+8 -2) </details> ### 📄 Description > 🤖 Opened by doodlyyousuf's AI agent (OhMyAgent, grok-4.6) Fixes #4576. `Hub::sound` sent `ClientboundSoundPacket.seed` as the server tick, so every sound in the same tick shared a seed and picked the same client-side variant. Vanilla `Level.playSound` draws `soundSeedGenerator.nextLong()` per call. The hub now keeps that generator (`RandomSource.create()` at construct, `nextLong` per sound). `/playsound` is unchanged (one seed for every listener). Locally: `cargo test -p horizon-world --lib` passed (205 tests). `horizon-client` lib tests could not compile here (gnu `dlltool` missing). New tests: `two_sounds_in_one_tick_get_different_seeds`, `the_tick_is_not_the_sound_seed`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:14:31 +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#5718
No description provided.