diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/fishing/SeaCreature.kt | 8 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/fishing/SeaCreatureManager.kt | 15 |
2 files changed, 15 insertions, 8 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/fishing/SeaCreature.kt b/src/main/java/at/hannibal2/skyhanni/fishing/SeaCreature.kt index 887d703e4..935d415f3 100644 --- a/src/main/java/at/hannibal2/skyhanni/fishing/SeaCreature.kt +++ b/src/main/java/at/hannibal2/skyhanni/fishing/SeaCreature.kt @@ -4,11 +4,15 @@ data class SeaCreature( val displayName: String, val fishingExperience: Int, val chatColor: String, - val special: Boolean, + val rare: Boolean, ) { override fun toString(): String { - return chatColor + displayName + return chatColor + rare() + displayName + } + + private fun rare(): String { + return if (rare) "§l" else "" } } diff --git a/src/main/java/at/hannibal2/skyhanni/fishing/SeaCreatureManager.kt b/src/main/java/at/hannibal2/skyhanni/fishing/SeaCreatureManager.kt index d901abe5d..d26c999bd 100644 --- a/src/main/java/at/hannibal2/skyhanni/fishing/SeaCreatureManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/fishing/SeaCreatureManager.kt @@ -16,13 +16,16 @@ class SeaCreatureManager { for (variant in data.entrySet().map { it.value.asJsonObject }) { val chatColor = variant["chat_color"].asString - for (seaCreature in variant["sea_creatures"].asJsonArray.map { it.asJsonObject }) { - val displayName = seaCreature["display_name"].asString - val chatMessage = seaCreature["chat_message"].asString - val fishingExperience = seaCreature["fishing_experience"].asInt - val special = seaCreature["special"].asBoolean + for ((displayName, v) in variant["sea_creatures"].asJsonObject.entrySet()) { + val value = v.asJsonObject + val chatMessage = value["chat_message"].asString + val fishingExperience = value["fishing_experience"].asInt - seaCreatureMap[chatMessage] = SeaCreature(displayName, fishingExperience, chatColor, special) + val rare = if (value.has("rare")) { + value["rare"].asBoolean + } else false + + seaCreatureMap[chatMessage] = SeaCreature(displayName, fishingExperience, chatColor, rare) counter++ } } |