From 02523ceac395ac77e65078651908ac58acbb7512 Mon Sep 17 00:00:00 2001 From: appable Date: Mon, 7 Aug 2023 03:19:21 -0700 Subject: Merge pull request #361 * fix bestiary milestone notification --- .../skyhanni/features/chat/CompactBestiaryChatMessage.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features/chat') 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()) -- cgit