diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-04-20 01:20:24 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-04-20 01:20:24 +0200 |
commit | 317fcbd610df900401b534db06b899d837413725 (patch) | |
tree | eebc08fddea43f6418d1c86809709a2db36ae8c6 /src/main/java/at/hannibal2/skyhanni/features/garden | |
parent | 1e52428d3939d0b579cbc156b4e30fb4e8cdc342 (diff) | |
download | skyhanni-317fcbd610df900401b534db06b899d837413725.tar.gz skyhanni-317fcbd610df900401b534db06b899d837413725.tar.bz2 skyhanni-317fcbd610df900401b534db06b899d837413725.zip |
Added support for hoe counter and cultivating ove 1b
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/garden')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt | 2 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt index d6ffa41ab..46f7c1fe1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt @@ -109,7 +109,7 @@ object GardenAPI { return CropType.values().firstOrNull { internalName.startsWith(it.toolName) } } - fun readCounter(itemStack: ItemStack): Int = itemStack.getHoeCounter() ?: itemStack.getCultivatingCounter() ?: -1 + fun readCounter(itemStack: ItemStack): Long = itemStack.getHoeCounter() ?: itemStack.getCultivatingCounter() ?: -1L fun CropType.getSpeed(): Int { val speed = cropsPerSecond[this] 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 7b644578a..fbefe574a 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 @@ -29,7 +29,7 @@ import kotlin.concurrent.fixedRateTimer class GardenCropMilestoneDisplay { private var progressDisplay = listOf<List<Any>>() private var mushroomCowPerkDisplay = listOf<List<Any>>() - private val cultivatingData = mutableMapOf<CropType, Int>() + private val cultivatingData = mutableMapOf<CropType, Long>() private val config get() = SkyHanniMod.feature.garden private val bestCropTime = GardenBestCropTime() // val cropMilestoneLevelUpPattern = Pattern.compile(" §r§b§lGARDEN MILESTONE §3(.*) §8XXIII➜§3(.*)") @@ -117,11 +117,11 @@ class GardenCropMilestoneDisplay { try { val item = event.itemStack val counter = GardenAPI.readCounter(item) - if (counter == -1) return + if (counter == -1L) return val crop = item.getCropType() ?: return if (cultivatingData.containsKey(crop)) { val old = cultivatingData[crop]!! - val addedCounter = counter - old + val addedCounter = (counter - old).toInt() if (GardenCropMilestones.cropCounter.isEmpty()) { for (innerCrop in CropType.values()) { @@ -283,7 +283,7 @@ class GardenCropMilestoneDisplay { lineMap[2] = Collections.singletonList("§e$haveFormat§8/§e$needFormat") lastItemInHand?.let { - if (GardenAPI.readCounter(it) == -1) { + if (GardenAPI.readCounter(it) == -1L) { lineMap[3] = Collections.singletonList("§cWarning: You need Cultivating!") return formatDisplay(lineMap) } |