diff options
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt | 7 |
1 files changed, 4 insertions, 3 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 6300b0cfd..b92bc8f0a 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 @@ -249,7 +249,7 @@ object EstimatedItemValue { if (price != null) { list.add( "§7Attribute §9${ - attributes[0].first.split("_").joinToString(" ") { it.firstLetterUppercase() } + attributes[0].first.fixMending().split("_").joinToString(" ") { it.firstLetterUppercase() } } ${attributes[0].second}§7: (§6${NumberUtil.format(price)}§7)" ) return price @@ -272,8 +272,7 @@ object EstimatedItemValue { if (price != null) { subTotal += price } - var displayName = attr.first - if (displayName == ("MENDING")) displayName = "VITALITY" + val displayName = attr.first.fixMending() list.add( " §9${ displayName.split("_").joinToString(" ") { it.firstLetterUppercase() } @@ -283,6 +282,8 @@ object EstimatedItemValue { return subTotal } + private fun String.fixMending() = if (this == "MENDING") "VITALITY" else this + private fun getPriceOrCompositePriceForAttribute(attributeName: String, level: Int): Double? { return (1..10).mapNotNull { lowerLevel -> "$attributeName;$lowerLevel".asInternalName().getPriceOrNull() |