From a1e0e192ba5c7e12bf2edbfadefe286d7503f188 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Mon, 17 Apr 2023 23:08:50 +0200 Subject: to Pattern --- src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/api') diff --git a/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt b/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt index c2782a3c1..074120d66 100644 --- a/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt @@ -11,11 +11,10 @@ import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NEUItems import at.hannibal2.skyhanni.utils.StringUtils.removeColor import net.minecraftforge.fml.common.eventhandler.SubscribeEvent -import java.util.regex.Pattern class CollectionAPI { - private val counterPattern = Pattern.compile("(?:.*) §e(.*)§6\\/(?:.*)") - private val singleCounterPattern = Pattern.compile("§7Total Collected: §e(.*)") + private val counterPattern = "(?:.*) §e(.*)§6\\/(?:.*)".toPattern() + private val singleCounterPattern = "§7Total Collected: §e(.*)".toPattern() // private val hypixelApiHasWrongItems = listOf( // "WOOL", @@ -99,7 +98,7 @@ class CollectionAPI { companion object { private val collectionValue = mutableMapOf() - private val collectionTier0Pattern = Pattern.compile("§7Progress to .* I: .*") + private val collectionTier0Pattern = "§7Progress to .* I: .*".toPattern() fun isCollectionTier0(lore: List) = lore.map { collectionTier0Pattern.matcher(it) }.any { it.matches() } -- cgit