From 1562885f615afa40555f210c4c9ede5c13de10fb Mon Sep 17 00:00:00 2001 From: HiZe_ Date: Thu, 7 Sep 2023 13:52:41 +0200 Subject: Fix: Ghostcounter Bestiary detection (#438) Co-authored-by: superhize --- .../at/hannibal2/skyhanni/features/misc/ghostcounter/GhostCounter.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main') diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/ghostcounter/GhostCounter.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/ghostcounter/GhostCounter.kt index e8e539553..19482141d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/ghostcounter/GhostCounter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/ghostcounter/GhostCounter.kt @@ -41,7 +41,6 @@ import at.hannibal2.skyhanni.utils.StringUtils.removeColor import at.hannibal2.skyhanni.utils.renderables.Renderable import io.github.moulberry.notenoughupdates.util.Utils import io.github.moulberry.notenoughupdates.util.XPInformation -import net.minecraft.client.Minecraft import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.io.File import java.text.NumberFormat @@ -452,7 +451,8 @@ object GhostCounter { val stacks = event.inventoryItems val ghostStack = stacks[10] ?: return val bestiaryNextLevel = - if (ghostStack.displayName == "§cGhost") 1 else ghostStack.displayName.substring(8).romanToDecimal() + 1 + if ("§\\wGhost".toRegex().matches(ghostStack.displayName)) 1 else ghostStack.displayName.substring(8) + .romanToDecimal() + 1 hidden?.bestiaryNextLevel = bestiaryNextLevel.toDouble() var kills = 0.0 for (line in ghostStack.getLore()) { -- cgit