diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-08-09 12:12:27 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-08-09 12:12:27 +0200 |
commit | 17ec026c19d1e203244217d599f72bd265d9aac8 (patch) | |
tree | 28c86ae9415e11ec316741ba752a7e807a10f74c /src/main/java/at/hannibal2/skyhanni/utils | |
parent | 3bcd5b3a8afa5b322d75af1b82681fd7b1e494e5 (diff) | |
download | skyhanni-17ec026c19d1e203244217d599f72bd265d9aac8.tar.gz skyhanni-17ec026c19d1e203244217d599f72bd265d9aac8.tar.bz2 skyhanni-17ec026c19d1e203244217d599f72bd265d9aac8.zip |
Using NEUInternalName in slayer profit tracker
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt index 4c18c7f94..75f9d1562 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt @@ -172,25 +172,25 @@ object NEUItems { fun getPrice(internalName: String, useSellingPrice: Boolean = false) = NEUInternalName.from(internalName).getPrice(useSellingPrice) - fun getItemStackOrNull(internalName: NEUInternalName) = ItemResolutionQuery(manager) - .withKnownInternalName(internalName.asString()) + fun NEUInternalName.getItemStackOrNull() = ItemResolutionQuery(manager) + .withKnownInternalName(asString()) .resolveToItemStack()?.copy() - fun getItemStackOrNull(internalName: String) = getItemStackOrNull(NEUInternalName.from(internalName)) + fun getItemStackOrNull(internalName: String) = NEUInternalName.from(internalName).getItemStackOrNull() fun getItemStack(internalName: String, definite: Boolean = false): ItemStack = - getItemStack(NEUInternalName.from(internalName), definite) + NEUInternalName.from(internalName).getItemStack(definite) - fun getItemStack(internalName: NEUInternalName, definite: Boolean = false): ItemStack = - getItemStackOrNull(internalName) ?: run { - if (internalName.getPrice() == -1.0) return@run fallbackItem + fun NEUInternalName.getItemStack(definite: Boolean = false): ItemStack = + getItemStackOrNull() ?: run { + if (getPrice() == -1.0) return@run fallbackItem if (definite) { Utils.showOutdatedRepoNotification() } CopyErrorCommand.logError( IllegalStateException("Something went wrong!"), - "Encountered an error getting the item for §7$internalName§c. " + + "Encountered an error getting the item for §7$this§c. " + "This may be because your NEU repo is outdated. Please ask in the SkyHanni " + "Discord if this is the case" ) |