diff options
author | hannibal2 <24389977+hannibal002@users.noreply.github.com> | 2024-05-30 09:02:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-30 09:02:50 +0200 |
commit | 294aad229547eb645e96ad9f847f03dbcee56dab (patch) | |
tree | 4cb5ca2beb51fbe296cc55655ecfe0e58fab8f54 /src/main/java/at | |
parent | 47b1fdce5577204bfef7a34dfe25af7374909ef6 (diff) | |
download | skyhanni-294aad229547eb645e96ad9f847f03dbcee56dab.tar.gz skyhanni-294aad229547eb645e96ad9f847f03dbcee56dab.tar.bz2 skyhanni-294aad229547eb645e96ad9f847f03dbcee56dab.zip |
Fixed compact chat breaking sometimes when obtaining legendary or hig… (#1923)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt | 7 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsManager.kt | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt index cfe229871..dc0c3b6ff 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt @@ -6,6 +6,7 @@ import at.hannibal2.skyhanni.features.inventory.chocolatefactory.ChocolateFactor import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.DelayedRun import at.hannibal2.skyhanni.utils.NumberUtil +import at.hannibal2.skyhanni.utils.RegexUtils.groupOrNull import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher import at.hannibal2.skyhanni.utils.SimpleTimeMark.Companion.fromNow import at.hannibal2.skyhanni.utils.TimeUtils.format @@ -84,10 +85,12 @@ object HoppityEggsCompactChat { compactChat(event) } HoppityEggsManager.newRabbitFound.matchMatcher(event.message) { - val chocolate = group("chocolate") + val chocolate = groupOrNull("chocolate") val perSecond = group("perSecond") newRabbit = true - lastProfit = "§6+$chocolate §7and §6+${perSecond}x c/s!" + lastProfit = chocolate?.let { + "§6+$it §7and §6+${perSecond}x c/s!" + } ?: "§6+${perSecond}x c/s!" compactChat(event) } } 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 0660268db..f6332219e 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 @@ -45,6 +45,7 @@ object HoppityEggsManager { /** * REGEX-TEST: §D§LHOPPITY'S HUNT §7You found §fArnie §7(§F§LCOMMON§7)! * REGEX-TEST: §D§LHOPPITY'S HUNT §7You found §aPenelope §7(§A§LUNCOMMON§7)! + * REGEX-TEST: §D§LHOPPITY'S HUNT §7You found §6Solomon §7(§6§LLEGENDARY§7)! */ val rabbitFoundPattern by ChocolateFactoryAPI.patternGroup.pattern( "rabbit.found", @@ -53,6 +54,7 @@ object HoppityEggsManager { /** * REGEX-TEST: §d§lNEW RABBIT! §6+2 Chocolate §7and §6+0.003x Chocolate §7per second! + * REGEX-TEST: §d§lNEW RABBIT! §6+0.02x Chocolate §7per second! */ val newRabbitFound by ChocolateFactoryAPI.patternGroup.pattern( "rabbit.found.new", |