aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils/ItemNameResolver.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/ItemNameResolver.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/ItemNameResolver.kt24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ItemNameResolver.kt b/src/main/java/at/hannibal2/skyhanni/utils/ItemNameResolver.kt
index 53d9c5519..9c8f0f389 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/ItemNameResolver.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/ItemNameResolver.kt
@@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.utils
import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName
import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimal
+import at.hannibal2.skyhanni.utils.StringUtils.allLettersFirstUppercase
import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
import at.hannibal2.skyhanni.utils.StringUtils.removeColor
import io.github.moulberry.notenoughupdates.util.ItemResolutionQuery
@@ -22,6 +23,29 @@ object ItemNameResolver {
resolveEnchantmentByName(itemName)?.let {
return itemNameCache.getOrPut(lowercase) { fixEnchantmentName(it) }
}
+ if (itemName.endsWith("gemstone", ignoreCase = true)) {
+ val split = lowercase.split(" ")
+ if (split.size == 3) {
+ val gemstoneQuery = "${
+ when (split[1]) {
+ "jade", "peridot", "citrine" -> '☘'
+ "amethyst" -> '❈'
+ "ruby" -> '❤'
+ "amber" -> '⸕'
+ "opal" -> '❂'
+ "topaz" -> '✧'
+ "onyx" -> '☠'
+ "sapphire" -> '✎'
+ "aquamarine" -> 'α'
+ "jasper" -> '❁'
+ else -> ' '
+ }
+ }_${split.joinToString("_")}".allLettersFirstUppercase()
+ ItemResolutionQuery.findInternalNameByDisplayName(gemstoneQuery, true)?.let {
+ return itemNameCache.getOrPut(lowercase) { it.asInternalName() }
+ }
+ }
+ }
val internalName = when (itemName) {
"SUPERBOOM TNT" -> "SUPERBOOM_TNT".asInternalName()