From 0dd709b35f05359c48650ea8fc83f6c2479e56d8 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sun, 28 Jan 2024 18:04:34 +0100 Subject: Fixed rune price calculation in Chest Value. --- .../at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt | 3 ++- .../skyhanni/features/misc/items/EstimatedItemValueCalculator.kt | 2 ++ src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main') diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt index d3560d3c6..527dfe4fe 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt @@ -11,6 +11,7 @@ import at.hannibal2.skyhanni.events.RenderItemTooltipEvent import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils.getInternalNameOrNull import at.hannibal2.skyhanni.utils.ItemUtils.getLore +import at.hannibal2.skyhanni.utils.ItemUtils.isRune import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.KeyboardManager.isKeyHeld import at.hannibal2.skyhanni.utils.LorenzUtils @@ -182,7 +183,7 @@ object EstimatedItemValue { // Blocks the dungeon map if (internalName.startsWith("MAP-")) return listOf() // Hides the rune item - if (internalName.contains("_RUNE;")) return listOf() + if (internalName.isRune()) return listOf() if (internalName.contains("UNIQUE_RUNE")) return listOf() if (internalName.contains("WISP_POTION")) return listOf() diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt index 601413065..2ff799e77 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt @@ -7,6 +7,7 @@ import at.hannibal2.skyhanni.utils.ItemUtils.getItemName import at.hannibal2.skyhanni.utils.ItemUtils.getItemNameOrNull import at.hannibal2.skyhanni.utils.ItemUtils.getItemRarityOrNull import at.hannibal2.skyhanni.utils.ItemUtils.getLore +import at.hannibal2.skyhanni.utils.ItemUtils.isRune import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.ItemUtils.nameWithEnchantment import at.hannibal2.skyhanni.utils.LorenzRarity @@ -472,6 +473,7 @@ object EstimatedItemValueCalculator { } private fun addRune(stack: ItemStack, list: MutableList): Double { + if (stack.getInternalName().isRune()) return 0.0 val internalName = stack.getRune() ?: return 0.0 val price = internalName.getPrice() diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt index 3bc79dbf2..d2c9776b7 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt @@ -380,4 +380,6 @@ object ItemUtils { } return rarity } + + fun NEUInternalName.isRune(): Boolean = contains("_RUNE;") } -- cgit