summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/api
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-02-26 16:50:03 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-02-26 16:50:03 +0100
commit3bc84f50fcb86abbe956c9ccbdf52cbdb563af47 (patch)
tree3acbd598220fee7b40894aa664e0993b43e3cdb5 /src/main/java/at/hannibal2/skyhanni/api
parentab737fe92e2631be619c8613da167dd8aab7984b (diff)
downloadskyhanni-3bc84f50fcb86abbe956c9ccbdf52cbdb563af47.tar.gz
skyhanni-3bc84f50fcb86abbe956c9ccbdf52cbdb563af47.tar.bz2
skyhanni-3bc84f50fcb86abbe956c9ccbdf52cbdb563af47.zip
Added String.formatLongOrUserError()
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/api')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/api/SkillAPI.kt8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/api/SkillAPI.kt b/src/main/java/at/hannibal2/skyhanni/api/SkillAPI.kt
index b21c10d41..b4965c3ed 100644
--- a/src/main/java/at/hannibal2/skyhanni/api/SkillAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/api/SkillAPI.kt
@@ -21,7 +21,7 @@ import at.hannibal2.skyhanni.utils.ChatUtils
import at.hannibal2.skyhanni.utils.ItemUtils.cleanName
import at.hannibal2.skyhanni.utils.ItemUtils.getLore
import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators
-import at.hannibal2.skyhanni.utils.NumberUtil.formatLong
+import at.hannibal2.skyhanni.utils.NumberUtil.formatLongOrUserError
import at.hannibal2.skyhanni.utils.NumberUtil.formatNumber
import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNecessary
import at.hannibal2.skyhanni.utils.SimpleTimeMark
@@ -394,11 +394,7 @@ object SkillAPI {
val second = it[1]
when (first) {
"levelwithxp" -> {
- val xp = second.formatLong()
- if (xp == null) {
- ChatUtils.userError("Not a valid number: '$second'")
- return
- }
+ val xp = second.formatLongOrUserError() ?: return
if (xp <= XP_NEEDED_FOR_60) {
val level = getLevel(xp)
ChatUtils.chat("With §b${xp.addSeparators()} §eXP you would be level §b$level")