From ec53d3499d9f9109a6ecf39af3a03196732d5de5 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Thu, 26 Jan 2023 09:41:44 +0100 Subject: Hide sound errors. --- src/main/kotlin/dulkirmod/features/chat/AbiphoneDND.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/main/kotlin') diff --git a/src/main/kotlin/dulkirmod/features/chat/AbiphoneDND.kt b/src/main/kotlin/dulkirmod/features/chat/AbiphoneDND.kt index f0a5cb0..9212bbd 100644 --- a/src/main/kotlin/dulkirmod/features/chat/AbiphoneDND.kt +++ b/src/main/kotlin/dulkirmod/features/chat/AbiphoneDND.kt @@ -19,7 +19,10 @@ class AbiphoneDND { if (System.currentTimeMillis() - lastRing < 5000) { if (event.name == "note.pling" && event.sound.volume == 0.69f && event.sound.pitch == 1.6666666f) { // This throws an error but still blocks the sound. Not a great solution, but it works for now - event.isCanceled = true + try { + event.isCanceled = true + } catch (ignored: IllegalArgumentException) { + } } } } -- cgit