From e032933b55acf5ea894bd20e881bf1fd4cd1b6d7 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Thu, 23 Mar 2023 19:52:34 +0100 Subject: Added setCounter() + Added support for mushroom cow pet perk (Counting and updating mushroom collection when breaking crops with mushroom blocks, added extra gui for time till crop milestones) + Added blocks/second display to crop milestone gui and made all crop milestone gui elements customizeable/toggleable --- src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestones.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/data') diff --git a/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestones.kt b/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestones.kt index 984c60df7..0e2ed1fef 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestones.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestones.kt @@ -33,7 +33,7 @@ class GardenCropMilestones { fun onProfileJoin(event: ProfileJoinEvent) { if (cropCounter.isEmpty()) { for (crop in CropType.values()) { - cropCounter[crop] = 0 + crop.setCounter(0) } } } @@ -65,7 +65,7 @@ class GardenCropMilestones { if (matcher.matches()) { val rawNumber = matcher.group(1) val overflow = rawNumber.formatNumber() - cropCounter[crop] = cropForTier + overflow + crop.setCounter(cropForTier + overflow) } next = false } @@ -80,6 +80,8 @@ class GardenCropMilestones { fun CropType.getCounter() = cropCounter[this]!! + fun CropType.setCounter(counter: Long) { cropCounter[this] = counter } + fun getTierForCrops(crops: Long): Int { var tier = 0 var totalCrops = 0L -- cgit