From 1f950c47b505a47ca49be67b7f0d85c2c65ae1da Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 20 Jan 2024 10:02:14 +0100 Subject: code cleanup --- .../skyhanni/features/garden/FarmingMilestoneCommand.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') 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) -- cgit