diff options
author | hannibal2 <24389977+hannibal002@users.noreply.github.com> | 2024-08-31 20:56:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-31 20:56:42 +0200 |
commit | bf8722e892f9669bdf316d483da538d212398b23 (patch) | |
tree | fce048b4afe2e0407eaac319d89aaa98e718df5c | |
parent | a8bd35b975d8739816785918961d8d553a19771f (diff) | |
download | skyhanni-bf8722e892f9669bdf316d483da538d212398b23.tar.gz skyhanni-bf8722e892f9669bdf316d483da538d212398b23.tar.bz2 skyhanni-bf8722e892f9669bdf316d483da538d212398b23.zip |
Backend: Stop sound errors in console (#2431)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Co-authored-by: David Cole <40234707+davidarthurcole@users.noreply.github.com>
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/SoundUtils.kt | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/SoundUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/SoundUtils.kt index 70e6242c6..79e320949 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/SoundUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/SoundUtils.kt @@ -20,6 +20,7 @@ object SoundUtils { fun ISound.playSound() { Minecraft.getMinecraft().addScheduledTask { + if (Minecraft.getMinecraft().soundHandler.isSoundPlaying(this)) return@addScheduledTask val gameSettings = Minecraft.getMinecraft().gameSettings val oldLevel = gameSettings.getSoundLevel(SoundCategory.PLAYERS) if (!SkyHanniMod.feature.misc.maintainGameVolume) { @@ -38,7 +39,7 @@ object SoundUtils { } ErrorManager.logErrorWithData( e, "Failed to play a sound", - "soundLocation" to this.soundLocation + "soundLocation" to this.soundLocation, ) } finally { if (!SkyHanniMod.feature.misc.maintainGameVolume) { |