aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt7
1 files changed, 5 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 dc98f3a0a..97f1b7ca3 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
@@ -30,7 +30,8 @@ object NEUItems {
private val multiplierCache = mutableMapOf<String, Pair<String, Int>>()
private val recipesCache = mutableMapOf<String, Set<NeuRecipe>>()
private val enchantmentNamePattern = Pattern.compile("^(?<format>(?:§.)+)(?<name>[^§]+) (?<level>[IVXL]+)$")
- private var allItemsCache = mapOf<String, String>() // item name -> internal name
+ var allItemsCache = mapOf<String, String>() // item name -> internal name
+ var allInternalNames = mutableListOf<String>()
fun getInternalName(itemName: String): String {
return getInternalNameOrNull(itemName) ?: throw Error("getInternalName is null for '$itemName'")
@@ -53,11 +54,13 @@ object NEUItems {
return null
}
- private fun readAllNeuItems(): Map<String, String> {
+ fun readAllNeuItems(): Map<String, String> {
+ allInternalNames.clear()
val map = mutableMapOf<String, String>()
for (internalName in manager.itemInformation.keys) {
val name = manager.createItem(internalName).displayName.removeColor().lowercase()
map[name] = internalName
+ allInternalNames.add(internalName)
}
return map
}