From df3b54e906164c349814e4e69ad97c801ef41061 Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Fri, 9 Aug 2024 03:20:52 -0400 Subject: Fix: Remove Empty Strings in Powder Filter (#2309) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../skyhanni/features/chat/PowderMiningChatFilter.kt | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/main/java/at/hannibal2') diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/PowderMiningChatFilter.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/PowderMiningChatFilter.kt index 32ce17b8d..9c100ef47 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/PowderMiningChatFilter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/PowderMiningChatFilter.kt @@ -19,6 +19,7 @@ import at.hannibal2.skyhanni.test.command.ErrorManager import at.hannibal2.skyhanni.utils.RegexUtils.groupOrNull import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher import at.hannibal2.skyhanni.utils.RegexUtils.matches +import at.hannibal2.skyhanni.utils.StringUtils import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -50,6 +51,14 @@ object PowderMiningChatFilter { "§6You have successfully picked the lock on this chest!", ) + /** + * REGEX-TEST: §cThis chest has already been looted. + */ + private val alreadyLootedPattern by patternGroup.pattern( + "warning.alreadylooted", + "§cThis chest has already been looted\\.", + ) + /** * REGEX-TEST: §cYou need a tool with a §r§aBreaking Power §r§cof §r§66§r§c to mine Ruby Gemstone Block§r§c! Speak to §r§dFragilis §r§cby the entrance to the Crystal Hollows to learn more! */ @@ -247,6 +256,7 @@ object PowderMiningChatFilter { // Generic "you uncovered a chest" message if (uncoverChestPattern.matches(message)) return "powder_mining_chest" if (successfulPickPattern.matches(message)) return "powder_mining_picked" + if (alreadyLootedPattern.matches(message)) return "powder_mining_dupe" // Breaking power warning if (breakingPowerPattern.matches(message) && gemstoneConfig.strongerToolMessages) return "stronger_tool" // Closing or opening a reward 'loop' with the spam of ▬ @@ -256,6 +266,7 @@ object PowderMiningChatFilter { } if (!unclosedRewards) return null + if (StringUtils.isEmpty(message)) return "powder_mining_empty" if (lockPickedPattern.matches(message)) return "powder_chest_lockpicked" if (lootChestCollectedPattern.matches(message)) return "loot_chest_opened" if (rewardHeaderPattern.matches((message))) return "powder_reward_header" @@ -382,6 +393,7 @@ object PowderMiningChatFilter { "flawed" -> if (gemSpecificFilterEntry > GemstoneFilterEntry.FLAWED_UP) { "powder_mining_gemstones" } else "no_filter" + "fine" -> if (gemSpecificFilterEntry > GemstoneFilterEntry.FINE_UP) { "powder_mining_gemstones" } else "no_filter" -- cgit