blob: d96e4559fbc00213c726eefd3a839fcca55f9458 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
package at.hannibal2.skyhanni.features.dungeon
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.api.event.HandleEvent
import at.hannibal2.skyhanni.data.IslandType
import at.hannibal2.skyhanni.data.TitleManager
import at.hannibal2.skyhanni.events.minecraft.packet.PacketReceivedEvent
import at.hannibal2.skyhanni.mixins.transformers.AccessorWorldBoarderPacket
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.utils.SoundUtils
import net.minecraft.network.play.server.S44PacketWorldBorder
import kotlin.time.Duration.Companion.seconds
@SkyHanniModule
object DungeonShadowAssassinNotification {
private val config get() = SkyHanniMod.feature.dungeon
@HandleEvent(onlyOnIsland = IslandType.CATACOMBS)
fun onWorldBoarderChange(event: PacketReceivedEvent) {
if (!isEnabled()) return
if (DungeonAPI.dungeonFloor?.contains("3") == true && DungeonAPI.inBossRoom) return
val packet = event.packet as? AccessorWorldBoarderPacket ?: return
val action = packet.action
val warningTime = packet.warningTime
if (action == S44PacketWorldBorder.Action.INITIALIZE && warningTime == 10000) {
TitleManager.sendTitle("§cShadow Assassin Jumping!", 2.seconds, 3.6, 7.0f)
SoundUtils.playBeepSound()
}
}
private fun isEnabled() = config.shadowAssassinJumpNotifier
}
|