diff options
| author | CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> | 2024-06-07 22:10:11 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-07 14:10:11 +0200 |
| commit | 79d0cd3af5b2acf11fc63bc3aa6743f784a3a0f6 (patch) | |
| tree | 9a8507e4d7fe308dd4a228149f5a864301cfcce9 /src/main/java/at/hannibal2/skyhanni/features/fishing | |
| parent | cfb12e7e3bbaf820f9402c286cba6bb0a33671fa (diff) | |
| download | skyhanni-79d0cd3af5b2acf11fc63bc3aa6743f784a3a0f6.tar.gz skyhanni-79d0cd3af5b2acf11fc63bc3aa6743f784a3a0f6.tar.bz2 skyhanni-79d0cd3af5b2acf11fc63bc3aa6743f784a3a0f6.zip | |
Backend: Change Java to Kotlin for repo files (#1543)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/fishing')
3 files changed, 10 insertions, 19 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingAPI.kt index aaf7db8a7..89beae6aa 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingAPI.kt @@ -120,8 +120,8 @@ object FishingAPI { @SubscribeEvent fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant<ItemsJson>("Items") - lavaRods = data.lava_fishing_rods - waterRods = data.water_fishing_rods + lavaRods = data.lavaFishingRods + waterRods = data.waterFishingRods } private fun getAllowedBlocks() = if (holdingLavaRod) lavaBlocks else waterBlocks diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureManager.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureManager.kt index 59d9d818b..5f7499574 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureManager.kt @@ -35,20 +35,20 @@ class SeaCreatureManager { allFishingMobs = emptyMap() var counter = 0 - val data = event.getConstant<Map<String, SeaCreatureJson.Variant>>("SeaCreatures", SeaCreatureJson.TYPE) + val data = event.getConstant<Map<String, SeaCreatureJson>>("SeaCreatures", SeaCreatureJson.TYPE) val allFishingMobs = mutableMapOf<String, SeaCreature>() val variants = mutableMapOf<String, List<String>>() for ((variantName, variant) in data) { - val chatColor = variant.chat_color + val chatColor = variant.chatColor val variantFishes = mutableListOf<String>() variants[variantName] = variantFishes - for ((name, seaCreature) in variant.sea_creatures) { - val chatMessage = seaCreature.chat_message - val fishingExperience = seaCreature.fishing_experience + for ((name, seaCreature) in variant.seaCreatures) { + val chatMessage = seaCreature.chatMessage + val fishingExperience = seaCreature.fishingExperience val rarity = seaCreature.rarity - val rare = seaCreature.rare ?: false + val rare = seaCreature.rare val creature = SeaCreature(name, fishingExperience, chatColor, rare, rarity) seaCreatureMap[chatMessage] = creature diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishManager.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishManager.kt index 2b3a59032..44893f949 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishManager.kt @@ -2,8 +2,8 @@ package at.hannibal2.skyhanni.features.fishing.trophy import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.data.ProfileStorageData +import at.hannibal2.skyhanni.data.jsonobjects.repo.TrophyFishInfo import at.hannibal2.skyhanni.data.jsonobjects.repo.TrophyFishJson -import at.hannibal2.skyhanni.data.jsonobjects.repo.TrophyFishJson.TrophyFishInfo import at.hannibal2.skyhanni.events.NeuProfileDataLoadedEvent import at.hannibal2.skyhanni.events.RepositoryReloadEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule @@ -21,7 +21,7 @@ object TrophyFishManager { @SubscribeEvent fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant<TrophyFishJson>("TrophyFish") - trophyFishInfo = data.trophy_fish + trophyFishInfo = data.trophyFish } val fish: MutableMap<String, MutableMap<TrophyRarity, Int>>? @@ -87,15 +87,6 @@ object TrophyFishManager { fun getInfoByName(name: String) = trophyFishInfo.values.find { it.displayName == name } fun TrophyFishInfo.getFilletValue(rarity: TrophyRarity): Int { - if (fillet == null) { - ErrorManager.logErrorStateWithData( - "Error trying to read trophy fish info", - "fillet in TrophyFishInfo is null", - "displayName" to displayName, - "TrophyFishInfo" to this, - ) - return -1 - } return fillet.getOrDefault(rarity, -1) } |
