aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-08-27 22:37:36 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-08-27 22:37:36 +0200
commit287444efd0d98663aabb43f334604c97bcff7077 (patch)
treec76a81a91c85f995f75648227914767e94855b76 /src
parent80a6728abdd34d80495bfd18f0250bbf59865a25 (diff)
downloadskyhanni-287444efd0d98663aabb43f334604c97bcff7077.tar.gz
skyhanni-287444efd0d98663aabb43f334604c97bcff7077.tar.bz2
skyhanni-287444efd0d98663aabb43f334604c97bcff7077.zip
Fixed estimated item value detects master stars on non dungeon items
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt
index 385571c56..d092774af 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt
@@ -39,8 +39,11 @@ object SkyBlockItemModifierUtils {
fun ItemStack.getManaDisintegrators() = getAttributeInt("mana_disintegrator_count")
- fun ItemStack.getDungeonStarCount() =
+ fun ItemStack.getDungeonStarCount() = if (isDungeonItem()) {
getAttributeInt("upgrade_level") ?: getAttributeInt("dungeon_item_level")
+ } else null
+
+ private fun ItemStack.isDungeonItem(): Boolean = getLore().lastOrNull()?.contains("DUNGEON") == true
fun ItemStack.getPetExp() = getPetInfo()?.get("exp")?.asDouble