From ce4bc30ea2fb0bd82764f4624608f086ca16bfac Mon Sep 17 00:00:00 2001 From: Luna Date: Thu, 20 Jun 2024 13:45:35 +0200 Subject: [PATCH] Backend: Remove redundant property from HotmAPI.Powder --- src/main/java/at/hannibal2/skyhanni/api/HotmAPI.kt | 6 ++---- src/main/java/at/hannibal2/skyhanni/data/HotmData.kt | 6 +++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/api/HotmAPI.kt b/src/main/java/at/hannibal2/skyhanni/api/HotmAPI.kt index 38c901c85d8b..39305a012af1 100644 --- a/src/main/java/at/hannibal2/skyhanni/api/HotmAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/api/HotmAPI.kt @@ -37,15 +37,13 @@ object HotmAPI { ; - val lowName = name.lowercase().firstLetterUppercase() - val heartPattern by RepoPattern.pattern( "inventory.${name.lowercase()}.heart", - "§7$lowName Powder: §a§.(?[\\d,]+)" + "§7$displayName Powder: §a§.(?[\\d,]+)" ) val resetPattern by RepoPattern.pattern( "inventory.${name.lowercase()}.reset", - "\\s+§8- §.(?[\\d,]+) $lowName Powder" + "\\s+§8- §.(?[\\d,]+) $displayName Powder" ) fun pattern(isHeart: Boolean) = if (isHeart) heartPattern else resetPattern diff --git a/src/main/java/at/hannibal2/skyhanni/data/HotmData.kt b/src/main/java/at/hannibal2/skyhanni/data/HotmData.kt index 3f2d54b31881..d1f8c3fb6755 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/HotmData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/HotmData.kt @@ -648,13 +648,13 @@ enum class HotmData( if (!LorenzUtils.inSkyBlock) return event.scoreboard.matchFirst(ScoreboardPattern.powderPattern) { - val type = HotmAPI.Powder.entries.firstOrNull { it.lowName == group("type") } ?: return + val type = HotmAPI.Powder.entries.firstOrNull { it.displayName == group("type") } ?: return val amount = group("amount").formatLong() val difference = amount - type.getCurrent() if (difference > 0) { type.gain(difference) - ChatUtils.debug("Gained §a${difference.addSeparators()} §e${type.lowName} Powder") + ChatUtils.debug("Gained §a${difference.addSeparators()} §e${type.displayName} Powder") } } } @@ -742,7 +742,7 @@ enum class HotmData( event.addIrrelevant { add("Tokens : $availableTokens/$tokens") HotmAPI.Powder.entries.forEach { - add("${it.lowName} Powder: ${it.getCurrent()}/${it.getTotal()}") + add("${it.displayName} Powder: ${it.getCurrent()}/${it.getTotal()}") } add("Ability: ${HotmAPI.activeMiningAbility?.printName}") add("Blue Egg: ${HotmAPI.isBlueEggActive}")