diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-05-08 17:33:01 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-05-08 17:33:01 +0200 |
commit | d15fcc9211ec24c1cf22e5bd935b713844cb126a (patch) | |
tree | 547a1d5d0da00e4d5ab04c168ba281d75faa5e5b /src/main/java/at/hannibal2/skyhanni/features | |
parent | 55bcc1638c3de9ac5d48662d6a827bbc3537c5d1 (diff) | |
download | skyhanni-d15fcc9211ec24c1cf22e5bd935b713844cb126a.tar.gz skyhanni-d15fcc9211ec24c1cf22e5bd935b713844cb126a.tar.bz2 skyhanni-d15fcc9211ec24c1cf22e5bd935b713844cb126a.zip |
fixed glacite pattern in tunnel maps
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/mining/TunnelsMaps.kt | 19 |
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) } } |