From 3c19a45821bfe192c9d79b275f4ef514e91c4fdb Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Thu, 30 Nov 2023 13:02:02 +0100 Subject: Fixed Mooshroom cow Perk display not showing when maxed. --- .../at/hannibal2/skyhanni/features/garden/CropType.kt | 3 +-- .../garden/farming/GardenCropMilestoneDisplay.kt | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) (limited to 'src/main') diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/CropType.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/CropType.kt index 423bdaed1..41ef944ea 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/CropType.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/CropType.kt @@ -59,8 +59,7 @@ enum class CropType( Blocks.melon_block -> MELON Blocks.cactus -> CACTUS Blocks.cocoa -> COCOA_BEANS - Blocks.red_mushroom -> MUSHROOM - Blocks.brown_mushroom -> MUSHROOM + Blocks.red_mushroom, Blocks.brown_mushroom -> MUSHROOM Blocks.nether_wart -> NETHER_WART else -> null } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt index 6c3bedbf8..adfe0518d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt @@ -243,14 +243,23 @@ object GardenCropMilestoneDisplay { } private fun addMushroomCowData() { + val mushroom = CropType.MUSHROOM + if (mushroom.isMaxed()) { + mushroomCowPerkDisplay = listOf( + listOf("§6Mooshroom Cow Perk"), + listOf("§eMushroom crop is maxed!"), + ) + return + } + val lineMap = HashMap>() - val counter = CropType.MUSHROOM.getCounter() + val counter = mushroom.getCounter() - val currentTier = GardenCropMilestones.getTierForCropCount(counter, CropType.MUSHROOM) + val currentTier = GardenCropMilestones.getTierForCropCount(counter, mushroom) val nextTier = currentTier + 1 - val cropsForCurrentTier = GardenCropMilestones.getCropsForTier(currentTier, CropType.MUSHROOM) - val cropsForNextTier = GardenCropMilestones.getCropsForTier(nextTier, CropType.MUSHROOM) + val cropsForCurrentTier = GardenCropMilestones.getCropsForTier(currentTier, mushroom) + val cropsForNextTier = GardenCropMilestones.getCropsForTier(nextTier, mushroom) val have = counter - cropsForCurrentTier val need = cropsForNextTier - cropsForCurrentTier @@ -263,7 +272,7 @@ object GardenCropMilestoneDisplay { lineMap[0] = Collections.singletonList("§6Mooshroom Cow Perk") val list = mutableListOf() - list.addCropIcon(CropType.MUSHROOM) + list.addCropIcon(mushroom) list.add("§7Mushroom Tier $nextTier") lineMap[1] = list -- cgit