aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/dulkirmod/features/chat/DoubleHookDing.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/dulkirmod/features/chat/DoubleHookDing.kt')
-rw-r--r--src/main/kotlin/dulkirmod/features/chat/DoubleHookDing.kt20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main/kotlin/dulkirmod/features/chat/DoubleHookDing.kt b/src/main/kotlin/dulkirmod/features/chat/DoubleHookDing.kt
new file mode 100644
index 0000000..fa56966
--- /dev/null
+++ b/src/main/kotlin/dulkirmod/features/chat/DoubleHookDing.kt
@@ -0,0 +1,20 @@
+package dulkirmod.features.chat
+
+import dulkirmod.DulkirMod
+import dulkirmod.config.DulkirConfig
+import net.minecraft.client.audio.SoundCategory
+import net.minecraftforge.client.event.ClientChatReceivedEvent
+
+object DoubleHookDing {
+ fun handle(event: ClientChatReceivedEvent, unformatted: String) {
+ if (unformatted.startsWith("It's a Double Hook!")) {
+ if (DulkirConfig.doubleHookDing) {
+ val prevNote = DulkirMod.mc.gameSettings.getSoundLevel(SoundCategory.RECORDS)
+ DulkirMod.mc.gameSettings.setSoundLevel(SoundCategory.RECORDS, 1f)
+ DulkirMod.mc.thePlayer.playSound("note.pling", 1f * DulkirConfig.secretSoundVolume, 1f)
+ DulkirMod.mc.gameSettings.setSoundLevel(SoundCategory.RECORDS, prevNote)
+ }
+ if (DulkirConfig.removeHookMessage) event.isCanceled = true
+ }
+ }
+} \ No newline at end of file