From dc0ea5984697dc5f81011eb584fafd717d070070 Mon Sep 17 00:00:00 2001 From: Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com> Date: Thu, 26 Oct 2023 00:35:20 +0200 Subject: Fix (but not tested) (#623) Highlight Commission Mobs: The "Golden Goblin Slayer" Commission should not trigger the "Goblin Slayer" Commission anymore. #623 --- .../skyhanni/features/mining/HighlightMiningCommissionMobs.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features/mining') diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt index 70d105a26..9b46318de 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt @@ -12,6 +12,7 @@ import at.hannibal2.skyhanni.utils.EntityUtils import at.hannibal2.skyhanni.utils.EntityUtils.hasMaxHealth import at.hannibal2.skyhanni.utils.LorenzColor import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland +import at.hannibal2.skyhanni.utils.StringUtils.removeColor import net.minecraft.entity.EntityLivingBase import net.minecraft.entity.monster.EntityEndermite import net.minecraft.entity.monster.EntityIronGolem @@ -29,7 +30,7 @@ class HighlightMiningCommissionMobs { DWARVEN_GOBLIN_SLAYER("Goblin Slayer", { it.name == "Goblin " }), STAR_PUNCHER("Star Sentry Puncher", { it.name == "Crystal Sentry" }), ICE_WALKER("Ice Walker Slayer", { it.name == "Ice Walker" }), - GOLDEN_GOBLIN("Golden Goblin Slayer", { it.name.contains("Golden Goblin") }), // TODO test + GOLDEN_GOBLIN("Golden Goblin Slayer", { it.name.contains("Golden Goblin") }), // Crystal Hollows AUTOMATON("Automaton Slayer", { it is EntityIronGolem }), @@ -63,7 +64,9 @@ class HighlightMiningCommissionMobs { if (!isEnabled()) return MobType.entries.filter { type -> - event.tabList.find { line -> line.contains(type.commissionName) }?.let { !it.endsWith("§aDONE") } ?: false + event.tabList.findLast { line -> line.removeColor().trim().startsWith(type.commissionName) } + ?.let { !it.endsWith("§aDONE") } + ?: false }.let { if (it != active) { active = it -- cgit