diff options
author | hannibal2 <24389977+hannibal002@users.noreply.github.com> | 2024-06-13 22:21:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-13 22:21:50 +0200 |
commit | 529639fdd0683066eadffe93473a300a2177c008 (patch) | |
tree | d89cd9aa2c04b4a8a839b9c3b1a56d2058fa7956 /src/main/java/at/hannibal2/skyhanni/features/event | |
parent | 151865bca064421d48ec19279b759134fc428443 (diff) | |
download | skyhanni-529639fdd0683066eadffe93473a300a2177c008.tar.gz skyhanni-529639fdd0683066eadffe93473a300a2177c008.tar.bz2 skyhanni-529639fdd0683066eadffe93473a300a2177c008.zip |
Backend: for each (#1725)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/event')
3 files changed, 5 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/MythologicalCreatureTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/MythologicalCreatureTracker.kt index abac5accd..68b70a77a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/MythologicalCreatureTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/MythologicalCreatureTracker.kt @@ -81,7 +81,7 @@ object MythologicalCreatureTracker { @SubscribeEvent fun onChat(event: LorenzChatEvent) { - MythologicalCreatureType.entries.forEach { creatureType -> + for (creatureType in MythologicalCreatureType.entries) { if (creatureType.pattern.matches(event.message)) { BurrowAPI.lastBurrowRelatedChatMessage = SimpleTimeMark.now() tracker.modify { @@ -102,8 +102,7 @@ object MythologicalCreatureTracker { private fun drawDisplay(data: Data): List<List<Any>> = buildList { addAsSingletonList("§7Mythological Creature Tracker:") val total = data.count.sumAllValues() - data.count.entries.sortedByDescending { it.value }.forEach { (creatureType, amount) -> - + for ((creatureType, amount) in data.count.entries.sortedByDescending { it.value }) { val percentageSuffix = if (config.showPercentage.get()) { val percentage = LorenzUtils.formatPercentage(amount.toDouble() / total) " §7$percentage" diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/EventWaypoint.kt b/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/EventWaypoint.kt index 411e08e5e..24c97e45d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/EventWaypoint.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/EventWaypoint.kt @@ -11,7 +11,7 @@ data class EventWaypoint( fun loadEventWaypoints(waypoints: Map<String, List<EventWaypointData>>): Map<String, MutableSet<EventWaypoint>> { return buildMap { - waypoints.forEach { lobby -> + for (lobby in waypoints) { val set = mutableSetOf<EventWaypoint>() lobby.value.forEach { waypoint -> set.add(EventWaypoint(waypoint.name, waypoint.position)) } this[lobby.key] = set diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/christmas/PresentWaypoints.kt b/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/christmas/PresentWaypoints.kt index 26eb2ae1e..64c4171a3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/christmas/PresentWaypoints.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/christmas/PresentWaypoints.kt @@ -108,8 +108,8 @@ object PresentWaypoints { waypoints: Set<EventWaypoint>, shouldDraw: Boolean, color: LorenzColor, prefix: String, ) { if (!shouldDraw) return - waypoints.forEach { waypoint -> - if (!waypoint.shouldShow()) return@forEach + for (waypoint in waypoints) { + if (!waypoint.shouldShow()) continue this.drawWaypointFilled(waypoint.position, color.toColor()) this.drawDynamicText(waypoint.position, "$prefix${waypoint.name}", 1.5) } |