diff options
Diffstat (limited to 'src/main/java')
2 files changed, 8 insertions, 11 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsManager.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsManager.kt index 8a60516b3..37679bdbf 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsManager.kt @@ -70,6 +70,12 @@ object HoppityEggsManager { "rabbit.found.new", "§d§lNEW RABBIT! (?:((§6\\+(?<chocolate>.*) Chocolate §7and )?§6\\+(?<perSecond>.*)x Chocolate §7per second!)|(?<other>.*))", ) + + val duplicateRabbitFound by ChocolateFactoryAPI.patternGroup.pattern( + "rabbit.duplicate", + "§7§lDUPLICATE RABBIT! §6\\+(?<amount>[\\d,]+) Chocolate" + ) + private val noEggsLeftPattern by ChocolateFactoryAPI.patternGroup.pattern( "egg.noneleft", "§cThere are no hidden Chocolate Rabbit Eggs nearby! Try again later!", diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryBarnManager.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryBarnManager.kt index 62a156ca8..82cd17339 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryBarnManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryBarnManager.kt @@ -23,15 +23,6 @@ object ChocolateFactoryBarnManager { private val hoppityConfig get() = HoppityEggsManager.config private val profileStorage get() = ChocolateFactoryAPI.profileStorage - private val newRabbitPattern by ChocolateFactoryAPI.patternGroup.pattern( - "rabbit.new", - "§d§lNEW RABBIT! §6\\+\\d+ Chocolate §7and §6\\+0.\\d+x Chocolate §7per second!" - ) - private val rabbitDuplicatePattern by ChocolateFactoryAPI.patternGroup.pattern( - "rabbit.duplicate", - "§7§lDUPLICATE RABBIT! §6\\+(?<amount>[\\d,]+) Chocolate" - ) - /** * REGEX-TEST: §c§lBARN FULL! §fOlivette §7got §ccrushed§7! §6+290,241 Chocolate */ @@ -47,14 +38,14 @@ object ChocolateFactoryBarnManager { fun onChat(event: LorenzChatEvent) { if (!LorenzUtils.inSkyBlock) return - newRabbitPattern.matchMatcher(event.message) { + HoppityEggsManager.newRabbitFound.matchMatcher(event.message) { val profileStorage = profileStorage ?: return profileStorage.currentRabbits += 1 trySendBarnFullMessage() HoppityEggsManager.shareWaypointPrompt() } - rabbitDuplicatePattern.matchMatcher(event.message) { + HoppityEggsManager.duplicateRabbitFound.matchMatcher(event.message) { HoppityEggsManager.shareWaypointPrompt() val amount = group("amount").formatLong() if (config.showDuplicateTime && !hoppityConfig.compactChat) { |