aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/mining/TunnelsMaps.kt19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/TunnelsMaps.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/TunnelsMaps.kt
index 32e5864af..39bf63de6 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/mining/TunnelsMaps.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/mining/TunnelsMaps.kt
@@ -112,9 +112,13 @@ class TunnelsMaps {
private val commissionInvPattern by RepoPattern.pattern(
"mining.commission.inventory", "Commissions"
)
+ /**
+ * REGEX-TEST: §7- §b277 Glacite Powder
+ * REGEX-TEST: §7- §b1,010 Glacite Powder
+ */
private val glacitePattern by RepoPattern.pattern(
"mining.commisson.reward.glacite",
- "§7- §b\\d+ Glacite Powder"
+ "§7- §b[\\d,]+ Glacite Powder"
)
private val collectorCommissionPattern by RepoPattern.pattern(
"mining.commisson.collector",
@@ -140,19 +144,28 @@ class TunnelsMaps {
@SubscribeEvent
fun onInventoryFullyOpened(event: InventoryFullyOpenedEvent) {
+ println("a")
if (!isEnabled()) return
+ println("b")
clickTranslate = mapOf()
if (!commissionInvPattern.matches(event.inventoryName)) return
+ println("c")
clickTranslate = event.inventoryItems.mapNotNull { (slotId, item) ->
+ println("d")
val lore = item.getLore()
if (!glacitePattern.anyMatches(lore)) return@mapNotNull null
+ println("e")
if (completedPattern.anyMatches(lore)) return@mapNotNull null
+ println("f")
val type = lore.matchFirst(collectorCommissionPattern) {
group("what")
} ?: return@mapNotNull null
+ println("g")
if (invalidGoalPattern.matches(type)) return@mapNotNull null
+ println("h")
val mapName = getGenericName(type)
if (mapName.isEmpty()) {
+ println("i")
ErrorManager.logErrorStateWithData(
"Unknown Collection Commission: $type", "$type can't be found in the graph.",
"type" to type,
@@ -161,11 +174,15 @@ class TunnelsMaps {
)
null
} else {
+ println("j")
slotId to getGenericName(type)
}
}.toMap()
+ println("k")
if (config.autoCommission) {
+ println("l")
clickTranslate.values.firstOrNull()?.let {
+ println("m")
setActiveAndGoal(it)
}
}