From 1be53be442a6ef8b6412e8f09f6e00ccbbb0af75 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Mon, 10 Jul 2023 11:26:24 +0200 Subject: Fixed duplex not working in bazaar features --- src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src') 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;(?.*)".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" -- cgit