From f9e0fbd23a8243b931a43f48818e8d76f8e0cbd7 Mon Sep 17 00:00:00 2001 From: Luna Date: Mon, 15 Jul 2024 20:16:36 +0200 Subject: Backend: Remove redundant property from HotmAPI.Powder (#2128) --- 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(-) (limited to 'src/main/java/at/hannibal2/skyhanni') diff --git a/src/main/java/at/hannibal2/skyhanni/api/HotmAPI.kt b/src/main/java/at/hannibal2/skyhanni/api/HotmAPI.kt index 38c901c85..39305a012 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 f3a2189b0..2d8ea9457 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/HotmData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/HotmData.kt @@ -651,13 +651,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") } } } @@ -745,7 +745,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}") -- cgit