diff options
author | hannibal2 <24389977+hannibal002@users.noreply.github.com> | 2024-05-04 12:03:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-04 12:03:40 +0200 |
commit | a33192c6bff789cdf9c814d5f74f2d862d46eb5f (patch) | |
tree | 0e5d08dc85177e30908645de789545016aaf1083 | |
parent | 4fd2aa4b44ce23957749e513f8856ac6dce7f883 (diff) | |
download | skyhanni-a33192c6bff789cdf9c814d5f74f2d862d46eb5f.tar.gz skyhanni-a33192c6bff789cdf9c814d5f74f2d862d46eb5f.tar.bz2 skyhanni-a33192c6bff789cdf9c814d5f74f2d862d46eb5f.zip |
Improvement: Use raw craft cost (#1682)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt | 6 |
1 files changed, 4 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 430edc971..b3d92e68f 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt @@ -150,7 +150,6 @@ object NEUItems { fun getInternalNameOrNull(nbt: NBTTagCompound): NEUInternalName? = ItemResolutionQuery(manager).withItemNBT(nbt).resolveInternalName()?.asInternalName() - fun NEUInternalName.getPrice(useSellingPrice: Boolean = false) = getPriceOrNull(useSellingPrice) ?: -1.0 fun NEUInternalName.getNpcPrice() = getNpcPriceOrNull() ?: -1.0 @@ -184,9 +183,12 @@ object NEUItems { // 6.8 for some players return 7.0 // NPC price } - return getNpcPriceOrNull() + + return getNpcPriceOrNull() ?: getRawCraftCostOrNull() } + fun NEUInternalName.getRawCraftCostOrNull(): Double? = manager.auctionManager.getCraftCost(asString())?.craftCost + fun NEUInternalName.getItemStackOrNull(): ItemStack? = ItemResolutionQuery(manager) .withKnownInternalName(asString()) .resolveToItemStack()?.copy() |