[PR #7009] [MERGED] A skeleton horse splashes and swims with its own water sounds #7267

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7009
Author: @MSedgeMC
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: fix/skeleton-swim-sound


📝 Commits (1)

  • 34ea5ed A skeleton horse splashes and swims with its own water sounds

📊 Changes

4 files changed (+111 additions, -15 deletions)

View changed files

📝 crates/horizon-client/src/mobs/ai.rs (+6 -2)
📝 crates/horizon-client/src/mobs/equine.rs (+94 -0)
📝 crates/horizon-client/src/mobs/living.rs (+9 -11)
📝 tools/port_map/game-011.tsv (+2 -2)

📄 Description

Vanilla

SkeletonHorse.getSwimSound is an override, not the generic splash:

protected SoundEvent getSwimSound() {
   if (this.onGround()) {
      if (!this.isVehicle()) return SoundEvents.SKELETON_HORSE_STEP_WATER;
      this.gallopSoundCounter++;
      if (this.gallopSoundCounter > 5 && this.gallopSoundCounter % 3 == 0) return SoundEvents.SKELETON_HORSE_GALLOP_WATER;
      return this.gallopSoundCounter <= 5 ? SoundEvents.SKELETON_HORSE_STEP_WATER : SoundEvents.SKELETON_HORSE_SWIM;
   }
   return SoundEvents.SKELETON_HORSE_SWIM;
}

SkeletonHorse.playSwimSound(float f) maps the volume Entity.waterSwimSound
worked out: 0.3 on the ground, else Math.min(0.1F, f * 25.0F) - which is
0.1 for any speed a swim sound is actually played at.

What Horizon got wrong

mobs::ai::swim_sound had no skeleton horse entry, and a skeleton horse is not
a monster, so every one of them swam with entity.generic.swim at the full
speed-based volume - up to 0.35 where vanilla caps it at 0.1, and a different
sound. gallopSoundCounter was only counted by AbstractHorse.playStepSound,
so a ridden skeleton horse's water steps never reached it.

This adds the override in equine.rs (skeleton_horse_swim_sound,
swim_volume) and calls it from the water branch of
Entity.applyMovementEmissionAndPlaySound in living.rs, on the same
steps.gallop counter the hoof steps use. getSwimSound is now asked for the
sound before the mute check, as Entity.playSwimSound asks for its argument
first. The ridden test is Entity.isVehicle (a player's rider or a mob that
boarded it in extra.rider), so a skeleton trap's horse counts too.

The two tools/port_map/game-011.tsv rows that had these as missing are
corrected in the same PR.

Proven

cargo test -q -p horizon-client-lib --lib mobs::equine on the build VM:
6 passed; 0 failed; 1395 filtered out. The two new tests walk the whole
decision table - swim in the water, splash standing unridden, then on the
gallop counter five step_water, gallop_water, swim, swim,
gallop_water - and the volume mapping (0.3 on the ground, 0.1 at any real
speed in the water), with a plain horse keeping entity.generic.swim and its
unchanged volume.

cargo clippy -q -p horizon-client-lib --lib and -p horizon-client --lib are
silent; rustfmt --edition 2024 --check on the three files is clean.

Not proven

Nothing was heard in game. The in-game check is to push a skeleton horse into
water and listen for entity.skeleton_horse.swim instead of the generic
splash, then ride one across a shallow stream and hear step_water turn into
gallop_water on the third step.


🔄 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/7009 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/skeleton-swim-sound` --- ### 📝 Commits (1) - [`34ea5ed`](https://github.com/horizon-rust/horizon/commit/34ea5ed3ee39ee622d6e78154ae4a0a9193feead) A skeleton horse splashes and swims with its own water sounds ### 📊 Changes **4 files changed** (+111 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mobs/ai.rs` (+6 -2) 📝 `crates/horizon-client/src/mobs/equine.rs` (+94 -0) 📝 `crates/horizon-client/src/mobs/living.rs` (+9 -11) 📝 `tools/port_map/game-011.tsv` (+2 -2) </details> ### 📄 Description ## Vanilla `SkeletonHorse.getSwimSound` is an override, not the generic splash: ```java protected SoundEvent getSwimSound() { if (this.onGround()) { if (!this.isVehicle()) return SoundEvents.SKELETON_HORSE_STEP_WATER; this.gallopSoundCounter++; if (this.gallopSoundCounter > 5 && this.gallopSoundCounter % 3 == 0) return SoundEvents.SKELETON_HORSE_GALLOP_WATER; return this.gallopSoundCounter <= 5 ? SoundEvents.SKELETON_HORSE_STEP_WATER : SoundEvents.SKELETON_HORSE_SWIM; } return SoundEvents.SKELETON_HORSE_SWIM; } ``` `SkeletonHorse.playSwimSound(float f)` maps the volume `Entity.waterSwimSound` worked out: `0.3` on the ground, else `Math.min(0.1F, f * 25.0F)` - which is `0.1` for any speed a swim sound is actually played at. ## What Horizon got wrong `mobs::ai::swim_sound` had no skeleton horse entry, and a skeleton horse is not a monster, so every one of them swam with `entity.generic.swim` at the full speed-based volume - up to 0.35 where vanilla caps it at 0.1, and a different sound. `gallopSoundCounter` was only counted by `AbstractHorse.playStepSound`, so a ridden skeleton horse's water steps never reached it. This adds the override in `equine.rs` (`skeleton_horse_swim_sound`, `swim_volume`) and calls it from the water branch of `Entity.applyMovementEmissionAndPlaySound` in `living.rs`, on the same `steps.gallop` counter the hoof steps use. `getSwimSound` is now asked for the sound before the mute check, as `Entity.playSwimSound` asks for its argument first. The ridden test is `Entity.isVehicle` (a player's `rider` or a mob that boarded it in `extra.rider`), so a skeleton trap's horse counts too. The two `tools/port_map/game-011.tsv` rows that had these as `missing` are corrected in the same PR. ## Proven `cargo test -q -p horizon-client-lib --lib mobs::equine` on the build VM: `6 passed; 0 failed; 1395 filtered out`. The two new tests walk the whole decision table - swim in the water, splash standing unridden, then on the gallop counter five `step_water`, `gallop_water`, `swim`, `swim`, `gallop_water` - and the volume mapping (0.3 on the ground, 0.1 at any real speed in the water), with a plain horse keeping `entity.generic.swim` and its unchanged volume. `cargo clippy -q -p horizon-client-lib --lib` and `-p horizon-client --lib` are silent; `rustfmt --edition 2024 --check` on the three files is clean. ## Not proven Nothing was heard in game. The in-game check is to push a skeleton horse into water and listen for `entity.skeleton_horse.swim` instead of the generic splash, then ride one across a shallow stream and hear `step_water` turn into `gallop_water` on the third step. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:36:47 +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#7267
No description provided.