Fixed wind sounds whilst not fading

This commit is contained in:
Sollace 2022-09-22 12:46:45 +02:00
parent 2e14403f93
commit 2f5c191bd2

View file

@ -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;
}
}