diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-01-20 10:02:14 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-01-20 10:02:14 +0100 |
commit | 1f950c47b505a47ca49be67b7f0d85c2c65ae1da (patch) | |
tree | d6cf9a989223345136ab5a5234826eee0e81b0a0 /src | |
parent | cae50abbda2f5e2e53e81231b9f3a01215b0871e (diff) | |
download | skyhanni-1f950c47b505a47ca49be67b7f0d85c2c65ae1da.tar.gz skyhanni-1f950c47b505a47ca49be67b7f0d85c2c65ae1da.tar.bz2 skyhanni-1f950c47b505a47ca49be67b7f0d85c2c65ae1da.zip |
code cleanup
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/FarmingMilestoneCommand.kt | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingMilestoneCommand.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingMilestoneCommand.kt index cdfae78e8..7f7832ff1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingMilestoneCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingMilestoneCommand.kt @@ -27,14 +27,16 @@ object FarmingMilestoneCommand { if (currentMilestone == null) { val currentProgress = enteredCrop.getCounter() val currentCropMilestone = GardenCropMilestones.getTierForCropCount(currentProgress, enteredCrop) + 1 - val output = (GardenCropMilestones.getCropsForTier(currentCropMilestone, enteredCrop) - currentProgress).formatOutput(needsTime, enteredCrop) + val cropsForTier = GardenCropMilestones.getCropsForTier(currentCropMilestone, enteredCrop) + val output = (cropsForTier - currentProgress).formatOutput(needsTime, enteredCrop) LorenzUtils.chat("§7$output needed to reach the next milestone") return } if (targetMilestone == null) { - val output = GardenCropMilestones.getCropsForTier(currentMilestone, enteredCrop).formatOutput(needsTime, enteredCrop) + val cropsForTier = GardenCropMilestones.getCropsForTier(currentMilestone, enteredCrop) + val output = cropsForTier.formatOutput(needsTime, enteredCrop) LorenzUtils.chat("§7$output needed for milestone §7$currentMilestone") return @@ -57,8 +59,7 @@ object FarmingMilestoneCommand { strings, CropType.entries.map { it.simpleName } ) - } - else listOf() + } else listOf() } private fun getValidNumber(entry: String?) = entry?.toIntOrNull()?.coerceIn(0, 46) |