diff options
author | Walker Selby <git@walkerselby.com> | 2023-12-17 14:06:40 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-17 15:06:40 +0100 |
commit | 2ac57182e9af1e62a4ae5799c8a2451a59017510 (patch) | |
tree | fb3bccb5490a80a5a70bd59a3f92bef7d6a39950 /src/main/java/at | |
parent | 75bcfde81d1494eaa41463e58e5767aa6d09b5a4 (diff) | |
download | skyhanni-2ac57182e9af1e62a4ae5799c8a2451a59017510.tar.gz skyhanni-2ac57182e9af1e62a4ae5799c8a2451a59017510.tar.bz2 skyhanni-2ac57182e9af1e62a4ae5799c8a2451a59017510.zip |
Remove unecessary non-capturing groups (#676)
Remove unnecessary non-capturing groups. #676
Diffstat (limited to 'src/main/java/at')
5 files changed, 7 insertions, 7 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt index a57c5a784..c95763adf 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt @@ -15,9 +15,9 @@ class PlayerChatModifier { private val patterns = mutableListOf<Regex>() init { - patterns.add("§[ab6]\\[(?:VIP|MVP)(?:(?:§.|\\+)*)](?: {1,2})(?:§[7ab6])?(\\w{2,16})".toRegex()) // ranked player with prefix everywhere - patterns.add("§[7ab6]((?:\\w){2,16})§r(?!§7x)(?!\$)".toRegex()) // all players without rank prefix in notification messages - patterns.add("(?:§7 )?§7((?:\\w){2,16})§7§r".toRegex()) // nons user chat + patterns.add("§[ab6]\\[(?:VIP|MVP)(?:§.|\\+)*] {1,2}(?:§[7ab6])?(\\w{2,16})".toRegex()) // ranked player with prefix everywhere + patterns.add("§[7ab6](\\w{2,16})§r(?!§7x)(?!\$)".toRegex()) // all players without rank prefix in notification messages + patterns.add("(?:§7 )?§7(\\w{2,16})§7§r".toRegex()) // nons user chat } @SubscribeEvent diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropMilestoneFix.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropMilestoneFix.kt index fa273ebb3..b75929edb 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropMilestoneFix.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropMilestoneFix.kt @@ -16,7 +16,7 @@ import java.util.regex.Pattern class GardenCropMilestoneFix { private val tabListPattern = " Milestone: §r§a(?<crop>.*) (?<tier>.*): §r§3(?<percentage>.*)%".toPattern() - private val levelUpPattern = Pattern.compile(" {2}§r§b§lGARDEN MILESTONE §3(?<crop>.*) §8(?:.*)➜§3(?<tier>.*)") + private val levelUpPattern = " {2}§r§b§lGARDEN MILESTONE §3(?<crop>.*) §8.*➜§3(?<tier>.*)".toPattern() private val tabListCropProgress = mutableMapOf<CropType, Long>() diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterInventoryNumbers.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterInventoryNumbers.kt index 2bbfc27a6..2cd0b4a60 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterInventoryNumbers.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterInventoryNumbers.kt @@ -11,7 +11,7 @@ import at.hannibal2.skyhanni.utils.StringUtils.removeColor import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class ComposterInventoryNumbers { - private val valuePattern = "(?:.*) §e(?<having>.*)§6\\/(?<total>.*)".toPattern() + private val valuePattern = ".* §e(?<having>.*)§6/(?<total>.*)".toPattern() private val compostsPattern = "§7§7Compost Available: §a(?<amount>.*)".toPattern() @SubscribeEvent diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/CruxTalismanDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/CruxTalismanDisplay.kt index 03a630874..2f5844442 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/CruxTalismanDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/CruxTalismanDisplay.kt @@ -20,7 +20,7 @@ object CruxTalismanDisplay { // TODO USE SH-REPO private val progressPattern = - ".*(?<tier>§[0-9a-z][IV1-4-]+)\\s+(?<name>§[0-9a-z]\\w+)§[0-9a-z]:\\s*(?<progress>§[0-9a-z](?:§[0-9a-z])?MAXED|(?:§[0-9a-z]\\d+§[0-9a-z]\\/§[0-9a-z]\\d+)).*".toPattern() + ".*(?<tier>§[0-9a-z][IV1-4-]+)\\s+(?<name>§[0-9a-z]\\w+)§[0-9a-z]:\\s*(?<progress>§[0-9a-z](?:§[0-9a-z])?MAXED|§[0-9a-z]\\d+§[0-9a-z]/§[0-9a-z]\\d+).*".toPattern() private val partialName = "CRUX_TALISMAN" private var display = emptyList<List<Any>>() diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/HideMobNames.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/HideMobNames.kt index eee256884..74505b19e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/HideMobNames.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/HideMobNames.kt @@ -42,7 +42,7 @@ class HideMobNames { } private fun addMobToHide(bossName: String) { - patterns.add("§8\\[§7Lv(?:\\d+)§8] §c$bossName§r §[ae](?<min>.+)§f/§a(?<max>.+)§c❤".toPattern()) + patterns.add("§8\\[§7Lv\\d+§8] §c$bossName§r §[ae](?<min>.+)§f/§a(?<max>.+)§c❤".toPattern()) } @SubscribeEvent(priority = EventPriority.HIGH) |