diff options
Diffstat (limited to 'utils')
-rw-r--r-- | utils/nonPooledThread.js | 14 | ||||
-rw-r--r-- | utils/statUtils.js | 18 |
2 files changed, 23 insertions, 9 deletions
diff --git a/utils/nonPooledThread.js b/utils/nonPooledThread.js index 2061db1..4720700 100644 --- a/utils/nonPooledThread.js +++ b/utils/nonPooledThread.js @@ -1,14 +1,14 @@ let Executors = Java.type("java.util.concurrent.Executors") class NonPooledThread { - constructor(fun) { - this.fun = fun - this.executor = Executors.newSingleThreadExecutor() - } + constructor(fun) { + this.fun = fun + this.executor = Executors.newSingleThreadExecutor() + } - start() { - this.executor.execute(this.fun) - } + start() { + this.executor.execute(this.fun) + } } export default NonPooledThread
\ No newline at end of file diff --git a/utils/statUtils.js b/utils/statUtils.js index ae064cf..89b467d 100644 --- a/utils/statUtils.js +++ b/utils/statUtils.js @@ -280,14 +280,28 @@ function getLevelByXp(xp, type, levelCap) { level++ xpCurrent -= 200000000 } - if(level < levelCap){ + if (level < levelCap) { progress = xpCurrent / 200000000 xpForNext = 200000000 - }else{ + } else { progress = 0 xpForNext = NaN } } + if (type === 0 && level === 60 && levelCap === Infinity) { + maxLevel = Infinity + let slope = 600000 + let xpForCurr = 7000000 + slope + while (xpCurrent > xpForCurr) { + level++ + xpCurrent -= xpForCurr + xpForCurr += slope + if (level % 10 === 0) slope *= 2 + } + + progress = xpCurrent / xpForCurr + xpForNext = xpForCurr + } return { xp, level, |