aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/dulkirmod/features/chat/DoubleHookDing.kt
diff options
context:
space:
mode:
authoringlettronald <inglettronald@gmail.com>2023-06-05 13:53:26 -0500
committeringlettronald <inglettronald@gmail.com>2023-06-05 13:53:26 -0500
commit44daa2779ae9e9462af9b0c19cd6838bf94d165d (patch)
tree3b0e6652c72443f65be417d392976df0e63849f1 /src/main/kotlin/dulkirmod/features/chat/DoubleHookDing.kt
parent27916b0a2cd045c61c156cb0439cb8ed9cf656f7 (diff)
downloadDulkirMod-44daa2779ae9e9462af9b0c19cd6838bf94d165d.tar.gz
DulkirMod-44daa2779ae9e9462af9b0c19cd6838bf94d165d.tar.bz2
DulkirMod-44daa2779ae9e9462af9b0c19cd6838bf94d165d.zip
double hook impl
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