diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-01-26 09:41:44 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-01-26 09:41:44 +0100 |
commit | ec53d3499d9f9109a6ecf39af3a03196732d5de5 (patch) | |
tree | 14f16c4a51e9e51ee07c40c6c5174b4d4b05e8a5 | |
parent | d13f43266a82c81962af8471f471a7824a0bcf7b (diff) | |
download | DulkirMod-ec53d3499d9f9109a6ecf39af3a03196732d5de5.tar.gz DulkirMod-ec53d3499d9f9109a6ecf39af3a03196732d5de5.tar.bz2 DulkirMod-ec53d3499d9f9109a6ecf39af3a03196732d5de5.zip |
Hide sound errors.
-rw-r--r-- | src/main/kotlin/dulkirmod/features/chat/AbiphoneDND.kt | 5 |
1 files changed, 4 insertions, 1 deletions
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) { + } } } } |