aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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