diff options
Diffstat (limited to 'src/main/kotlin/dulkirmod/features/chat/AbiphoneDND.kt')
-rw-r--r-- | src/main/kotlin/dulkirmod/features/chat/AbiphoneDND.kt | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/main/kotlin/dulkirmod/features/chat/AbiphoneDND.kt b/src/main/kotlin/dulkirmod/features/chat/AbiphoneDND.kt index d91e59e..242e226 100644 --- a/src/main/kotlin/dulkirmod/features/chat/AbiphoneDND.kt +++ b/src/main/kotlin/dulkirmod/features/chat/AbiphoneDND.kt @@ -1,9 +1,9 @@ package dulkirmod.features.chat import dulkirmod.config.DulkirConfig +import dulkirmod.events.AlwaysPlaySoundEvent import dulkirmod.utils.TextUtils import net.minecraftforge.client.event.ClientChatReceivedEvent -import net.minecraftforge.client.event.sound.PlaySoundEvent import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -11,16 +11,16 @@ private val abiphoneFormat = "✆ (\\w+) ✆ ".toRegex() private var lastRing: Long = 0 object AbiphoneDND { - //BLOCK ABIPHONE SOUNDS - @SubscribeEvent(receiveCanceled = false, priority = EventPriority.LOW) - fun onSound(event: PlaySoundEvent) { - if (!DulkirConfig.abiDND) return - if (System.currentTimeMillis() - lastRing < 5000) { - if (event.name == "note.pling" && event.sound.volume == 0.69f && event.sound.pitch == 1.6666666f) { - event.result = null - } - } - } + //BLOCK ABIPHONE SOUNDS + @SubscribeEvent(receiveCanceled = false, priority = EventPriority.LOW) + fun onSound(event: AlwaysPlaySoundEvent) { + if (!DulkirConfig.abiDND) return + if (System.currentTimeMillis() - lastRing < 5000) { + if (event.name == "note.pling" && event.sound.volume == 0.69f && event.sound.pitch == 1.6666666f) { + event.result = null + } + } + } fun handle(event: ClientChatReceivedEvent, unformatted: String) { if (!DulkirConfig.abiDND) return |