From 122d6c830ba94fcd7c512960d5c5ab11d75fd1d5 Mon Sep 17 00:00:00 2001 From: minhperry <46137516+minhperry@users.noreply.github.com> Date: Fri, 27 Sep 2024 09:44:15 +0200 Subject: Fix: Item category detection (#2608) --- .../at/hannibal2/skyhanni/utils/UtilsPatterns.kt | 44 +++++++++++----------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'src/main/java/at') diff --git a/src/main/java/at/hannibal2/skyhanni/utils/UtilsPatterns.kt b/src/main/java/at/hannibal2/skyhanni/utils/UtilsPatterns.kt index 9ce7a32c5..efe1ddf95 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/UtilsPatterns.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/UtilsPatterns.kt @@ -10,9 +10,9 @@ object UtilsPatterns { private val patternGroup = RepoPattern.group("utils") /** Examples: - §d§l§ka§r §d§l§d§lMYTHIC ACCESSORY §d§l§ka - §d§l§ka§r §d§l§d§lSHINY MYTHIC DUNGEON CHESTPLATE §d§l§ka - §c§l§ka§r §c§l§c§lVERY SPECIAL HATCESSORY §c§l§ka + §d§l§ka§r §d§lMYTHIC ACCESSORY §d§l§ka + §d§l§ka§r §d§lSHINY MYTHIC DUNGEON CHESTPLATE §d§l§ka + §c§l§ka§r §c§lVERY SPECIAL HATCESSORY §c§l§ka §6§lSHINY LEGENDARY DUNGEON BOOTS §6§lLEGENDARY DUNGEON BOOTS §5§lEPIC BOOTS @@ -20,14 +20,14 @@ object UtilsPatterns { **/ val rarityLoreLinePattern by patternGroup.pattern( "item.lore.rarity.line", - "^(?:§.){2,3}(?:.§. (?:§.){4})?(?:SHINY )?(?" + + "^(?:§.){2,3}(?:.§. (?:§.){2})?(?:SHINY )?(?" + enumJoinToPattern { it.name.replace("_", " ") } + - ") ?(?:DUNGEON )?(?[^§]*)(?: (?:§.){3}.)?$" + ") ?(?:DUNGEON )?(?[^§]*)(?: (?:§.){3}.)?$", ) val abiPhonePattern by patternGroup.pattern( "item.name.abiphone", - ".{2}Abiphone .*" + ".{2}Abiphone .*", ) /** @@ -36,17 +36,17 @@ object UtilsPatterns { */ val enchantedBookPattern by patternGroup.pattern( "item.name.enchanted.book", - "(?:§.)+Enchanted Book" + "(?:§.)+Enchanted Book", ) val baitPattern by patternGroup.pattern( "item.name.bait", - "^(Obfuscated.*|.* Bait)$" + "^(Obfuscated.*|.* Bait)$", ) val enchantmentNamePattern by patternGroup.pattern( "item.neuitems.enchantmentname", - "^(?(?:§.)*)(?[^§]+) (?[IVXL]+)(?: Book)?$" + "^(?(?:§.)*)(?[^§]+) (?[IVXL]+)(?: Book)?$", ) /** @@ -56,61 +56,61 @@ object UtilsPatterns { */ val cleanEnchantedNamePattern by patternGroup.pattern( "item.enchantment.clean.name", - "(?i)(?.*) (?[IVXL]+|[0-9]+)" + "(?i)(?.*) (?[IVXL]+|[0-9]+)", ) val potionPattern by patternGroup.pattern( "item.name.potion", - ".*Potion" + ".*Potion", ) val readAmountBeforePattern by patternGroup.pattern( "item.amount.front", - "(?: +§8(?:\\+§.)?(?[\\d.,]+[km]?)x? )?(?.*)" + "(?: +§8(?:\\+§.)?(?[\\d.,]+[km]?)x? )?(?.*)", ) val readAmountAfterPattern by patternGroup.pattern( "item.amount.behind", - "(?(?:§.)*(?:[^§] ?)+)(?:§8x(?[\\d,]+))?" + "(?(?:§.)*(?:[^§] ?)+)(?:§8x(?[\\d,]+))?", ) val costLinePattern by patternGroup.pattern( "item.cost.line", - "(?:§5§o)?§7Cost.*" + "(?:§5§o)?§7Cost.*", ) val timeAmountPattern by patternGroup.pattern( "time.amount", - "(?:(?\\d+) ?y(?:\\w* ?)?)?(?:(?\\d+) ?d(?:\\w* ?)?)?(?:(?\\d+) ?h(?:\\w* ?)?)?(?:(?\\d+) ?m(?:\\w* ?)?)?(?:(?\\d+) ?s(?:\\w* ?)?)?" + "(?:(?\\d+) ?y(?:\\w* ?)?)?(?:(?\\d+) ?d(?:\\w* ?)?)?(?:(?\\d+) ?h(?:\\w* ?)?)?(?:(?\\d+) ?m(?:\\w* ?)?)?(?:(?\\d+) ?s(?:\\w* ?)?)?", ) val playerChatPattern by patternGroup.pattern( "string.playerchat", - "(?.*?)(?:§[f7r])*: .*" + "(?.*?)(?:§[f7r])*: .*", ) val chatUsernamePattern by patternGroup.pattern( "string.chatusername", - "^(?:§\\w\\[§\\w\\d+§\\w] )?(?:(?:§\\w)+\\S )?(?(?:§\\w\\[\\w.+] )?(?:§\\w)?(?\\w+))(?: (?:§\\w)?\\[.+?])?" + "^(?:§\\w\\[§\\w\\d+§\\w] )?(?:(?:§\\w)+\\S )?(?(?:§\\w\\[\\w.+] )?(?:§\\w)?(?\\w+))(?: (?:§\\w)?\\[.+?])?", ) val isRomanPattern by RepoPattern.pattern( "string.isroman", - "^M{0,3}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})" + "^M{0,3}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})", ) val sackPattern by patternGroup.pattern( "item.sack", - ".*Sack" + ".*Sack", ) val seasonPattern by patternGroup.pattern( "skyblocktime.season", - "(?:Early |Late )?(?Spring|Summer|Autumn|Winter)" + "(?:Early |Late )?(?Spring|Summer|Autumn|Winter)", ) val tabListProfilePattern by patternGroup.pattern( "tablist.profile", - "(?:§.)+Profile: §r§a(?[\\w\\s]+[^ §]).*" + "(?:§.)+Profile: §r§a(?[\\w\\s]+[^ §]).*", ) val shopOptionsPattern by patternGroup.pattern( "inventory.shopoptions", - "Shop Trading Options" + "Shop Trading Options", ) } -- cgit