From e992f20bb98a4740f9069e931ec8ab4b1b1bce34 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Wed, 11 Oct 2023 10:05:39 +0200 Subject: Fixed int limit in sack api + sack display --- .../java/at/hannibal2/skyhanni/features/inventory/SackDisplay.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features') diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/SackDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/SackDisplay.kt index ad9a963e8..92c60bad5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/SackDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/SackDisplay.kt @@ -37,7 +37,7 @@ object SackDisplay { private fun drawDisplay(savingSacks: Boolean): List> { val newDisplay = mutableListOf>() - var totalPrice = 0 + var totalPrice = 0L var rendered = 0 SackAPI.getSacksData(savingSacks) @@ -83,7 +83,7 @@ object SackDisplay { ) if (colorCode == "§a") add(" §c§l(Full!)") - if (config.showPrice && price != 0) add(" §7(§6${format(price)}§7)") + if (config.showPrice && price != 0L) add(" §7(§6${format(price)}§7)") }) rendered++ } @@ -137,7 +137,7 @@ object SackDisplay { add(" ($rough-§a$flawed-§9$fine-§5$flawless)") val price = (roughprice + flawedprice + fineprice + flawlessprice) totalPrice += price - if (config.showPrice && price != 0) add(" §7(§6${format(price)}§7)") + if (config.showPrice && price != 0L) add(" §7(§6${format(price)}§7)") }) } if (config.showPrice) newDisplay.addAsSingletonList("§eTotal price: §6${format(totalPrice)}") @@ -145,7 +145,7 @@ object SackDisplay { return newDisplay } - private fun format(price: Int) = if (config.priceFormat == 0) NumberUtil.format(price) else price.addSeparators() + private fun format(price: Long) = if (config.priceFormat == 0) NumberUtil.format(price) else price.addSeparators() private fun isEnabled() = LorenzUtils.inSkyBlock && config.enabled -- cgit