diff options
author | David Cole <40234707+DavidArthurCole@users.noreply.github.com> | 2024-08-09 03:20:52 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-09 09:20:52 +0200 |
commit | df3b54e906164c349814e4e69ad97c801ef41061 (patch) | |
tree | 48df84bf23f8fc042098213eece6c90248c44fdd /src/main | |
parent | 30397bb0ac74a11c90f5dccf803361bbd49bea59 (diff) | |
download | skyhanni-df3b54e906164c349814e4e69ad97c801ef41061.tar.gz skyhanni-df3b54e906164c349814e4e69ad97c801ef41061.tar.bz2 skyhanni-df3b54e906164c349814e4e69ad97c801ef41061.zip |
Fix: Remove Empty Strings in Powder Filter (#2309)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/chat/PowderMiningChatFilter.kt | 12 |
1 files changed, 12 insertions, 0 deletions
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 @@ -51,6 +52,14 @@ object PowderMiningChatFilter { ) /** + * 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! */ private val breakingPowerPattern by patternGroup.pattern( @@ -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" |