diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-01-20 20:30:11 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-01-20 20:30:11 +0100 |
commit | 9d411375b4b493d797174512297ab57c6df54769 (patch) | |
tree | 718066cc1d895d92a240e35db8ec61e08fe31bfc /src/main/java | |
parent | a569135dd6d518d0a9dc522189f04544811c2ee7 (diff) | |
download | skyhanni-9d411375b4b493d797174512297ab57c6df54769.tar.gz skyhanni-9d411375b4b493d797174512297ab57c6df54769.tar.bz2 skyhanni-9d411375b4b493d797174512297ab57c6df54769.zip |
Support for new repo format for reputationHelper.
Diffstat (limited to 'src/main/java')
3 files changed, 6 insertions, 11 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailykuudra/DailyKuudraBossHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailykuudra/DailyKuudraBossHelper.kt index 3fb4c38fb..d9e6b2499 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailykuudra/DailyKuudraBossHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailykuudra/DailyKuudraBossHelper.kt @@ -17,10 +17,8 @@ class DailyKuudraBossHelper(private val reputationHelper: CrimsonIsleReputationH fun init() { val repoData = reputationHelper.repoData val jsonElement = repoData["KUUDRA"] - val asJsonArray = jsonElement.asJsonArray var tier = 1 - for (entry in asJsonArray) { - val displayName = entry.asString + for ((displayName, value) in jsonElement.asJsonObject.entrySet()) { kuudraTiers.add(KuudraTier(displayName, tier)) tier++ } diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/QuestLoader.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/QuestLoader.kt index 055823fa7..dee5071c8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/QuestLoader.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/QuestLoader.kt @@ -80,10 +80,9 @@ class QuestLoader(val dailyQuestHelper: DailyQuestHelper) { } for (entry in dailyQuestHelper.reputationHelper.repoData.entrySet()) { - val category = entry.key - for (element in entry.value.asJsonArray) { - val entryName = element.asString - + val categoryName = entry.key + val category = entry.value.asJsonObject + for ((entryName, value) in category.entrySet()) { if (name.startsWith("$entryName Rank ")) { val split = name.split(" Rank ") val dojoName = split[0] @@ -92,7 +91,7 @@ class QuestLoader(val dailyQuestHelper: DailyQuestHelper) { } if (name == entryName) { - when (category) { + when (categoryName) { "FISHING" -> return TrophyFishQuest(name, state, needAmount) "RESCUE" -> return RescueMissionQuest(state) "FETCH" -> return FetchQuest(name, state, needAmount) diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt index 051a428df..6933e01c6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt @@ -16,9 +16,7 @@ class DailyMiniBossHelper(private val reputationHelper: CrimsonIsleReputationHel fun init() { val repoData = reputationHelper.repoData val jsonElement = repoData["MINIBOSS"] - val asJsonArray = jsonElement.asJsonArray - for (entry in asJsonArray) { - val displayName = entry.asString + for ((displayName, value) in jsonElement.asJsonObject.entrySet()) { val patterns = " *§r§6§l${displayName.uppercase()} DOWN!" miniBosses.add(CrimsonMiniBoss(displayName, Pattern.compile(patterns))) } |