Skip to content

Commit

Permalink
Misc Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Direwolf20-MC committed Sep 13, 2024
1 parent 337ae98 commit 47fba89
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,13 @@ public void storeExp(Player player, int levelChange) {
int expRemoved = ExperienceUtils.removePoints(player, expInCurrentLevel);
this.exp += expRemoved;
levelChange--; // We've already removed part of a level
if (player.experienceProgress > 0.0f && player.experienceProgress < 0.01f)
player.experienceProgress = 0f;
player.experienceProgress = 0f; //Clear the player's partial exp, to handle super low floating point values
}

if (levelChange > 0) {
// Now remove the specified number of full levels
int expRemoved = ExperienceUtils.removeLevels(player, levelChange);
this.exp += expRemoved;
if (player.experienceProgress > 0.0f && player.experienceProgress < 0.01f)
player.experienceProgress = 0f;
}
}

Expand Down

0 comments on commit 47fba89

Please sign in to comment.