From d3e13e38e22b8eecd5198c59cf6a132cc9425b33 Mon Sep 17 00:00:00 2001 From: ronald Date: Sat, 29 Jul 2023 00:13:53 -0500 Subject: Lots of slayer backend and a smattering of random features (Lightning/fire culling, chat stacking improvements, aotv highlight stuff, etc) --- src/main/kotlin/com/dulkirfabric/util/Utils.kt | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/main/kotlin/com/dulkirfabric/util/Utils.kt') 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 -- cgit