diff --git a/crates/horizon-client/src/audio.rs b/crates/horizon-client/src/audio.rs index be6628ece..e45362e19 100644 --- a/crates/horizon-client/src/audio.rs +++ b/crates/horizon-client/src/audio.rs @@ -719,11 +719,6 @@ impl Audio { self.play(event, at, volume, pitch); self.capture = capture; } - /// `LivingEntity.handleDamageEvent`'s pitch, `(r - r) * 0.2 + 1`, drawn on the - /// client (the entity's own random there, never the server's world random). - pub fn hurt_pitch(&mut self) -> f32 { - (self.random.next_float() - self.random.next_float()) * 0.2 + 1.0 - } /// `AbstractWidget.playButtonClickSound`: an unseeded, relative UI sound. pub fn play_button_click(&mut self) { self.play_instance( diff --git a/crates/horizon-client/src/game/combat.rs b/crates/horizon-client/src/game/combat.rs index 6e1d5d82b..b74e1ae72 100644 --- a/crates/horizon-client/src/game/combat.rs +++ b/crates/horizon-client/src/game/combat.rs @@ -69,8 +69,8 @@ impl Game<'_> { /// `LivingEntity.handleDamageEvent` for the player: the hurt sound of the /// source's `DamageEffects` (`Player.getHurtSound`). pub(super) fn player_hurt_sound(&mut self, sound: &str, at: [f64; 3]) { - let pitch = self.audio.hurt_pitch(); - self.audio.play(sound, Some(at), 1.0, pitch); + // Player.getVoicePitch: always 1.0. + self.audio.play(sound, Some(at), 1.0, 1.0); } /// `CombatTracker.recordDamage` for the motion events of this tick. pub(super) fn record_combat(&mut self, events: &[MotionEvent]) { diff --git a/crates/horizon-client/src/mobs.rs b/crates/horizon-client/src/mobs.rs index f4086216d..ffb6f6f00 100644 --- a/crates/horizon-client/src/mobs.rs +++ b/crates/horizon-client/src/mobs.rs @@ -1968,8 +1968,18 @@ impl Mob { } /// LivingEntity.getVoicePitch. pub fn voice_pitch(&mut self) -> f32 { + // HappyGhast.getVoicePitch: always 1.0, babies and all. + if self.species() == Species::HappyGhast { + return 1.0; + } + // ZombieVillager.getVoicePitch: babies are 2.0, not 1.5. + let baby = if self.species() == Species::ZombieVillager { + 2.0 + } else { + 1.5 + }; let pitch = (self.random.next_float() - self.random.next_float()) * 0.2 - + if self.is_baby() { 1.5 } else { 1.0 }; + + if self.is_baby() { baby } else { 1.0 }; // Bat.getVoicePitch: a little lower. if self.species() == Species::Bat { pitch * 0.95