aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-06-16 00:19:38 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-06-16 00:19:38 +0200
commitfcf5982771458ff8fb093e696a4666a75e2f304c (patch)
treec4c33f2319ff86b70aa6faa8a00588843664c1f1
parentc17608bb10bf767dee6978edb5a06a665f6a414c (diff)
downloadskyhanni-fcf5982771458ff8fb093e696a4666a75e2f304c.tar.gz
skyhanni-fcf5982771458ff8fb093e696a4666a75e2f304c.tar.bz2
skyhanni-fcf5982771458ff8fb093e696a4666a75e2f304c.zip
Fixed dungeon stars in estimated item value working with skytils correctly
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt20
2 files changed, 7 insertions, 21 deletions
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<String>): 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<String>()
for (attributes in it.keySet) {