diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-15 13:05:25 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-15 13:05:25 +0100 |
commit | 32ff726edba446405e0cc7315e7d87b6fa1cd03f (patch) | |
tree | b3d5676bd30fb8c6826332a7160e0d7ebffac39a /src/main/java | |
parent | d1df749da1a58f0f3d8712b22341b59cc652a11b (diff) | |
download | skyhanni-32ff726edba446405e0cc7315e7d87b6fa1cd03f.tar.gz skyhanni-32ff726edba446405e0cc7315e7d87b6fa1cd03f.tar.bz2 skyhanni-32ff726edba446405e0cc7315e7d87b6fa1cd03f.zip |
Added mythic visitor support.
Diffstat (limited to 'src/main/java')
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 |