diff options
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 |