diff options
author | inglettronald <71849533+inglettronald@users.noreply.github.com> | 2023-01-28 15:29:54 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-28 15:29:54 -0600 |
commit | 0592807a5e75dcde0288b5fc9a45bf47a5c17f8e (patch) | |
tree | 14f16c4a51e9e51ee07c40c6c5174b4d4b05e8a5 | |
parent | d13f43266a82c81962af8471f471a7824a0bcf7b (diff) | |
parent | ec53d3499d9f9109a6ecf39af3a03196732d5de5 (diff) | |
download | DulkirMod-0592807a5e75dcde0288b5fc9a45bf47a5c17f8e.tar.gz DulkirMod-0592807a5e75dcde0288b5fc9a45bf47a5c17f8e.tar.bz2 DulkirMod-0592807a5e75dcde0288b5fc9a45bf47a5c17f8e.zip |
Merge pull request #9 from hannibal002/hide_sound_errors
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) { + } } } } |