diff options
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/GardenJson.kt | 9 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorColorNames.kt | 3 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/GardenJson.kt b/src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/GardenJson.kt index a6c7b84a2..8f442681e 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/GardenJson.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/GardenJson.kt @@ -17,10 +17,13 @@ data class GardenJson( ) data class GardenVisitor( - @Expose val rarity: LorenzRarity, - @Expose @SerializedName("new_rarity") val newRarity: LorenzRarity?, + @Expose @SerializedName("rarity") private val _rarity: LorenzRarity, + @Expose @SerializedName("new_rarity") private val _newRarity: LorenzRarity?, @Expose val position: LorenzVec?, @Expose var skinOrType: String?, @Expose val mode: String, @Expose @SerializedName("need_items") val needItems: List<String>, -) +) { + val rarity: LorenzRarity + get() = _newRarity ?: _rarity +} 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 5fa0debe5..fa847703f 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 @@ -18,8 +18,7 @@ object GardenVisitorColorNames { visitorColours.clear() visitorItems.clear() for ((visitor, visitorData) in data.visitors) { - val rarity = visitorData.newRarity ?: visitorData.rarity - visitorColours[visitor] = rarity.color.getChatColor() + visitorColours[visitor] = visitorData.rarity.color.getChatColor() visitorItems[visitor] = visitorData.needItems } } |