From c18b03b84b99ce868a003d70f44baab3145ca0b1 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Tue, 4 Apr 2023 15:10:17 +0200 Subject: Add more edge cases for EstimatedItemValue --- .../skyhanni/features/misc/EstimatedItemValue.kt | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'src/main/java/at/hannibal2') diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/EstimatedItemValue.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/EstimatedItemValue.kt index a92dcf231..6c64b2d09 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/EstimatedItemValue.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/EstimatedItemValue.kt @@ -86,16 +86,27 @@ class EstimatedItemValue { lastToolTipTime = System.currentTimeMillis() } - private fun draw(stack: ItemStack): MutableList> { + private fun draw(stack: ItemStack): List> { val list = mutableListOf() list.add("§aEstimated Item Value:") val internalName = stack.getInternalName() - if (internalName == "") return mutableListOf() + if (internalName == "") return listOf() //FIX neu item list - if (internalName.startsWith("ULTIMATE_ULTIMATE_")) return mutableListOf() - if (stack.item == Items.enchanted_book) return mutableListOf() + if (internalName.startsWith("ULTIMATE_ULTIMATE_")) return listOf() + // we don't need this feature to work on books at all + if (stack.item == Items.enchanted_book) return listOf() + // block catacombs items in mort inventory + if (internalName.startsWith("CATACOMBS_PASS_") || internalName.startsWith("MASTER_CATACOMBS_PASS_")) return listOf() + // blocks the dungeon map + if (internalName.startsWith("MAP-")) return listOf() + + + if (NEUItems.getItemStackOrNull(internalName) == null) { + LorenzUtils.debug("Estimated Item Value is null for internal name: '$internalName'") + return listOf() + } var totalPrice = 0.0 val basePrice = addBaseItem(stack, list) @@ -126,7 +137,7 @@ class EstimatedItemValue { totalPrice += addGemstones(stack, list) totalPrice += addEnchantments(stack, list) - if (basePrice == totalPrice) return mutableListOf() + if (basePrice == totalPrice) return listOf() list.add("§aTotal: §6§l" + NumberUtil.format(totalPrice)) -- cgit