diff options
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt | 7 |
1 files changed, 5 insertions, 2 deletions
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 |