aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/mining
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-06-14 13:36:06 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-06-14 13:36:06 +0200
commit9f55fd15544e187491d78e2c5ecf2f2ed8ac76f1 (patch)
tree3db7b5a80d23714519ae45b8b5ee16e7c11f0da6 /src/main/java/at/hannibal2/skyhanni/features/mining
parent2f285d2944a00dfd2dab9bca8da2055a1506193e (diff)
downloadskyhanni-9f55fd15544e187491d78e2c5ecf2f2ed8ac76f1.tar.gz
skyhanni-9f55fd15544e187491d78e2c5ecf2f2ed8ac76f1.tar.bz2
skyhanni-9f55fd15544e187491d78e2c5ecf2f2ed8ac76f1.zip
creating and using Number.format()
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/mining')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ExcavatorProfitTracker.kt12
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/GlacitePowderFeatures.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ProfitPerExcavation.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/mining/mineshaft/MineshaftCorpseProfitPer.kt8
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..358f79efa 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.format
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.format()}x §fFossil Dust§7: §6${fossilDustPrice.format()}",
listOf(
- "§7You gained §6${NumberUtil.format(fossilDustPrice)} coins §7in total",
+ "§7You gained §6${fossilDustPrice.format()} 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.format()}"
)
)
)
@@ -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.format()}",
listOf(
- "§7You paid §c${NumberUtil.format(scrapPrice)} coins §7in total",
+ "§7You paid §c${scrapPrice.format()} 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..2884ffb98 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,7 +4,7 @@ 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.format
import at.hannibal2.skyhanni.utils.NumberUtil.formatLong
import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher
import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern
@@ -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.format()}"
}
}
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..4ad79da5c 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.format
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.format()}§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.format()}"] = -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.format()}"
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..417a531c0 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.format
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.format()}§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.format()}"] = -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.format()}"
hover.add("")
hover.add("§e$totalMessage")
ChatUtils.hoverableChat(totalMessage, hover)