diff options
| author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-04-15 19:14:58 +0200 |
|---|---|---|
| committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-04-15 19:14:58 +0200 |
| commit | ec08babcd63289587a269dd45f5ba8488d2921e7 (patch) | |
| tree | 3a44b9ab030554ecff37e05d6c64b81326bc5a7d /src/main/java/at/hannibal2/skyhanni/api | |
| parent | d9b4dbfb8a3cdc6f869d740af9b0e38b44ecea2d (diff) | |
| download | skyhanni-ec08babcd63289587a269dd45f5ba8488d2921e7.tar.gz skyhanni-ec08babcd63289587a269dd45f5ba8488d2921e7.tar.bz2 skyhanni-ec08babcd63289587a269dd45f5ba8488d2921e7.zip | |
code cleanup
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/api')
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt b/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt index 3c6caf271..ea4584119 100644 --- a/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt @@ -30,27 +30,18 @@ class CollectionAPI { val profileData = event.profileData val jsonElement = profileData["collection"] ?: return val asJsonObject = jsonElement.asJsonObject ?: return - for ((rawName, rawCounter) in asJsonObject.entrySet()) { + for ((hypixelId, rawCounter) in asJsonObject.entrySet()) { val counter = rawCounter.asLong - var itemName = BazaarApi.getBazaarDataByInternalName(rawName)?.displayName - if (rawName == "MUSHROOM_COLLECTION") { - itemName = "Mushroom" - } - if (rawName == "MELON") { - itemName = "Melon" - } - if (rawName == "GEMSTONE_COLLECTION") { - itemName = "Gemstone" - } - + val neuItemId = NEUItems.transHypixelNameToInternalName(hypixelId) + val itemName = BazaarApi.getBazaarDataByInternalName(neuItemId)?.displayName // Hypixel moment - if (hypixelApiHasWrongItems.contains(rawName)) continue + if (hypixelApiHasWrongItems.contains(neuItemId)) continue if (itemName == null) { - LorenzUtils.debug("collection name is null for '$rawName'") + LorenzUtils.debug("collection name is null for '$neuItemId'") continue } - collectionValue[itemName] = counter + collectionValue[neuItemId] = counter } CollectionUpdateEvent().postAndCatch() |
