From fcf5982771458ff8fb093e696a4666a75e2f304c Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Fri, 16 Jun 2023 00:19:38 +0200 Subject: Fixed dungeon stars in estimated item value working with skytils correctly --- .../features/misc/items/EstimatedItemValue.kt | 8 +++++--- .../skyhanni/utils/SkyBlockItemModifierUtils.kt | 20 ++------------------ 2 files changed, 7 insertions(+), 21 deletions(-) (limited to 'src/main/java/at') 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 70980a715..15e35a11a 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 @@ -16,13 +16,13 @@ import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getAbilityScrolls import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getArmorDye import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getDrillUpgrades +import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getDungeonStarCount import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getEnchantments import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getFarmingForDummiesCount import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getGemstones import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getHelmetSkin import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getHotPotatoCount import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getManaDisintegrators -import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getMasterStars import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getPowerScroll import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getReforgeName import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getRune @@ -317,8 +317,10 @@ object EstimatedItemValue { } private fun addMasterStars(stack: ItemStack, list: MutableList): Double { - val masterStars = stack.getMasterStars() - if (masterStars == 0) return 0.0 + val totalStars = stack.getDungeonStarCount() ?: return 0.0 + + val masterStars = totalStars - 5 + if (masterStars < 1) return 0.0 var price = 0.0 diff --git a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt index cd0d33f96..8d937956d 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt @@ -35,6 +35,8 @@ object SkyBlockItemModifierUtils { fun ItemStack.getManaDisintegrators() = getAttributeInt("mana_disintegrator_count") + fun ItemStack.getDungeonStarCount() = getAttributeInt("dungeon_item_level") + fun ItemStack.getPetCandyUsed(): Int? { val data = cachedData if (data.petCandies == -1) { @@ -64,24 +66,6 @@ object SkyBlockItemModifierUtils { return 0 } - fun ItemStack.getMasterStars(): Int { - val stars = mapOf( - "➊" to 1, - "➋" to 2, - "➌" to 3, - "➍" to 4, - "➎" to 5, - ) - val itemName = name!! - for ((icon, number) in stars) { - if (itemName.endsWith(icon)) { - return number - } - } - - return 0 - } - fun ItemStack.getDrillUpgrades() = getExtraAttributes()?.let { val list = mutableListOf() for (attributes in it.keySet) { -- cgit