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/rift | |
| 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/rift')
3 files changed, 13 insertions, 12 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/colosseum/BlobbercystsHighlight.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/colosseum/BlobbercystsHighlight.kt index 900d207a7..02cd3a24e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/colosseum/BlobbercystsHighlight.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/colosseum/BlobbercystsHighlight.kt @@ -26,10 +26,11 @@ object BlobbercystsHighlight { fun onTick(event: LorenzTickEvent) { if (!isEnabled()) return if (!event.isMod(5)) return - EntityUtils.getEntities<EntityOtherPlayerMP>().forEach { - if (it.name == BLOBBER_NAME) { - RenderLivingEntityHelper.setEntityColorWithNoHurtTime(it, Color.RED.withAlpha(80)) { isEnabled() } - entityList.add(it) + val color = Color.RED.withAlpha(80) + for (player in EntityUtils.getEntities<EntityOtherPlayerMP>()) { + if (player.name == BLOBBER_NAME) { + RenderLivingEntityHelper.setEntityColorWithNoHurtTime(player, color) { isEnabled() } + entityList.add(player) } } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/VerminTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/VerminTracker.kt index e5b5d9586..8377e5c76 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/VerminTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/VerminTracker.kt @@ -87,7 +87,7 @@ object VerminTracker { @SubscribeEvent fun onChat(event: LorenzChatEvent) { - VerminType.entries.forEach { verminType -> + for (verminType in VerminType.entries) { if (verminType.pattern.matches(event.message)) { tracker.modify { it.count.addOrPut(verminType, 1) } @@ -152,7 +152,7 @@ object VerminTracker { private fun drawDisplay(data: Data): List<List<Any>> = buildList { addAsSingletonList("§7Vermin Tracker:") - data.count.entries.sortedBy { it.key.order }.forEach { (vermin, amount) -> + for ((vermin, amount) in data.count.entries.sortedBy { it.key.order }) { val verminName = vermin.vermin addAsSingletonList(" §7- §e${amount.addSeparators()} $verminName") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/CruxTalismanDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/CruxTalismanDisplay.kt index a5fa44386..ccdb19fc5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/CruxTalismanDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/CruxTalismanDisplay.kt @@ -62,21 +62,21 @@ object CruxTalismanDisplay { if (displayLine.isNotEmpty()) { addAsSingletonList("§7Crux Talisman Progress: ${if (maxed) "§a§lMAXED!" else "§a$percentValue%"}") if (!maxed) { - displayLine.forEach { + for (line in displayLine) { percent += if (config.compactWhenMaxed) { - if (!it.maxed) { - "(?<progress>\\d+)/\\d+".toRegex().find(it.progress.removeColor())?.groupValues?.get(1) + if (!line.maxed) { + "(?<progress>\\d+)/\\d+".toRegex().find(line.progress.removeColor())?.groupValues?.get(1) ?.toInt() ?: 0 } else 100 } else { - if (it.progress.contains("MAXED")) + if (line.progress.contains("MAXED")) 100 else { - "(?<progress>\\d+)/\\d+".toRegex().find(it.progress.removeColor())?.groupValues?.get(1) + "(?<progress>\\d+)/\\d+".toRegex().find(line.progress.removeColor())?.groupValues?.get(1) ?.toInt() ?: 0 } } - addAsSingletonList(" ${it.tier} ${it.name}: ${it.progress}") + addAsSingletonList(" ${line.tier} ${line.name}: ${line.progress}") } } } |
