aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-07-06 10:21:26 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-07-06 10:21:26 +0200
commit06d4a207346eaf685e8857b7bcc1cfff693b43ac (patch)
treeefd8fa7390cee77c4fa672bdac56ad76aaf62d21 /src/main
parentb2079e539284b34892d24ab4f2411fbe8d920b3e (diff)
downloadskyhanni-06d4a207346eaf685e8857b7bcc1cfff693b43ac.tar.gz
skyhanni-06d4a207346eaf685e8857b7bcc1cfff693b43ac.tar.bz2
skyhanni-06d4a207346eaf685e8857b7bcc1cfff693b43ac.zip
code cleanup
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocator.kt12
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsShared.kt2
2 files changed, 6 insertions, 8 deletions
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()