aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/com/dulkirfabric/util/Utils.kt
diff options
context:
space:
mode:
authorronald <inglettronald@gmail.com>2023-07-29 00:13:53 -0500
committerronald <inglettronald@gmail.com>2023-07-29 00:13:53 -0500
commitd3e13e38e22b8eecd5198c59cf6a132cc9425b33 (patch)
treee70a8fdc86d00cf22a281fcde09b856f09b45a11 /src/main/kotlin/com/dulkirfabric/util/Utils.kt
parent71b8238eff91de0243e641c2eeadacd61b8f0f88 (diff)
downloadDulkirMod-Fabric-d3e13e38e22b8eecd5198c59cf6a132cc9425b33.tar.gz
DulkirMod-Fabric-d3e13e38e22b8eecd5198c59cf6a132cc9425b33.tar.bz2
DulkirMod-Fabric-d3e13e38e22b8eecd5198c59cf6a132cc9425b33.zip
Lots of slayer backend and a smattering of random features (Lightning/fire culling, chat stacking improvements, aotv highlight stuff, etc)
Diffstat (limited to 'src/main/kotlin/com/dulkirfabric/util/Utils.kt')
-rw-r--r--src/main/kotlin/com/dulkirfabric/util/Utils.kt13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/main/kotlin/com/dulkirfabric/util/Utils.kt b/src/main/kotlin/com/dulkirfabric/util/Utils.kt
index 93597d2..1f781d3 100644
--- a/src/main/kotlin/com/dulkirfabric/util/Utils.kt
+++ b/src/main/kotlin/com/dulkirfabric/util/Utils.kt
@@ -1,6 +1,9 @@
package com.dulkirfabric.util
import com.dulkirfabric.events.PlaySoundEvent
+import com.dulkirfabric.events.SlayerBossEvents
+import com.dulkirfabric.events.chat.ChatEvents
+import meteordevelopment.orbit.EventHandler
import net.minecraft.entity.Entity
import net.minecraft.util.math.Vec3d
@@ -13,9 +16,7 @@ object Utils {
* Prints relevant information about a sound that is being displayed
*/
fun debugSound(event: PlaySoundEvent) {
- if (event.sound.id.path == "entity.player.hurt"
- && event.sound.pitch == 0f
- && event.sound.volume == 0f) return
+ if (event.sound.id.path == "entity.player.hurt") return
println("Path: ${event.sound.id.path}")
println("Pitch: ${event.sound.pitch}")
println("Volume: ${event.sound.volume}")
@@ -32,4 +33,10 @@ object Utils {
val prevPos = Vec3d(this.prevX, this.prevY, this.prevZ)
return lerp(prevPos, this.pos, tickDelta)
}
+
+ @EventHandler
+ fun detectSlayerKill(event: ChatEvents.AllowChat) {
+ if (event.message.string.trim() != "SLAYER QUEST COMPLETE!") return
+ SlayerBossEvents.Kill(ScoreBoardUtils.slayerType?: return ScoreBoardUtils.err()).post()
+ }
} \ No newline at end of file