aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-07-10 11:26:24 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-07-10 11:26:24 +0200
commit1be53be442a6ef8b6412e8f09f6e00ccbbb0af75 (patch)
tree6bbd19b4060bb15f35316e49f78c425fb24bc08b /src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
parentc8a5bb9218e226b17c36905c90c6d77399fd13c6 (diff)
downloadskyhanni-1be53be442a6ef8b6412e8f09f6e00ccbbb0af75.tar.gz
skyhanni-1be53be442a6ef8b6412e8f09f6e00ccbbb0af75.tar.bz2
skyhanni-1be53be442a6ef8b6412e8f09f6e00ccbbb0af75.zip
Fixed duplex not working in bazaar features
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
index 2aac8f11b..077993544 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
@@ -88,8 +88,9 @@ object NEUItems {
}
resolveEnchantmentByName(itemName)?.let {
- itemNameCache[itemName] = it
- return it
+ val enchantmentName = fixEnchantmentName(it)
+ itemNameCache[itemName] = enchantmentName
+ return enchantmentName
}
var internalName = ItemResolutionQuery.findInternalNameByDisplayName(itemName, false) ?: return null
@@ -103,6 +104,16 @@ object NEUItems {
return internalName
}
+ private fun fixEnchantmentName(originalName: String): String {
+ // Workaround for duplex
+ "ULTIMATE_DUPLEX;(?<tier>.*)".toPattern().matchMatcher(originalName) {
+ val tier = group("tier")
+ return "ULTIMATE_REITERATE;$tier"
+ }
+
+ return originalName
+ }
+
private fun turboCheck(text: String): String {
if (text == "Turbo-Cocoa") return "Turbo-Coco"
if (text == "Turbo-Cacti") return "Turbo-Cactus"