aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt
index 93d1a414d..b19014034 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt
@@ -54,6 +54,13 @@ class SlayerRngMeterDisplay {
"changeditem",
"§aYou set your §r.* RNG Meter §r§ato drop §r.*§a!"
)
+ /**
+ * REGEX-TEST: §aEnchanted Book (§d§lDuplex I§a)
+ */
+ private val bookFormatPattern by patternGroup.pattern(
+ "book.format",
+ "§aEnchanted Book \\((?<name>.*)§a\\)"
+ )
private var display = emptyList<Renderable>()
private var lastItemDroppedTime = 0L
@@ -159,8 +166,11 @@ class SlayerRngMeterDisplay {
if (name != getCurrentSlayer()) return
- val selectedItem = lore.nextAfter("§7Selected Drop") ?: return
- val internalName = NEUInternalName.fromItemName(selectedItem)
+ val rawName = lore.nextAfter("§7Selected Drop") ?: return
+ val itemName = bookFormatPattern.matchMatcher(rawName) {
+ group("name")
+ } ?: rawName
+ val internalName = NEUInternalName.fromItemName(itemName)
setNewGoal(internalName)
}