From a7aaa59273a096f9950246b4053b0cc3235ca9b6 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Tue, 4 Jul 2023 19:12:09 +0200 Subject: using upgrade_level if dungeon_item_level is smaller to calculate dungeon star count --- .../java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt index 87308e495..136fbfb0e 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt @@ -35,7 +35,11 @@ object SkyBlockItemModifierUtils { fun ItemStack.getManaDisintegrators() = getAttributeInt("mana_disintegrator_count") - fun ItemStack.getDungeonStarCount() = getAttributeInt("dungeon_item_level") + fun ItemStack.getDungeonStarCount() = getAttributeInt("dungeon_item_level")?.let { + getAttributeInt("upgrade_level")?.let { upgradeLevel -> + return it.coerceAtLeast(upgradeLevel) + } ?: it + } fun ItemStack.getPetCandyUsed(): Int? { val data = cachedData @@ -129,7 +133,7 @@ object SkyBlockItemModifierUtils { enchantments.keySet.associateWith { enchantments.getInteger(it) } } - fun ItemStack.getAppliedPocketSackInASack(): Int?{ + fun ItemStack.getAppliedPocketSackInASack(): Int? { val data = cachedData if (data.sackInASack == -1) { data.sackInASack = getAttributeInt("sack_pss") -- cgit