aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoringlettronald <71849533+inglettronald@users.noreply.github.com>2023-01-28 15:29:54 -0600
committerGitHub <noreply@github.com>2023-01-28 15:29:54 -0600
commit0592807a5e75dcde0288b5fc9a45bf47a5c17f8e (patch)
tree14f16c4a51e9e51ee07c40c6c5174b4d4b05e8a5
parentd13f43266a82c81962af8471f471a7824a0bcf7b (diff)
parentec53d3499d9f9109a6ecf39af3a03196732d5de5 (diff)
downloadDulkirMod-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.kt5
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) {
+ }
}
}
}