diff options
| author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-06-14 15:56:08 +0200 |
|---|---|---|
| committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-06-14 15:56:08 +0200 |
| commit | 34e2d19a32f36ddef298668788447aed01c62703 (patch) | |
| tree | 65db564add674443a43bf65e71091e9d965f117a /src/main/java/at/hannibal2/skyhanni/features/mining | |
| parent | a996d8150ef2367e7c839f3565d60bdb68d2125d (diff) | |
| download | skyhanni-34e2d19a32f36ddef298668788447aed01c62703.tar.gz skyhanni-34e2d19a32f36ddef298668788447aed01c62703.tar.bz2 skyhanni-34e2d19a32f36ddef298668788447aed01c62703.zip | |
fixing and using shortFormat()
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/mining')
4 files changed, 16 insertions, 16 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ExcavatorProfitTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ExcavatorProfitTracker.kt index fb6e9054a..4477f509d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ExcavatorProfitTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ExcavatorProfitTracker.kt @@ -13,8 +13,8 @@ import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland import at.hannibal2.skyhanni.utils.NEUInternalName import at.hannibal2.skyhanni.utils.NEUItems.getPrice -import at.hannibal2.skyhanni.utils.NumberUtil import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators +import at.hannibal2.skyhanni.utils.NumberUtil.shortFormat import at.hannibal2.skyhanni.utils.StringUtils import at.hannibal2.skyhanni.utils.renderables.Renderable import at.hannibal2.skyhanni.utils.tracker.ItemTrackerData @@ -105,13 +105,13 @@ object ExcavatorProfitTracker { val fossilDustPrice = pricePer * fossilDustGained addAsSingletonList( Renderable.hoverTips( - "§7${NumberUtil.format(fossilDustGained)}x §fFossil Dust§7: §6${NumberUtil.format(fossilDustPrice)}", + "§7${fossilDustGained.shortFormat()}x §fFossil Dust§7: §6${fossilDustPrice.shortFormat()}", listOf( - "§7You gained §6${NumberUtil.format(fossilDustPrice)} coins §7in total", + "§7You gained §6${fossilDustPrice.shortFormat()} coins §7in total", "§7for all §e$fossilDustGained §fFossil Dust", "§7you have collected.", "", - "§7Price Per Fossil Dust: §6${NumberUtil.format(pricePer)}" + "§7Price Per Fossil Dust: §6${pricePer.shortFormat()}" ) ) ) @@ -142,9 +142,9 @@ object ExcavatorProfitTracker { val name = StringUtils.pluralize(timesExcavated.toInt(), scrapItem.itemName) addAsSingletonList( Renderable.hoverTips( - "$name §7price: §c-${NumberUtil.format(scrapPrice)}", + "$name §7price: §c-${scrapPrice.shortFormat()}", listOf( - "§7You paid §c${NumberUtil.format(scrapPrice)} coins §7in total", + "§7You paid §c${scrapPrice.shortFormat()} coins §7in total", "§7for all §e$timesExcavated $name", "§7you have used." ) diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/GlacitePowderFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/GlacitePowderFeatures.kt index 161330da5..d3c6de977 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/GlacitePowderFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/GlacitePowderFeatures.kt @@ -4,8 +4,8 @@ import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.RenderItemTipEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.ItemUtils.cleanName -import at.hannibal2.skyhanni.utils.NumberUtil import at.hannibal2.skyhanni.utils.NumberUtil.formatLong +import at.hannibal2.skyhanni.utils.NumberUtil.shortFormat import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -27,7 +27,7 @@ object GlacitePowderFeatures { glacitePowderPattern.matchMatcher(event.stack.cleanName()) { val powder = group("amount").formatLong() - event.stackTip = "§b${NumberUtil.format(powder)}" + event.stackTip = "§b${powder.shortFormat()}" } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ProfitPerExcavation.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ProfitPerExcavation.kt index ee2b5fab2..5bdc5388b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ProfitPerExcavation.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ProfitPerExcavation.kt @@ -8,8 +8,8 @@ import at.hannibal2.skyhanni.utils.CollectionUtils.sortedDesc import at.hannibal2.skyhanni.utils.ItemUtils.itemName import at.hannibal2.skyhanni.utils.NEUInternalName import at.hannibal2.skyhanni.utils.NEUItems.getPrice -import at.hannibal2.skyhanni.utils.NumberUtil import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators +import at.hannibal2.skyhanni.utils.NumberUtil.shortFormat import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule @@ -29,7 +29,7 @@ object ProfitPerExcavation { val pricePer = it.getPrice() if (pricePer == -1.0) continue val profit = amount * pricePer - val text = "§eFound $name §8${amount.addSeparators()}x §7(§6${NumberUtil.format(profit)}§7)" + val text = "§eFound $name §8${amount.addSeparators()}x §7(§6${profit.shortFormat()}§7)" map[text] = profit totalProfit += profit } @@ -38,12 +38,12 @@ object ProfitPerExcavation { val scrapItem = FossilExcavatorAPI.scrapItem val scrapPrice = scrapItem.getPrice() - map["${scrapItem.itemName}: §c-${NumberUtil.format(scrapPrice)}"] = -scrapPrice + map["${scrapItem.itemName}: §c-${scrapPrice.shortFormat()}"] = -scrapPrice totalProfit -= scrapPrice val hover = map.sortedDesc().keys.toMutableList() val profitPrefix = if (totalProfit < 0) "§c" else "§6" - val totalMessage = "Profit this excavation: $profitPrefix${NumberUtil.format(totalProfit)}" + val totalMessage = "Profit this excavation: $profitPrefix${totalProfit.shortFormat()}" hover.add("") hover.add("§e$totalMessage") ChatUtils.hoverableChat(totalMessage, hover) diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/mineshaft/MineshaftCorpseProfitPer.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/mineshaft/MineshaftCorpseProfitPer.kt index 73771d354..102391b87 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/mineshaft/MineshaftCorpseProfitPer.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/mineshaft/MineshaftCorpseProfitPer.kt @@ -8,8 +8,8 @@ import at.hannibal2.skyhanni.utils.CollectionUtils.sortedDesc import at.hannibal2.skyhanni.utils.ItemUtils.itemName import at.hannibal2.skyhanni.utils.NEUInternalName import at.hannibal2.skyhanni.utils.NEUItems.getPrice -import at.hannibal2.skyhanni.utils.NumberUtil import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators +import at.hannibal2.skyhanni.utils.NumberUtil.shortFormat import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule @@ -29,7 +29,7 @@ object MineshaftCorpseProfitPer { val pricePer = it.getPrice() if (pricePer == -1.0) continue val profit = amount * pricePer - val text = "§eFound $name §8${amount.addSeparators()}x §7(§6${NumberUtil.format(profit)}§7)" + val text = "§eFound $name §8${amount.addSeparators()}x §7(§6${profit.shortFormat()}§7)" map[text] = profit totalProfit += profit } @@ -42,13 +42,13 @@ object MineshaftCorpseProfitPer { val keyName = it.itemName val price = it.getPrice() - map["$keyName: §c-${NumberUtil.format(price)}"] = -price + map["$keyName: §c-${price.shortFormat()}"] = -price totalProfit -= price } val hover = map.sortedDesc().keys.toMutableList() val profitPrefix = if (totalProfit < 0) "§c" else "§6" - val totalMessage = "Profit for $name Corpse§e: $profitPrefix${NumberUtil.format(totalProfit)}" + val totalMessage = "Profit for $name Corpse§e: $profitPrefix${totalProfit.shortFormat()}" hover.add("") hover.add("§e$totalMessage") ChatUtils.hoverableChat(totalMessage, hover) |
