aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/minion
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal002@users.noreply.github.com>2024-03-06 23:51:02 +0100
committerGitHub <noreply@github.com>2024-03-06 23:51:02 +0100
commit0a95a791eb57a546fb5421594abae740faf1dfdb (patch)
tree82bfc13c544a60d496bab081b66ddd73e07d62a3 /src/main/java/at/hannibal2/skyhanni/features/minion
parent28430fe85115334fb06fb7e3cc36da819f08dace (diff)
downloadskyhanni-0a95a791eb57a546fb5421594abae740faf1dfdb.tar.gz
skyhanni-0a95a791eb57a546fb5421594abae740faf1dfdb.tar.bz2
skyhanni-0a95a791eb57a546fb5421594abae740faf1dfdb.zip
Internal Changes: Many small code cleanups (#1101)
Co-authored-by: Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com> Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/minion')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt
index 5f623359e..b908acefc 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt
@@ -29,9 +29,10 @@ import at.hannibal2.skyhanni.utils.ItemUtils.name
import at.hannibal2.skyhanni.utils.LocationUtils
import at.hannibal2.skyhanni.utils.LocationUtils.canBeSeen
import at.hannibal2.skyhanni.utils.LorenzUtils
-import at.hannibal2.skyhanni.utils.LorenzUtils.formatInteger
import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland
import at.hannibal2.skyhanni.utils.LorenzVec
+import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators
+import at.hannibal2.skyhanni.utils.NumberUtil.formatDouble
import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimal
import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNecessary
import at.hannibal2.skyhanni.utils.RenderUtils.drawString
@@ -251,13 +252,13 @@ class MinionFeatures {
} ?: return "§cCan't calculate coins/day: No time data available!"
//§7Held Coins: §b151,389
- val coins = line.split(": §b")[1].replace(",", "").toDouble()
+ // TODO use regex
+ val coins = line.split(": §b")[1].formatDouble()
val coinsPerDay = (coins / (duration.toDouble())) * 1000 * 60 * 60 * 24
- val format = formatInteger(coinsPerDay.toInt())
- val hopperName = stack.name
- return "§7Coins/day with $hopperName§7: §6$format coins"
+ val format = coinsPerDay.toInt().addSeparators()
+ return "§7Coins/day with ${stack.name}§7: §6$format coins"
}
@SubscribeEvent