diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-01-31 19:41:10 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-01-31 19:41:10 +0100 |
commit | fa6338aa9630e22484f82cd51309d2558c0433bb (patch) | |
tree | 0364441bf2eb85adeb1840cd2204212b6ee9c251 /src/main | |
parent | d58dfb57cc78d0a73b81a58e01b6e17899355924 (diff) | |
download | skyhanni-fa6338aa9630e22484f82cd51309d2558c0433bb.tar.gz skyhanni-fa6338aa9630e22484f82cd51309d2558c0433bb.tar.bz2 skyhanni-fa6338aa9630e22484f82cd51309d2558c0433bb.zip |
Properly deleting diana target markers when manually clearing griffin burrows by talking to Diana NPC.
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt index c6b772d6c..722bdcd12 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt @@ -43,8 +43,6 @@ object GriffinBurrowHelper { var targetLocation: LorenzVec? = null private var guessLocation: LorenzVec? = null private var particleBurrows = mapOf<LorenzVec, BurrowType>() - - private var lastGuessTime = 0L var lastTitleSentTime = SimpleTimeMark.farPast() @SubscribeEvent @@ -96,7 +94,6 @@ object GriffinBurrowHelper { @SubscribeEvent fun onBurrowGuess(event: BurrowGuessEvent) { EntityMovementData.addToTrack(Minecraft.getMinecraft().thePlayer) - lastGuessTime = System.currentTimeMillis() guessLocation = event.guessLocation update() @@ -139,16 +136,23 @@ object GriffinBurrowHelper { if (event.message.startsWith("§c ☠ §r§7You were killed by §r")) { particleBurrows = particleBurrows.editCopy { keys.removeIf { this[it] == BurrowType.MOB } } } + + // talking to Diana NPC if (event.message == "§6Poof! §r§eYou have cleared your griffin burrows!") { - guessLocation = null - particleBurrows = emptyMap() + resetAllData() } } - @SubscribeEvent - fun onWorldChange(event: LorenzWorldChangeEvent) { + private fun resetAllData() { guessLocation = null + targetLocation = null particleBurrows = emptyMap() + update() + } + + @SubscribeEvent + fun onWorldChange(event: LorenzWorldChangeEvent) { + resetAllData() } private fun findBlock(point: LorenzVec): LorenzVec { @@ -319,8 +323,7 @@ object GriffinBurrowHelper { val type: BurrowType = when (strings[0].lowercase()) { "reset" -> { - particleBurrows = emptyMap() - update() + resetAllData() LorenzUtils.chat("Manually reset all burrow waypoints.") return } |