diff options
author | Lorenz <ESs95s3P5z8Pheb> | 2022-07-23 12:11:46 +0200 |
---|---|---|
committer | Lorenz <ESs95s3P5z8Pheb> | 2022-07-23 12:11:46 +0200 |
commit | bc34ae9dd4174bd07505cff44866f9545a981769 (patch) | |
tree | 1274a34ce58881c03a5dd8e7db7849fdaf75e1f2 /src/main | |
parent | 977991e8cfe61b843c922e380be72a0c72e886b5 (diff) | |
download | skyhanni-bc34ae9dd4174bd07505cff44866f9545a981769.tar.gz skyhanni-bc34ae9dd4174bd07505cff44866f9545a981769.tar.bz2 skyhanni-bc34ae9dd4174bd07505cff44866f9545a981769.zip |
changed sea creature format
Diffstat (limited to 'src/main')
-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++ } } |