diff options
Diffstat (limited to 'src/main')
3 files changed, 9 insertions, 13 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt b/src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt index fd185996e..508f18dea 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt @@ -93,7 +93,7 @@ class ConfigManager { } override fun read(reader: JsonReader): LorenzRarity { - return LorenzRarity.valueOf(reader.nextString()) + return LorenzRarity.valueOf(reader.nextString().uppercase()) } }.nullSafe()) .registerTypeAdapter(IslandType::class.java, object : TypeAdapter<IslandType>() { @@ -102,7 +102,7 @@ class ConfigManager { } override fun read(reader: JsonReader): IslandType { - return IslandType.valueOf(reader.nextString()) + return IslandType.valueOf(reader.nextString().uppercase()) } }.nullSafe()) .enableComplexMapKeySerialization() diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorColorNames.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorColorNames.kt index 8096b747c..9fa465a47 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorColorNames.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorColorNames.kt @@ -16,7 +16,8 @@ object GardenVisitorColorNames { visitorColours.clear() visitorItems.clear() for ((visitor, visitorData) in data.visitors) { - visitorColours[visitor] = getColor(visitorData.rarity) + val rarity = visitorData.new_rarity ?: visitorData.rarity + visitorColours[visitor] = rarity.color.getChatColor() visitorItems[visitor] = visitorData.need_items } } @@ -28,13 +29,4 @@ object GardenVisitorColorNames { val color = visitorColours[cleanName] ?: return name return color + cleanName } - - private fun getColor(rarity: String) = when (rarity) { - "uncommon" -> "§a" - "rare" -> "§9" - "legendary" -> "§6" - "special" -> "§c" - - else -> throw RuntimeException("Unknown rarity for '$rarity'") - } } diff --git a/src/main/java/at/hannibal2/skyhanni/utils/jsonobjects/GardenJson.java b/src/main/java/at/hannibal2/skyhanni/utils/jsonobjects/GardenJson.java index 265e5b11e..cc8bcd51d 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/jsonobjects/GardenJson.java +++ b/src/main/java/at/hannibal2/skyhanni/utils/jsonobjects/GardenJson.java @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.utils.jsonobjects; import at.hannibal2.skyhanni.features.garden.CropType; +import at.hannibal2.skyhanni.utils.LorenzRarity; import at.hannibal2.skyhanni.utils.LorenzVec; import com.google.gson.annotations.Expose; import org.jetbrains.annotations.Nullable; @@ -26,7 +27,10 @@ public class GardenJson { public static class GardenVisitor { @Expose - public String rarity; + public LorenzRarity rarity; + + @Expose + public LorenzRarity new_rarity; @Nullable @Expose |