diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-04-04 20:18:41 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-04-04 20:18:41 +0200 |
commit | d48cf0126f9c163dd85c860004f658167912c85c (patch) | |
tree | e7569b56a29cb7ba31873eb54abea2b1c0e9e1ad /src/main/java/at/hannibal2/skyhanni/features/garden | |
parent | cd6ad90b00ae3e8ff7fceeaef2e37729aeffb508 (diff) | |
download | skyhanni-d48cf0126f9c163dd85c860004f658167912c85c.tar.gz skyhanni-d48cf0126f9c163dd85c860004f658167912c85c.tar.bz2 skyhanni-d48cf0126f9c163dd85c860004f658167912c85c.zip |
code cleanup
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/garden')
3 files changed, 4 insertions, 20 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropMilestoneFix.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropMilestoneFix.kt index 79461a78a..c4f85ae45 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropMilestoneFix.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropMilestoneFix.kt @@ -7,6 +7,7 @@ import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.events.TabListUpdateEvent import at.hannibal2.skyhanni.features.garden.farming.GardenCropMilestoneDisplay +import at.hannibal2.skyhanni.features.garden.pests.PestAPI import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.ItemUtils.itemNameWithoutColor import at.hannibal2.skyhanni.utils.NEUInternalName @@ -28,14 +29,6 @@ class GardenCropMilestoneFix { " {2}§r§b§lGARDEN MILESTONE §3(?<crop>.*) §8.*➜§3(?<tier>.*)" ) /** - * REGEX-TEST: §eYou received §a7x Enchanted Potato §efor killing a §6Locust§e! - * REGEX-TEST: §eYou received §a6x Enchanted Cocoa Beans §efor killing a §6Moth§e! - */ - private val pestLootPattern by patternGroup.pattern( - "pests.loot", - "§eYou received §a(?<amount>[0-9]*)x (?<item>.*) §efor killing an? §6(?<pest>.*)§e!" - ) - /** * REGEX-TEST: §6§lRARE DROP! §9Mutant Nether Wart §6(§6+1,344☘) */ private val pestRareDropPattern by patternGroup.pattern( @@ -56,7 +49,7 @@ class GardenCropMilestoneFix { val crops = GardenCropMilestones.getCropsForTier(tier, crop) changedValue(crop, crops, "level up chat message", 0) } - pestLootPattern.matchMatcher(event.message) { + PestAPI.pestDeathChatPattern.matchMatcher(event.message) { val amount = group("amount").toInt() val item = NEUInternalName.fromItemNameOrNull(group("item")) ?: return diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestAPI.kt index 4a1a626b8..8c218845a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestAPI.kt @@ -94,7 +94,7 @@ object PestAPI { * REGEX-TEST: §eYou received §a7x Enchanted Potato §efor killing a §6Locust§e! * REGEX-TEST: §eYou received §a6x Enchanted Cocoa Beans §efor killing a §6Moth§e! */ - private val pestDeathChatPattern by patternGroup.pattern( + val pestDeathChatPattern by patternGroup.pattern( "chat.pestdeath", "§eYou received §a(?<amount>[0-9]*)x (?<item>.*) §efor killing an? §6(?<pest>.*)§e!" ) diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestProfitTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestProfitTracker.kt index c3c768044..401d23733 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestProfitTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestProfitTracker.kt @@ -27,15 +27,6 @@ object PestProfitTracker { private val patternGroup = RepoPattern.group("garden.pests.tracker") /** - * REGEX-TEST: §eYou received §a7x Enchanted Potato §efor killing a §6Locust§e! - * REGEX-TEST: §eYou received §a6x Enchanted Cocoa Beans §efor killing a §6Moth§e! - */ - private val pestLootPattern by patternGroup.pattern( - "loot", - "§eYou received §a(?<amount>[0-9]*)x (?<item>.*) §efor killing an? §6(?<pest>.*)§e!" - ) - - /** * REGEX-TEST: §6§lRARE DROP! §9Mutant Nether Wart §6(§6+1,344☘) * REGEX-TEST: §6§lPET DROP! §r§5Slug §6(§6+1300☘) */ @@ -81,7 +72,7 @@ object PestProfitTracker { @SubscribeEvent fun onChat(event: LorenzChatEvent) { if (!isEnabled()) return - pestLootPattern.matchMatcher(event.message) { + PestAPI.pestDeathChatPattern.matchMatcher(event.message) { val amount = group("amount").toInt() val internalName = NEUInternalName.fromItemNameOrNull(group("item")) ?: return |