From 2f5c191bd201660ed5e8302a82617ac3cb3f67cc Mon Sep 17 00:00:00 2001 From: Sollace Date: Thu, 22 Sep 2022 12:46:45 +0200 Subject: [PATCH] Fixed wind sounds whilst not fading --- .../unicopia/client/sound/MotionBasedSoundInstance.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/minelittlepony/unicopia/client/sound/MotionBasedSoundInstance.java b/src/main/java/com/minelittlepony/unicopia/client/sound/MotionBasedSoundInstance.java index 489b1bd8..80823061 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/sound/MotionBasedSoundInstance.java +++ b/src/main/java/com/minelittlepony/unicopia/client/sound/MotionBasedSoundInstance.java @@ -36,7 +36,7 @@ public class MotionBasedSoundInstance extends FadeOutSoundInstance { y = ((float)player.getY()); z = ((float)this.player.getZ()); - float f = (float)player.getVelocity().lengthSquared(); + float f = (float)player.getVelocity().horizontalLength(); if (f >= 1.0E-7D) { volume = MathHelper.clamp(f / 4F, 0, 1); } else { @@ -55,6 +55,8 @@ public class MotionBasedSoundInstance extends FadeOutSoundInstance { pitch = 1; } + setTargetVolume(volume); + return true; } }