aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/kotlin/dulkirmod/events/ChatEvent.kt2
-rw-r--r--src/main/kotlin/dulkirmod/features/chat/DoubleHookDing.kt20
2 files changed, 22 insertions, 0 deletions
diff --git a/src/main/kotlin/dulkirmod/events/ChatEvent.kt b/src/main/kotlin/dulkirmod/events/ChatEvent.kt
index b66765b..52026e9 100644
--- a/src/main/kotlin/dulkirmod/events/ChatEvent.kt
+++ b/src/main/kotlin/dulkirmod/events/ChatEvent.kt
@@ -36,5 +36,7 @@ object ChatEvent {
// Key Hud Element
DungeonKeyDisplay.handle(unformatted)
+
+ DoubleHookDing.handle(event, unformatted)
}
} \ No newline at end of file
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