diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-07-04 19:12:09 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-07-04 19:12:09 +0200 |
commit | a7aaa59273a096f9950246b4053b0cc3235ca9b6 (patch) | |
tree | dccae4d54031d6e671e4756b004e22651ad53117 /src/main | |
parent | bbb25d33da9306e68eb11f03f10dae3fc482948e (diff) | |
download | skyhanni-a7aaa59273a096f9950246b4053b0cc3235ca9b6.tar.gz skyhanni-a7aaa59273a096f9950246b4053b0cc3235ca9b6.tar.bz2 skyhanni-a7aaa59273a096f9950246b4053b0cc3235ca9b6.zip |
using upgrade_level if dungeon_item_level is smaller to calculate dungeon star count
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt | 8 |
1 files changed, 6 insertions, 2 deletions
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") |