From a573502bb60a788515818a930507b55bb2a1de6a Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Fri, 30 Sep 2022 02:25:46 +0200 Subject: fixed order --- .../features/slayer/blaze/BlazeSlayerDaggerHelper.kt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features/slayer') diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerDaggerHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerDaggerHelper.kt index c9a010cef..be8871bd5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerDaggerHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerDaggerHelper.kt @@ -56,10 +56,10 @@ class BlazeSlayerDaggerHelper { val first = Dagger.values()[SkyHanniMod.feature.slayer.blazeFirstDagger] val second = first.other() - textTopLeft = format(holding, true, first, lastNearest) - textTopRight = format(holding, true, second, lastNearest) - textBottomLeft = format(holding, false, first, lastNearest) - textBottomRight = format(holding, false, second, lastNearest) + textTopLeft = format(holding, true, first) + textTopRight = format(holding, true, second) + textBottomLeft = format(holding, false, first) + textBottomRight = format(holding, false, second) } private fun findNearest(): HellionShield? { @@ -73,11 +73,11 @@ class BlazeSlayerDaggerHelper { return HellionShieldHelper.hellionShieldMobs .filter { it.key.getLorenzVec().distance(playerLocation) < 10 && it.key.health > 0 } .toSortedMap { a, b -> - if (a.getLorenzVec().distance(playerLocation) < b.getLorenzVec().distance(playerLocation)) 1 else 0 + if (a.getLorenzVec().distance(playerLocation) > b.getLorenzVec().distance(playerLocation)) 1 else 0 }.firstNotNullOfOrNull { it.value } } - private fun format(dagger: Dagger, active: Boolean, compareInHand: Dagger, nearestShield: HellionShield?): String { + private fun format(dagger: Dagger, active: Boolean, compareInHand: Dagger): String { var daggerInHand = dagger val inHand = dagger == compareInHand @@ -91,17 +91,17 @@ class BlazeSlayerDaggerHelper { } return if (inHand && active) { - if (nearestShield == null) { + if (lastNearest == null) { "§7[" + shield.chatColor + shield.cleanName + "§7]" } else { - if ((shield == nearestShield)) { + if ((shield == lastNearest)) { "§a[" + shield.chatColor + shield.cleanName.uppercase() + "§a]" } else { "§c[§m" + shield.chatColor + shield.cleanName + "§c]" } } } else { - if (shield == nearestShield) { + if (shield == lastNearest) { "§6[" + shield.chatColor + shield.cleanName + "§6]" } else { shield.chatColor + shield.cleanName -- cgit