mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-14 21:22:09 +00:00
New exp calculations.
This commit is contained in:
parent
ab82f550cf
commit
80f001fdb7
1 changed files with 17 additions and 8 deletions
|
@ -46,7 +46,15 @@ public class SetExpFix
|
|||
|
||||
private static int getExpToLevel(final int level)
|
||||
{
|
||||
return 7 + (level * 7 >> 1);
|
||||
if (level >= 30)
|
||||
{
|
||||
return 62 + (level - 30) * 7;
|
||||
}
|
||||
if (level >= 15)
|
||||
{
|
||||
return 17 + (level - 15) * 3;
|
||||
}
|
||||
return 17;
|
||||
}
|
||||
|
||||
//This method is required because the bukkit player.getTotalExperience() method, shows exp that has been 'spent'.
|
||||
|
@ -56,7 +64,8 @@ public class SetExpFix
|
|||
int exp = (int)Math.round(getExpToLevel(player) * player.getExp());
|
||||
int currentLevel = player.getLevel();
|
||||
|
||||
while (currentLevel > 0) {
|
||||
while (currentLevel > 0)
|
||||
{
|
||||
currentLevel--;
|
||||
exp += getExpToLevel(currentLevel);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue