aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/api
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-05-11 12:43:44 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-05-11 12:43:44 +0200
commitc3caf0b538747d46d02f38a2d2182c821ef1b0f0 (patch)
tree0937fa184e3cbd7f03f41a9b037446db61673e6e /src/main/java/at/hannibal2/skyhanni/api
parenteaa9df9d3242d3df86000d302f38bc73fa941db4 (diff)
downloadskyhanni-c3caf0b538747d46d02f38a2d2182c821ef1b0f0.tar.gz
skyhanni-c3caf0b538747d46d02f38a2d2182c821ef1b0f0.tar.bz2
skyhanni-c3caf0b538747d46d02f38a2d2182c821ef1b0f0.zip
Added support for lower case names and common typos in /shtrackcollection
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/api')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt25
1 files changed, 5 insertions, 20 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt b/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt
index 08010207a..80ff8659f 100644
--- a/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt
@@ -17,17 +17,6 @@ class CollectionAPI {
private val counterPattern = "(?:.*) §e(?<amount>.*)§6\\/(?:.*)".toPattern()
private val singleCounterPattern = "§7Total Collected: §e(?<amount>.*)".toPattern()
-// private val hypixelApiHasWrongItems = listOf(
-// "WOOL",
-// "CORRUPTED_FRAGMENT",
-// "EGG",
-// "POISONOUS_POTATO",
-// "REDSTONE_BLOCK",
-// "MUSHROOM_COLLECTION",
-// "RAW_SOULFLOW",
-// "GEMSTONE_COLLECTION",
-// )
-
@SubscribeEvent
fun onProfileDataLoad(event: ProfileApiDataLoadedEvent) {
val profileData = event.profileData
@@ -36,14 +25,10 @@ class CollectionAPI {
for ((hypixelId, rawCounter) in asJsonObject.entrySet()) {
val counter = rawCounter.asLong
val neuItemId = NEUItems.transHypixelNameToInternalName(hypixelId)
- val itemName = BazaarApi.getBazaarDataByInternalName(neuItemId)?.displayName
- // Hypixel moment
-// if (hypixelApiHasWrongItems.contains(neuItemId)) continue
- if (itemName == null) {
-// LorenzUtils.debug("collection name is null for '$neuItemId'")
- continue
- }
+ // MUSHROOM_COLLECTION, GEMSTONE_COLLECTION
+ BazaarApi.getBazaarDataByInternalName(neuItemId)?.displayName ?: continue
+
collectionValue[neuItemId] = counter
}
@@ -101,10 +86,10 @@ class CollectionAPI {
fun isCollectionTier0(lore: List<String>) = lore.map { collectionTier0Pattern.matcher(it) }.any { it.matches() }
- fun getCollectionCounter(searchName: String): Pair<String, Long>? {
+ fun getCollectionCounter(searchName: String): Long? {
for ((collectionName, counter) in collectionValue) {
if (collectionName.equals(searchName, true)) {
- return Pair(collectionName, counter)
+ return counter
}
}
return null