aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/data/SkillExperience.kt
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/data/SkillExperience.kt
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/data/SkillExperience.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/SkillExperience.kt11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/SkillExperience.kt b/src/main/java/at/hannibal2/skyhanni/data/SkillExperience.kt
index 78a44cda3..5a6c7c819 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/SkillExperience.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/SkillExperience.kt
@@ -7,7 +7,7 @@ import at.hannibal2.skyhanni.events.SkillExpGainEvent
import at.hannibal2.skyhanni.utils.ItemUtils.getLore
import at.hannibal2.skyhanni.utils.ItemUtils.name
import at.hannibal2.skyhanni.utils.LorenzUtils
-import at.hannibal2.skyhanni.utils.NumberUtil.formatNumber
+import at.hannibal2.skyhanni.utils.NumberUtil.formatLong
import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimal
import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
import at.hannibal2.skyhanni.utils.StringUtils.removeColor
@@ -40,8 +40,8 @@ class SkillExperience {
actionBarPattern.matchMatcher(event.actionBar) {
val skill = group("skill").lowercase()
- val overflow = group("overflow").formatNumber()
- val neededForNextLevel = group("needed").formatNumber()
+ val overflow = group("overflow").formatLong()
+ val neededForNextLevel = group("needed").formatLong()
val nextLevel = getLevelForExpExactly(neededForNextLevel)
val baseExp = getExpForLevel(nextLevel - 1)
val totalExp = baseExp + overflow
@@ -59,7 +59,7 @@ class SkillExperience {
if (event.inventoryName != "Your Skills") return
for ((_, stack) in event.inventoryItems) {
- val name = stack.name?.removeColor() ?: continue
+ val name = stack.name.removeColor()
if (!name.contains(" ")) continue
val lore = stack.getLore()
@@ -76,8 +76,7 @@ class SkillExperience {
val level = split[1].romanToDecimal()
val baseExp = getExpForLevel(level)
inventoryPattern.matchMatcher(line) {
- val rawNumber = group("number")
- val overflow = rawNumber.formatNumber()
+ val overflow = group("number").formatLong()
val experience = baseExp + overflow
skillExp[skillName] = experience
}