aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/api')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/api/ReforgeAPI.kt14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/api/ReforgeAPI.kt b/src/main/java/at/hannibal2/skyhanni/api/ReforgeAPI.kt
index 987a864af..534d38d47 100644
--- a/src/main/java/at/hannibal2/skyhanni/api/ReforgeAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/api/ReforgeAPI.kt
@@ -5,6 +5,7 @@ import at.hannibal2.skyhanni.data.model.SkyblockStat
import at.hannibal2.skyhanni.data.model.SkyblockStatList
import at.hannibal2.skyhanni.events.NeuRepositoryReloadEvent
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
+import at.hannibal2.skyhanni.test.command.ErrorManager
import at.hannibal2.skyhanni.utils.ItemCategory
import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName
import at.hannibal2.skyhanni.utils.ItemUtils.getItemCategoryOrNull
@@ -176,7 +177,18 @@ object ReforgeAPI {
while (reader.hasNext()) {
val name = reader.nextName()
val value = reader.nextDouble()
- list[SkyblockStat.valueOf(name.uppercase())] = value
+
+ val stat = SkyblockStat.getValueOrNull(name.uppercase()) ?: run {
+ ErrorManager.logErrorStateWithData(
+ "Unknown stat: '${name.uppercase()}'",
+ "Stat list could not parse stat",
+ "failed" to name.uppercase(),
+ betaOnly = true,
+ )
+ continue
+ }
+
+ list[stat] = value
}
reader.endObject()
return list