From ae48ef854f96fe5a6d60d9a52f9db680de77fdf3 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Thu, 26 Jan 2023 13:07:18 +0100 Subject: New sort logic. --- .../at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt | 3 ++- .../at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features/event') diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt index 245fa85af..949b3c4e3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt @@ -3,6 +3,7 @@ package at.hannibal2.skyhanni.features.event.diana import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.utils.LocationUtils import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.LorenzUtils.sorted import at.hannibal2.skyhanni.utils.LorenzVec import at.hannibal2.skyhanni.utils.OSUtils.isActive import net.minecraft.client.Minecraft @@ -85,7 +86,7 @@ class BurrowWarpHelper { private fun getNearestWarpPoint(location: LorenzVec): WarpPoint { val map = WarpPoint.values().filter { it.enabled }.map { it to it.distance(location) } - return map.toList().sortedBy { (_, value) -> value }.first().first + return map.sorted().first().first } fun resetDisabledWarps() { 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 f8a9d5c7f..0666581d4 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 @@ -6,11 +6,11 @@ import at.hannibal2.skyhanni.events.BurrowDetectEvent import at.hannibal2.skyhanni.events.BurrowDugEvent import at.hannibal2.skyhanni.events.EntityMoveEvent import at.hannibal2.skyhanni.events.SoopyGuessBurrowEvent -import at.hannibal2.skyhanni.test.GriffinUtils.draw3DLine import at.hannibal2.skyhanni.utils.BlockUtils.getBlockAt import at.hannibal2.skyhanni.utils.LocationUtils import at.hannibal2.skyhanni.utils.LorenzColor import at.hannibal2.skyhanni.utils.LorenzVec +import at.hannibal2.skyhanni.utils.RenderUtils.draw3DLine import at.hannibal2.skyhanni.utils.RenderUtils.drawColor import at.hannibal2.skyhanni.utils.RenderUtils.drawString import net.minecraft.client.Minecraft @@ -198,7 +198,7 @@ class GriffinBurrowHelper { var vector = target.subtract(animation) - event.draw3DLine(animation.add(0.5, 0.5, 0.5), target.add(0.5, 0.5, 0.5), LorenzColor.WHITE, 2, true) + event.draw3DLine(animation.add(0.5, 0.5, 0.5), target.add(0.5, 0.5, 0.5), LorenzColor.WHITE.toColor(), 2, true) vector = vector.multiply(1 / vector.length()) vector = vector.multiply(0.18) -- cgit