diff options
author | sayomaki <sayomayomaki@gmail.com> | 2024-07-07 17:30:05 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-07 11:30:05 +0200 |
commit | fee966a6da7be441d54f76566fe8ba517fc9b4cb (patch) | |
tree | 4b6889bde4512782dc448d63794e54f154c8b08f /src/main/java | |
parent | 3d691842dd3a937369725a87bcf5d91546168491 (diff) | |
download | skyhanni-fee966a6da7be441d54f76566fe8ba517fc9b4cb.tar.gz skyhanni-fee966a6da7be441d54f76566fe8ba517fc9b4cb.tar.bz2 skyhanni-fee966a6da7be441d54f76566fe8ba517fc9b4cb.zip |
Backend: Move hoppity rabbit chat patterns to eggs manager (#2144)
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) { |