aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/test/TestCopyBestiaryValues.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/test/TestCopyBestiaryValues.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/TestCopyBestiaryValues.kt8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/test/TestCopyBestiaryValues.kt b/src/main/java/at/hannibal2/skyhanni/test/TestCopyBestiaryValues.kt
index e418f6043..348d05cb2 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/TestCopyBestiaryValues.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/TestCopyBestiaryValues.kt
@@ -12,6 +12,7 @@ import at.hannibal2.skyhanni.utils.NumberUtil.formatNumber
import at.hannibal2.skyhanni.utils.OSUtils
import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
import at.hannibal2.skyhanni.utils.StringUtils.removeColor
+import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern
import com.google.gson.GsonBuilder
import com.google.gson.annotations.Expose
import net.minecraft.item.ItemStack
@@ -41,7 +42,10 @@ object TestCopyBestiaryValues {
var bracket: Int = 0
}
- val pattern = "\\[Lv(?<lvl>.*)] (?<text>.*)".toPattern()
+ private val bestiaryTypePattern by RepoPattern.pattern(
+ "test.bestiary.type",
+ "\\[Lv(?<lvl>.*)] (?<text>.*)"
+ )
@SubscribeEvent(priority = EventPriority.LOW)
fun onLateInventoryOpen(event: InventoryUpdatedEvent) {
@@ -85,7 +89,7 @@ object TestCopyBestiaryValues {
for (i in 10..43) {
val stack = inventoryItems[i] ?: continue
val stackName = stack.name ?: continue
- pattern.matchMatcher(stackName.removeColor()) {
+ bestiaryTypePattern.matchMatcher(stackName.removeColor()) {
val lvl = group("lvl").toInt()
var text = group("text").lowercase().replace(" ", "_")