aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/garden
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/garden
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/garden')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/AnitaMedalProfit.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterInventoryNumbers.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt12
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/composter/GardenComposterInventoryFeatures.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/UpgradePage.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/inventory/AnitaExtraFarmingFortune.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenCropMilestoneInventory.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/inventory/SkyMartCopperPrice.kt10
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/inventory/plots/GardenNextPlotPrice.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestParticleLine.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestProfitTracker.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt12
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorRewardWarning.kt6
16 files changed, 49 insertions, 45 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/AnitaMedalProfit.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/AnitaMedalProfit.kt
index 191dc125a..90c413576 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/AnitaMedalProfit.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/AnitaMedalProfit.kt
@@ -20,7 +20,7 @@ import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.NEUInternalName
import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName
import at.hannibal2.skyhanni.utils.NEUItems.getPrice
-import at.hannibal2.skyhanni.utils.NumberUtil
+import at.hannibal2.skyhanni.utils.NumberUtil.format
import at.hannibal2.skyhanni.utils.RenderUtils.renderRenderables
import at.hannibal2.skyhanni.utils.renderables.Renderable
import net.minecraft.item.ItemStack
@@ -97,15 +97,15 @@ object AnitaMedalProfit {
if (itemPrice < 0) return
val profit = itemPrice - fullCost
- val profitFormat = NumberUtil.format(profit)
+ val profitFormat = profit.format()
val color = if (profit > 0) "§6" else "§c"
val hover = listOf(
itemName,
"",
- "§7Item price: §6${NumberUtil.format(itemPrice)} ",
+ "§7Item price: §6${itemPrice.format()} ",
// TODO add more exact material cost breakdown
- "§7Material cost: §6${NumberUtil.format(fullCost)} ",
+ "§7Material cost: §6${fullCost.format()} ",
"§7Final profit: §6${profitFormat} ",
)
table.add(
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt
index 1067312de..ec4c42119 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt
@@ -173,7 +173,7 @@ object GardenLevelDisplay {
if (next && line.contains(" ")) {
val progress = overflow / needForOnlyNextLvl
val progressBar = StringUtils.progressBar(progress, 20)
- iterator.set("$progressBar §e${overflow.addSeparators()}§6/§e${format(needForOnlyNextLvl)}")
+ iterator.set("$progressBar §e${overflow.addSeparators()}§6/§e${needForOnlyNextLvl.format()}")
iterator.add("")
iterator.add("§b§lOVERFLOW XP:")
iterator.add("§7▸ ${overflowTotal.addSeparators()}")
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterInventoryNumbers.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterInventoryNumbers.kt
index 352c7137e..0d63b579b 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterInventoryNumbers.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterInventoryNumbers.kt
@@ -5,8 +5,8 @@ import at.hannibal2.skyhanni.events.RenderInventoryItemTipEvent
import at.hannibal2.skyhanni.features.garden.GardenAPI
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.utils.ItemUtils.getLore
-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.NumberUtil.formatInt
import at.hannibal2.skyhanni.utils.RegexUtils.matchFirst
import at.hannibal2.skyhanni.utils.StringUtils.removeColor
@@ -52,7 +52,7 @@ object ComposterInventoryNumbers {
if (slotNumber == 46 || slotNumber == 52) {
stack.getLore().matchFirst(valuePattern) {
val having = group("having").removeColor().formatInt()
- val havingFormat = NumberUtil.format(having)
+ val havingFormat = having.format()
val total = group("total").removeColor()
val color = if (slotNumber == 46) {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt
index b198b3e3a..f9fd08f1f 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt
@@ -38,8 +38,8 @@ import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName
import at.hannibal2.skyhanni.utils.NEUItems
import at.hannibal2.skyhanni.utils.NEUItems.getItemStack
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.NumberUtil.romanToDecimalIfNecessary
import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher
import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems
@@ -369,9 +369,9 @@ object ComposterOverlay {
val totalCostPreview = (fuelPricePerPreview + organicMatterPricePerPreview) * timeMultiplierPreview
val materialCostFormatPreview =
- if (totalCost != totalCostPreview) " §c➜ §6" + NumberUtil.format(totalCostPreview) else ""
+ if (totalCost != totalCostPreview) " §c➜ §6" + totalCostPreview.format() else ""
val materialCostFormat =
- " §7Material costs per $timeText: §6${NumberUtil.format(totalCost)}$materialCostFormatPreview"
+ " §7Material costs per $timeText: §6${totalCost.format()}$materialCostFormatPreview"
newList.addAsSingletonList(materialCostFormat)
val priceCompost = COMPOST.getPrice()
@@ -379,8 +379,8 @@ object ComposterOverlay {
val profitPreview =
((priceCompost * multiDropFactorPreview) - (fuelPricePerPreview + organicMatterPricePerPreview)) * timeMultiplierPreview
- val profitFormatPreview = if (profit != profitPreview) " §c➜ §6" + NumberUtil.format(profitPreview) else ""
- val profitFormat = " §7Profit per $timeText: §6${NumberUtil.format(profit)}$profitFormatPreview"
+ val profitFormatPreview = if (profit != profitPreview) " §c➜ §6" + profitPreview.format() else ""
+ val profitFormat = " §7Profit per $timeText: §6${profit.format()}$profitFormatPreview"
newList.addAsSingletonList(profitFormat)
newList.addAsSingletonList("")
@@ -465,7 +465,7 @@ object ComposterOverlay {
itemsNeeded: Double,
onClick: (NEUInternalName) -> Unit,
) {
- val format = NumberUtil.format(totalPrice)
+ val format = totalPrice.format()
val selected = if (internalName == currentOrganicMatterItem || internalName == currentFuelItem) "§n" else ""
val rawItemName = itemName.removeColor()
val name = itemName.substring(0, 2) + selected + rawItemName
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/GardenComposterInventoryFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/GardenComposterInventoryFeatures.kt
index 99fb3f147..d48ffb1dc 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/GardenComposterInventoryFeatures.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/GardenComposterInventoryFeatures.kt
@@ -14,7 +14,7 @@ import at.hannibal2.skyhanni.utils.LorenzColor
import at.hannibal2.skyhanni.utils.LorenzUtils
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.format
import at.hannibal2.skyhanni.utils.RenderUtils.highlight
import net.minecraft.client.gui.inventory.GuiChest
import net.minecraft.inventory.ContainerChest
@@ -68,14 +68,14 @@ object GardenComposterInventoryFeatures {
val lowestBin = internalName.getPrice()
val price = lowestBin * amount
fullPrice += price
- val format = NumberUtil.format(price)
+ val format = price.format()
list[i] = list[i] + " §7(§6$format§7)"
amountItems++
}
}
if (amountItems > 1) {
- val format = NumberUtil.format(fullPrice)
+ val format = fullPrice.format()
list[indexFullCost] = list[indexFullCost] + " §7(§6$format§7)"
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt
index b149dedad..cc9ca42ef 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt
@@ -34,8 +34,8 @@ import at.hannibal2.skyhanni.utils.NEUItems.getItemStack
import at.hannibal2.skyhanni.utils.NEUItems.getNpcPrice
import at.hannibal2.skyhanni.utils.NEUItems.getNpcPriceOrNull
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.RenderUtils.renderStringsAndItems
import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getReforgeName
import kotlinx.coroutines.launch
@@ -281,7 +281,7 @@ object CropMoneyDisplay {
}
private fun format(moneyPerHour: Double) = if (config.compactPrice) {
- NumberUtil.format(moneyPerHour)
+ moneyPerHour.format()
} else {
moneyPerHour.toLong().addSeparators()
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/UpgradePage.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/UpgradePage.kt
index 2323b5e30..0c0990ced 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/UpgradePage.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/UpgradePage.kt
@@ -6,7 +6,7 @@ import at.hannibal2.skyhanni.features.garden.fortuneguide.FortuneUpgrade
import at.hannibal2.skyhanni.features.garden.fortuneguide.FortuneUpgrades
import at.hannibal2.skyhanni.utils.ItemUtils.itemName
import at.hannibal2.skyhanni.utils.NEUItems.getItemStack
-import at.hannibal2.skyhanni.utils.NumberUtil
+import at.hannibal2.skyhanni.utils.NumberUtil.format
import at.hannibal2.skyhanni.utils.RenderUtils.HorizontalAlignment
import at.hannibal2.skyhanni.utils.RenderUtils.VerticalAlignment
import at.hannibal2.skyhanni.utils.guide.GuideScrollPage
@@ -86,14 +86,14 @@ class UpgradePage(val crop0: () -> CropType?, sizeX: Int, sizeY: Int, paddingX:
) // TODO cleaner formating
add(
Renderable.string(
- "§6" + costPerFF?.let { NumberUtil.format(it) },
+ "§6" + costPerFF?.let { it.format() },
horizontalAlign = HorizontalAlignment.CENTER,
verticalAlign = VerticalAlignment.CENTER
)
)
add(
Renderable.string(
- "§6" + cost?.let { NumberUtil.format(it) },
+ "§6" + cost?.let { it.format() },
horizontalAlign = HorizontalAlignment.CENTER,
verticalAlign = VerticalAlignment.CENTER
)
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/AnitaExtraFarmingFortune.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/AnitaExtraFarmingFortune.kt
index 42b8b5d35..fec669858 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/AnitaExtraFarmingFortune.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/AnitaExtraFarmingFortune.kt
@@ -11,8 +11,8 @@ import at.hannibal2.skyhanni.utils.CollectionUtils.indexOfFirst
import at.hannibal2.skyhanni.utils.InventoryUtils
import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName
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.NumberUtil.formatDouble
import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher
import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern
@@ -64,7 +64,7 @@ object AnitaExtraFarmingFortune {
// TODO: maybe only show the price when playing classic
// if (!LorenzUtils.noTradeMode) {
val price = jacobTickets * "JACOBS_TICKET".asInternalName().getPrice()
- event.toolTip.add(index, " §7Price: §6${NumberUtil.format(price)} coins")
+ event.toolTip.add(index, " §7Price: §6${price.format()} coins")
// }
event.toolTip.add(index, "§aJacob Tickets §8x${jacobTickets.addSeparators()}")
event.toolTip.add(index, "§6Gold medals: §8x$goldMedals")
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenCropMilestoneInventory.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenCropMilestoneInventory.kt
index c9759cd58..38d24d967 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenCropMilestoneInventory.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenCropMilestoneInventory.kt
@@ -13,8 +13,8 @@ import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.utils.CollectionUtils.indexOfFirst
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.LorenzUtils.round
-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 net.minecraftforge.fml.common.eventhandler.SubscribeEvent
@@ -77,7 +77,7 @@ object GardenCropMilestoneInventory {
event.toolTip.add(index, " ")
val progressBar = StringUtils.progressBar(percentage, 19)
- event.toolTip.add(index, "$progressBar §e${counter.addSeparators()}§6/§e${NumberUtil.format(maxCounter)}")
+ event.toolTip.add(index, "$progressBar §e${counter.addSeparators()}§6/§e${maxCounter.format()}")
event.toolTip.add(index, "§7Progress to Tier $maxTier: §e$percentageFormat")
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/SkyMartCopperPrice.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/SkyMartCopperPrice.kt
index 625216f85..d18746e67 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/SkyMartCopperPrice.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/SkyMartCopperPrice.kt
@@ -16,8 +16,8 @@ import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.LorenzUtils.round
import at.hannibal2.skyhanni.utils.NEUItems.getPrice
import at.hannibal2.skyhanni.utils.NEUItems.getPriceOrNull
-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.NumberUtil.formatInt
import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher
import at.hannibal2.skyhanni.utils.RenderUtils.renderRenderables
@@ -61,17 +61,17 @@ object SkyMartCopperPrice {
val profit = itemPrice - (otherItemsPrice ?: 0.0)
val factor = profit / copper
- val perFormat = NumberUtil.format(factor)
+ val perFormat = factor.format()
val itemName = item.itemName
val hover = buildList {
add(itemName)
add("")
- add("§7Item price: §6${NumberUtil.format(itemPrice)} ")
+ add("§7Item price: §6${itemPrice.format()} ")
otherItemsPrice?.let {
- add("§7Additional cost: §6${NumberUtil.format(it)} ")
+ add("§7Additional cost: §6${it.format()} ")
}
- add("§7Profit per purchase: §6${NumberUtil.format(profit)} ")
+ add("§7Profit per purchase: §6${profit.format()} ")
add("")
add("§7Copper amount: §c${copper.addSeparators()} ")
add("§7Profit per copper: §6${perFormat} ")
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/plots/GardenNextPlotPrice.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/plots/GardenNextPlotPrice.kt
index 157f05c30..c809541ee 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/plots/GardenNextPlotPrice.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/plots/GardenNextPlotPrice.kt
@@ -9,7 +9,7 @@ import at.hannibal2.skyhanni.utils.ItemUtils
import at.hannibal2.skyhanni.utils.ItemUtils.name
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.format
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
@SkyHanniModule
@@ -40,7 +40,7 @@ object GardenNextPlotPrice {
val (itemName, amount) = it
val lowestBin = NEUInternalName.fromItemName(itemName).getPrice()
val price = lowestBin * amount
- val format = NumberUtil.format(price)
+ val format = price.format()
list[i] = list[i] + " §7(§6$format§7)"
} ?: run {
ErrorManager.logErrorStateWithData(
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestParticleLine.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestParticleLine.kt
index e81486ecd..f2aabc22b 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestParticleLine.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestParticleLine.kt
@@ -7,6 +7,8 @@ import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent
import at.hannibal2.skyhanni.events.ReceiveParticleEvent
import at.hannibal2.skyhanni.features.garden.GardenAPI
import at.hannibal2.skyhanni.features.garden.GardenPlotAPI
+import at.hannibal2.skyhanni.features.garden.GardenPlotAPI.isBarn
+import at.hannibal2.skyhanni.features.gui.customscoreboard.CustomScoreboardUtils.formatNum
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.utils.DelayedRun
import at.hannibal2.skyhanni.utils.LocationUtils
@@ -96,6 +98,7 @@ object PestParticleLine {
private fun showMiddle(event: LorenzRenderWorldEvent) {
if (locations.size <= 0) return
val plot = GardenPlotAPI.getCurrentPlot() ?: return
+ if (plot.isBarn()) return
val middle = plot.middle.copy(y = LocationUtils.playerLocation().y)
if (middle.distanceToPlayer() > 15) return
@@ -104,6 +107,7 @@ object PestParticleLine {
}
private fun draw(event: LorenzRenderWorldEvent, list: List<ParticleLocation>) {
+ 3.formatNum()
val color = LorenzColor.YELLOW.toColor()
for ((prev, next) in list.asSequence().zipWithNext()) {
// TODO time in config
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestProfitTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestProfitTracker.kt
index 62ddfb5f8..fc45950c7 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestProfitTracker.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestProfitTracker.kt
@@ -12,8 +12,8 @@ import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.utils.CollectionUtils.addAsSingletonList
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.NEUInternalName
-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.RegexUtils.matchMatcher
import at.hannibal2.skyhanni.utils.SimpleTimeMark
import at.hannibal2.skyhanni.utils.renderables.Renderable
@@ -63,7 +63,7 @@ object PestProfitTracker {
override fun getCoinName(item: TrackedItem) = "§6Pest Kill Coins"
override fun getCoinDescription(item: TrackedItem): List<String> {
- val pestsCoinsFormat = NumberUtil.format(item.totalAmount)
+ val pestsCoinsFormat = item.totalAmount.format()
return listOf(
"§7Killing pests gives you coins.",
"§7You got §6$pestsCoinsFormat coins §7that way."
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt
index bd344bb51..af3582630 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt
@@ -19,8 +19,8 @@ import at.hannibal2.skyhanni.utils.CollectionUtils.addOrPut
import at.hannibal2.skyhanni.utils.CollectionUtils.editCopy
import at.hannibal2.skyhanni.utils.ConfigUtils
import at.hannibal2.skyhanni.utils.LorenzUtils
-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.NumberUtil.formatInt
import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher
import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems
@@ -224,7 +224,7 @@ object GardenVisitorDropStatistics {
fun format(amount: Number): String {
if (amount is Int) return amount.addSeparators()
- if (amount is Long) return NumberUtil.format(amount)
+ if (amount is Long) return amount.format()
return "$amount"
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt
index 98230dfcf..eb4fd7bc0 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt
@@ -47,8 +47,8 @@ import at.hannibal2.skyhanni.utils.NEUItems
import at.hannibal2.skyhanni.utils.NEUItems.allIngredients
import at.hannibal2.skyhanni.utils.NEUItems.getItemStack
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.NumberUtil.formatInt
import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher
import at.hannibal2.skyhanni.utils.RenderUtils.drawString
@@ -204,7 +204,7 @@ object GardenVisitorFeatures {
if (config.shoppingList.showPrice) {
val price = internalName.getPrice() * amount
totalPrice += price
- val format = NumberUtil.format(price)
+ val format = price.format()
list.add(" §7(§6$format§7)")
}
@@ -213,7 +213,7 @@ object GardenVisitorFeatures {
add(list)
}
if (totalPrice > 0) {
- val format = NumberUtil.format(totalPrice)
+ val format = totalPrice.format()
this[0] = listOf("§7Visitor Shopping List: §7(§6$format§7)")
}
}
@@ -401,14 +401,14 @@ object GardenVisitorFeatures {
if (config.inventory.experiencePrice) {
gardenExperiencePattern.matchMatcher(formattedLine) {
val gardenExp = group("amount").formatInt()
- val pricePerCopper = NumberUtil.format((totalPrice / gardenExp).toInt())
+ val pricePerCopper = (totalPrice / gardenExp).toInt().format()
finalList.set(index, "$formattedLine §7(§6$pricePerCopper §7per)")
}
}
copperPattern.matchMatcher(formattedLine) {
val copper = group("amount").formatInt()
- val pricePerCopper = NumberUtil.format((totalPrice / copper).toInt())
+ val pricePerCopper = (totalPrice / copper).toInt().format()
visitor.pricePerCopper = (totalPrice / copper).toInt()
visitor.totalPrice = totalPrice
// Estimate could be changed to most value per copper item, instead of green thumb
@@ -434,7 +434,7 @@ object GardenVisitorFeatures {
val price = internalName.getPrice() * amount
if (config.inventory.showPrice) {
- val format = NumberUtil.format(price)
+ val format = price.format()
finalList[index] = "$formattedLine §7(§6$format§7)"
}
if (!readingShoppingList) continue
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorRewardWarning.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorRewardWarning.kt
index 05041df18..848e38799 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorRewardWarning.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorRewardWarning.kt
@@ -14,7 +14,7 @@ import at.hannibal2.skyhanni.utils.ItemUtils.name
import at.hannibal2.skyhanni.utils.KeyboardManager
import at.hannibal2.skyhanni.utils.KeyboardManager.isKeyHeld
import at.hannibal2.skyhanni.utils.LorenzColor
-import at.hannibal2.skyhanni.utils.NumberUtil
+import at.hannibal2.skyhanni.utils.NumberUtil.format
import at.hannibal2.skyhanni.utils.RenderUtils.drawBorder
import at.hannibal2.skyhanni.utils.RenderUtils.highlight
import at.hannibal2.skyhanni.utils.StringUtils.removeColor
@@ -124,10 +124,10 @@ object VisitorRewardWarning {
}
blockedToolTip.add("")
- val pricePerCopper = visitor.pricePerCopper?.let { NumberUtil.format(it) }
+ val pricePerCopper = visitor.pricePerCopper?.let { it.format() }
// TODO remove !! - best by creating new class LoadedVisitor without any nullable objects
val loss = visitor.totalPrice!! - visitor.totalReward!!
- val formattedLoss = NumberUtil.format(loss.absoluteValue)
+ val formattedLoss = loss.absoluteValue.format()
blockedToolTip.add(blockDescription(blockReason, pricePerCopper, loss, formattedLoss))
blockedToolTip.add(" §7(Bypass by holding ${KeyboardManager.getKeyName(config.bypassKey)})")