From 529639fdd0683066eadffe93473a300a2177c008 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Thu, 13 Jun 2024 22:21:50 +0200 Subject: Backend: for each (#1725) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../skyhanni/features/nether/MatriarchHelper.kt | 4 ++-- .../reputationhelper/CrimsonIsleReputationHelper.kt | 19 +++++++++---------- 2 files changed, 11 insertions(+), 12 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features/nether') diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/MatriarchHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/MatriarchHelper.kt index da0ef76eb..1d74e0b96 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/MatriarchHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/MatriarchHelper.kt @@ -61,8 +61,8 @@ object MatriarchHelper { if (config.line) { val color = config.lineColor.toChromaColor() var prePoint = event.exactPlayerEyeLocation() - pearlList.forEach { - val point = it.baseEntity.getLorenzVec().add(y = 1.2) + for (mob in pearlList) { + val point = mob.baseEntity.getLorenzVec().add(y = 1.2) event.draw3DLine(prePoint, point, color, 10, true) prePoint = point } diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt index 2408ef1c9..803cedb78 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt @@ -98,17 +98,16 @@ class CrimsonIsleReputationHelper(skyHanniMod: SkyHanniMod) { } if (event.repeatSeconds(3)) { - TabListData.getTabList() - .filter { it.contains("Reputation:") } - .forEach { - factionType = if (it.contains("Mage")) { - FactionType.MAGE - } else if (it.contains("Barbarian")) { - FactionType.BARBARIAN - } else { - FactionType.NONE - } + val list = TabListData.getTabList().filter { it.contains("Reputation:") } + for (line in list) { + factionType = if (line.contains("Mage")) { + FactionType.MAGE + } else if (line.contains("Barbarian")) { + FactionType.BARBARIAN + } else { + FactionType.NONE } + } } } -- cgit