aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-04-04 15:10:17 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-04-04 15:10:17 +0200
commitc18b03b84b99ce868a003d70f44baab3145ca0b1 (patch)
tree843bda68478df61c12c692adb7a6d0d1a6ef395a /src/main/java
parent5093e15e9628a5c25360a70146881dbd998c6069 (diff)
downloadskyhanni-c18b03b84b99ce868a003d70f44baab3145ca0b1.tar.gz
skyhanni-c18b03b84b99ce868a003d70f44baab3145ca0b1.tar.bz2
skyhanni-c18b03b84b99ce868a003d70f44baab3145ca0b1.zip
Add more edge cases for EstimatedItemValue
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/EstimatedItemValue.kt21
1 files changed, 16 insertions, 5 deletions
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<List<Any>> {
+ private fun draw(stack: ItemStack): List<List<Any>> {
val list = mutableListOf<String>()
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))