diff options
author | CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> | 2023-06-28 08:25:08 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-28 00:25:08 +0200 |
commit | 53caebdecfffdcb3c386bc9ae412c32e8a6c709c (patch) | |
tree | e92bff6ee3a3cc7446a6e205074491db92e0f6bd /src/main/java/at/hannibal2/skyhanni/utils | |
parent | be8b1c2ef97ad3ce210aa4e7a771323c381dd029 (diff) | |
download | skyhanni-53caebdecfffdcb3c386bc9ae412c32e8a6c709c.tar.gz skyhanni-53caebdecfffdcb3c386bc9ae412c32e8a6c709c.tar.bz2 skyhanni-53caebdecfffdcb3c386bc9ae412c32e8a6c709c.zip |
Merge pull request #258
* highlight items missing in NEU repo
* fixed it detecting some wrong items
* Merge branch 'hannibal002:beta' into highlight_missing_neu_items
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt | 7 |
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 } |