From 06d4a207346eaf685e8857b7bcc1cfff693b43ac Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 6 Jul 2024 10:21:26 +0200 Subject: code cleanup --- .../skyhanni/features/event/hoppity/HoppityEggLocator.kt | 12 +++++------- .../skyhanni/features/event/hoppity/HoppityEggsShared.kt | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'src/main') diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocator.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocator.kt index 893e0f6e5..419cd115c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocator.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocator.kt @@ -93,7 +93,7 @@ object HoppityEggLocator { } } - var islandEggsLocations = HoppityEggLocations.islandLocations ?: return + var islandEggsLocations = HoppityEggLocations.islandLocations if (shouldShowAllEggs()) { if (config.hideDuplicateWaypoints) { @@ -145,10 +145,8 @@ object HoppityEggLocator { ) drawDynamicText(it.add(y = 1), "§aGuess", 1.5) } - if (!drawLocations) { - if (config.showLine) { - draw3DLine(eyeLocation, it.add(0.5, 0.5, 0.5), LorenzColor.GREEN.toColor(), 2, false) - } + if (!drawLocations && config.showLine) { + draw3DLine(eyeLocation, it.add(0.5, 0.5, 0.5), LorenzColor.GREEN.toColor(), 2, false) } } } @@ -224,7 +222,7 @@ object HoppityEggLocator { lastGuessMade = SimpleTimeMark.now() possibleEggLocations = emptyList() - val islandEggsLocations = HoppityEggLocations.islandLocations ?: return + val islandEggsLocations = HoppityEggLocations.islandLocations val listSize = validParticleLocations.size if (listSize < 5) return @@ -270,7 +268,7 @@ object HoppityEggLocator { } fun isValidEggLocation(location: LorenzVec): Boolean = - HoppityEggLocations.islandLocations?.any { it.distance(location) < 5.0 } ?: false + HoppityEggLocations.islandLocations.any { it.distance(location) < 5.0 } private fun ReceiveParticleEvent.isVillagerParticle() = type == EnumParticleTypes.VILLAGER_HAPPY && speed == 0.0f && count == 1 diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsShared.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsShared.kt index c57150352..8c32e8979 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsShared.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsShared.kt @@ -49,7 +49,7 @@ object HoppityEggsShared { fun shareNearbyEggLocation(playerLocation: LorenzVec, meal: HoppityEggType, note: String) { if (!isEnabled()) return - val islandEggsLocations = HoppityEggLocations.islandLocations ?: return + val islandEggsLocations = HoppityEggLocations.islandLocations val closestEgg = islandEggsLocations.minByOrNull { it.distance(playerLocation) } ?: return val x = closestEgg.x.toInt() -- cgit