aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal002@users.noreply.github.com>2024-08-31 20:56:42 +0200
committerGitHub <noreply@github.com>2024-08-31 20:56:42 +0200
commitbf8722e892f9669bdf316d483da538d212398b23 (patch)
treefce048b4afe2e0407eaac319d89aaa98e718df5c /src/main
parenta8bd35b975d8739816785918961d8d553a19771f (diff)
downloadskyhanni-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>
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/SoundUtils.kt3
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) {