aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni
diff options
context:
space:
mode:
authorappable <enzospiacitelli@gmail.com>2023-08-07 03:19:21 -0700
committerGitHub <noreply@github.com>2023-08-07 12:19:21 +0200
commit02523ceac395ac77e65078651908ac58acbb7512 (patch)
tree539d9f426519e86a9552ac543393560d314bd263 /src/main/java/at/hannibal2/skyhanni
parent80266495d516d585ed40ab5f345b9e6f6d3e5e40 (diff)
downloadskyhanni-02523ceac395ac77e65078651908ac58acbb7512.tar.gz
skyhanni-02523ceac395ac77e65078651908ac58acbb7512.tar.bz2
skyhanni-02523ceac395ac77e65078651908ac58acbb7512.zip
Merge pull request #361
* fix bestiary milestone notification
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/chat/CompactBestiaryChatMessage.kt8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/CompactBestiaryChatMessage.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/CompactBestiaryChatMessage.kt
index d36f8ba35..192e51297 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/chat/CompactBestiaryChatMessage.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/chat/CompactBestiaryChatMessage.kt
@@ -20,6 +20,8 @@ class CompactBestiaryChatMessage {
var milestoneMessage: String? = null
+ val milestonePattern = "^.+(§8\\d{1,3}➡§e\\d{1,3})$".toRegex()
+
@SubscribeEvent
fun onChatMessage(event: LorenzChatEvent) {
if (!LorenzUtils.inSkyBlock) return
@@ -56,7 +58,7 @@ class CompactBestiaryChatMessage {
} else if (inBestiary) {
event.blockedReason = "bestiary"
blockedLines++
- if (blockedLines > 10) {
+ if (blockedLines > 15) {
blockedLines = 0
inBestiary = false
}
@@ -73,9 +75,9 @@ class CompactBestiaryChatMessage {
LorenzUtils.chat("§6§lBESTIARY MILESTONE $it")
milestoneMessage = null
}
- if (message.endsWith("§6§lBESTIARY MILESTONE")) {
+ milestonePattern.matchEntire(message)?.let {
acceptMoreDescription = false
- milestoneMessage = message
+ milestoneMessage = it.groups[1]!!.value
}
if (acceptMoreDescription) {
bestiaryDescription.add(message.trim())