diff --git a/src/main/java/com/alttd/playerutils/commands/playerutils_subcommands/XPCheque.java b/src/main/java/com/alttd/playerutils/commands/playerutils_subcommands/XPCheque.java index ab6c9e1..1d0b3e8 100644 --- a/src/main/java/com/alttd/playerutils/commands/playerutils_subcommands/XPCheque.java +++ b/src/main/java/com/alttd/playerutils/commands/playerutils_subcommands/XPCheque.java @@ -64,7 +64,7 @@ public class XPCheque extends SubCommand { return true; } - int totalExperience = player.getTotalExperience(); + int totalExperience = player.calculateTotalExperiencePoints(); if (totalExperience < (xpValue * amount)) { commandSender.sendRichMessage(Messages.XP_CHEQUE.NOT_ENOUGH_XP, Placeholder.parsed("xp", String.valueOf(totalExperience))); return true; @@ -139,7 +139,7 @@ public class XPCheque extends SubCommand { } public void decreaseExperience(Player player, int xpToRemove) { - int totalExp = player.getTotalExperience(); + int totalExp = player.calculateTotalExperiencePoints(); int newTotalExp = Math.max(totalExp - xpToRemove, 0); int level = 0; @@ -153,7 +153,7 @@ public class XPCheque extends SubCommand { float progress = (float) newTotalExp / getExpToNext(level); - player.setTotalExperience(totalExp - xpToRemove); + player.setExperienceLevelAndProgress(totalExp - xpToRemove); player.setLevel(level); player.setExp(progress); }