Skip to content

Commit

Permalink
Fix for Mithion#1218
Browse files Browse the repository at this point in the history
  • Loading branch information
DoomFruit committed Sep 12, 2015
1 parent 171c347 commit deed98e
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/main/java/am2/utility/EntityUtilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -342,13 +342,7 @@ public static void deductXP(int amount, EntityPlayer player){
// the problem with the enchanting table is that it directly "adds" experience levels
// doing it like this does not update experienceTotal
// we therefore need to go and calculate an effective total ourselves
int effectiveTotal = 0;
for(int i = 0; i < player.experienceLevel; i++){
effectiveTotal += xpBarCap(i);
}
effectiveTotal += (int)(player.experience * xpBarCap(player.experienceLevel));

int newTotal = effectiveTotal - amount;
int newTotal = getXPFromLevel(player.experienceLevel) - amount;
if (newTotal < 0)
newTotal = 0;

Expand Down

0 comments on commit deed98e

Please sign in to comment.