aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-19 02:03:24 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-19 02:03:24 +0100
commit85d0e7f20a9f0785a57d9c0b01fbd6698f617fd2 (patch)
tree68b62d5f690066d7cb13b5e3e5c0ab2f57b1b9a5 /src/main/java/at/hannibal2
parent6b3d347b7ca373f5840edfa98f2dddc339fa20a5 (diff)
downloadskyhanni-85d0e7f20a9f0785a57d9c0b01fbd6698f617fd2.tar.gz
skyhanni-85d0e7f20a9f0785a57d9c0b01fbd6698f617fd2.tar.bz2
skyhanni-85d0e7f20a9f0785a57d9c0b01fbd6698f617fd2.zip
code cleanup
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt78
1 files changed, 39 insertions, 39 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt
index 860213e9e..0887b05bf 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt
@@ -72,45 +72,45 @@ object GardenVisitorDropStatistics {
fun onChat(event: LorenzChatEvent) {
if (!GardenAPI.onBarnPlot) return
if (!ProfileStorageData.loaded) return
- if (lastAccept - System.currentTimeMillis() <= 0 && lastAccept - System.currentTimeMillis() > -1000) {
- val message = event.message.removeColor().trim()
- val storage = GardenAPI.storage?.visitorDrops ?: return
-
- copperPattern.matchMatcher(message) {
- val amount = group("amount").formatNumber().toInt()
- storage.copper += amount
- saveAndUpdate()
- }
- farmingExpPattern.matchMatcher(message) {
- val amount = group("amount").formatNumber()
- storage.farmingExp += amount
- saveAndUpdate()
- }
- gardenExpPattern.matchMatcher(message) {
- val amount = group("amount").formatNumber().toInt()
- if (amount > 80) return // some of the low visitor milestones will get through but will be minimal
- storage.gardenExp += amount
- saveAndUpdate()
- }
- bitsPattern.matchMatcher(message) {
- val amount = group("amount").formatNumber().toInt()
- storage.bits += amount
- saveAndUpdate()
- }
- mithrilPowderPattern.matchMatcher(message) {
- val amount = group("amount").formatNumber().toInt()
- storage.mithrilPowder += amount
- saveAndUpdate()
- }
- gemstonePowderPattern.matchMatcher(message) {
- val amount = group("amount").formatNumber().toInt()
- storage.gemstonePowder += amount
- saveAndUpdate()
- }
- acceptPattern.matchMatcher(message) {
- setRarities(group("rarity"))
- saveAndUpdate()
- }
+ if (lastAccept - System.currentTimeMillis() > 0 || lastAccept - System.currentTimeMillis() <= -1000) return
+
+ val message = event.message.removeColor().trim()
+ val storage = GardenAPI.storage?.visitorDrops ?: return
+
+ copperPattern.matchMatcher(message) {
+ val amount = group("amount").formatNumber().toInt()
+ storage.copper += amount
+ saveAndUpdate()
+ }
+ farmingExpPattern.matchMatcher(message) {
+ val amount = group("amount").formatNumber()
+ storage.farmingExp += amount
+ saveAndUpdate()
+ }
+ gardenExpPattern.matchMatcher(message) {
+ val amount = group("amount").formatNumber().toInt()
+ if (amount > 80) return // some of the low visitor milestones will get through but will be minimal
+ storage.gardenExp += amount
+ saveAndUpdate()
+ }
+ bitsPattern.matchMatcher(message) {
+ val amount = group("amount").formatNumber().toInt()
+ storage.bits += amount
+ saveAndUpdate()
+ }
+ mithrilPowderPattern.matchMatcher(message) {
+ val amount = group("amount").formatNumber().toInt()
+ storage.mithrilPowder += amount
+ saveAndUpdate()
+ }
+ gemstonePowderPattern.matchMatcher(message) {
+ val amount = group("amount").formatNumber().toInt()
+ storage.gemstonePowder += amount
+ saveAndUpdate()
+ }
+ acceptPattern.matchMatcher(message) {
+ setRarities(group("rarity"))
+ saveAndUpdate()
}
}