aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-10-30 22:02:36 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-10-30 22:02:36 +0100
commit20e5dc5bc8a82bb9d65129ae4c524ff3e26846d9 (patch)
tree303d14ba9dc5bf4058490db737a0865c9fc3a675 /src/main/java/at/hannibal2/skyhanni/features
parente481532319983aba82075007fa512b04c0841f19 (diff)
downloadskyhanni-20e5dc5bc8a82bb9d65129ae4c524ff3e26846d9.tar.gz
skyhanni-20e5dc5bc8a82bb9d65129ae4c524ff3e26846d9.tar.bz2
skyhanni-20e5dc5bc8a82bb9d65129ae4c524ff3e26846d9.zip
code cleanup
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt
index 97926b7e7..3a4844f2d 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt
@@ -20,10 +20,12 @@ import at.hannibal2.skyhanni.utils.StringUtils.removeColor
import at.hannibal2.skyhanni.utils.TabListData
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import kotlin.math.round
+import kotlin.time.Duration.Companion.days
class CaptureFarmingGear {
private val farmingItems get() = GardenAPI.config?.fortune?.farmingItems
private val outdatedItems get() = GardenAPI.config?.fortune?.outdatedItems
+
// TODO USE SH-REPO
private val farmingLevelUpPattern = "SKILL LEVEL UP Farming .*➜(?<level>.*)".toPattern()
private val fortuneUpgradePattern = "You claimed the Garden Farming Fortune (?<level>.*) upgrade!".toPattern()
@@ -37,8 +39,10 @@ class CaptureFarmingGear {
companion object {
private val strengthPattern = " Strength: §r§c❁(?<strength>.*)".toPattern()
- private val farmingSets = arrayListOf("FERMENTO", "SQUASH", "CROPIE", "MELON", "FARM",
- "RANCHERS", "FARMER", "RABBIT")
+ private val farmingSets = arrayListOf(
+ "FERMENTO", "SQUASH", "CROPIE", "MELON", "FARM",
+ "RANCHERS", "FARMER", "RABBIT"
+ )
private val farmingItems get() = GardenAPI.config?.fortune?.farmingItems
fun captureFarmingGear() {
@@ -106,7 +110,8 @@ class CaptureFarmingGear {
FarmingFortuneDisplay.loadFortuneLineData(slot, 0.0)
val enchantments = slot.getEnchantments() ?: emptyMap()
val greenThumbLvl = (enchantments["green_thumb"] ?: continue)
- GardenAPI.config?.uniqueVisitors = round(FarmingFortuneDisplay.greenThumbFortune / (greenThumbLvl * 0.05)).toInt()
+ val visitors = FarmingFortuneDisplay.greenThumbFortune / (greenThumbLvl * 0.05)
+ GardenAPI.config?.uniqueVisitors = round(visitors).toInt()
}
}
}
@@ -149,9 +154,9 @@ class CaptureFarmingGear {
highestRabbitRarity = split.last().toInt()
}
if (split.first() == "BEE" && split.last().toInt() > highestBeeRarity) {
- farmingItems[FarmingItems.BEE] = item
- outdatedItems[FarmingItems.BEE] = false
- highestBeeRarity = split.last().toInt()
+ farmingItems[FarmingItems.BEE] = item
+ outdatedItems[FarmingItems.BEE] = false
+ highestBeeRarity = split.last().toInt()
}
}
}
@@ -237,7 +242,7 @@ class CaptureFarmingGear {
}
}
cakePattern.matchMatcher(msg) {
- hidden.cakeExpiring = System.currentTimeMillis() + 172800000
+ hidden.cakeExpiring = System.currentTimeMillis() + 2.days.inWholeMilliseconds
}
if (msg == "CARROTS EXPORTATION COMPLETE!") {
hidden.carrotFortune = true