diff options
| author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-08-09 13:23:26 +0200 |
|---|---|---|
| committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-08-09 13:23:26 +0200 |
| commit | e04efa84f7d42ddcbe11eb65f25adc0e524a3aaa (patch) | |
| tree | 4ee90ed22d4b23f08324013be74bce2e05b3c09b /src/main/java/at/hannibal2/skyhanni/api | |
| parent | 7c8a513ac98071ce34ed9e35660956d7e5b7fac5 (diff) | |
| download | skyhanni-e04efa84f7d42ddcbe11eb65f25adc0e524a3aaa.tar.gz skyhanni-e04efa84f7d42ddcbe11eb65f25adc0e524a3aaa.tar.bz2 skyhanni-e04efa84f7d42ddcbe11eb65f25adc0e524a3aaa.zip | |
Using NEUInternalName in CollectionAPI
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/api')
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt b/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt index 8fd1b4cb5..c5f6c6e0a 100644 --- a/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt @@ -4,7 +4,6 @@ import at.hannibal2.skyhanni.events.CollectionUpdateEvent import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent import at.hannibal2.skyhanni.events.ProfileApiDataLoadedEvent import at.hannibal2.skyhanni.events.ProfileJoinEvent -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_new import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils @@ -91,19 +90,14 @@ class CollectionAPI { fun isCollectionTier0(lore: List<String>) = lore.map { collectionTier0Pattern.matcher(it) }.any { it.matches() } - fun getCollectionCounter(itemName: String) = getCollectionCounter(NEUItems.getInternalName_new(itemName)) - fun getCollectionCounter(internalName: NEUInternalName) = collectionValue[internalName] // TODO add support for replenish (higher collection than actual items in inv) - fun addFromInventory(internalNameRaw: String, amount: Int) { - val stack = NEUItems.getItemStackOrNull(internalNameRaw) - if (stack == null) { - LorenzUtils.debug("CollectionAPI.addFromInventory: internalName is null for '$internalNameRaw'") + fun addFromInventory(internalName: NEUInternalName, amount: Int) { + if (internalName.getItemStackOrNull() == null) { + LorenzUtils.debug("CollectionAPI.addFromInventory: item is null for '$internalName'") return } - val internalName = stack.getInternalName_new() - collectionValue.addOrPut(internalName, amount.toLong()) } } |
