Skip to content

Commit 129b267

Browse files
authored
Merge pull request RobertSkalko#33 from SaloEater/profession-powerleveling-bug
Recalculate xp for each level
2 parents ab947b9 + 74bed64 commit 129b267

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/main/java/com/robertx22/mine_and_slash/saveclasses/prof_tool/ProfessionToolData.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,10 @@ public static boolean isCorrectTool(Profession prof, ItemStack stack) {
8181
}
8282

8383
public void addExp(Player p, ItemStack stack, int added) {
84-
8584
xp += added;
8685

87-
int currentXPNeeded = getExpNeeded();
8886
if (lvl < GameBalanceConfig.get().MAX_LEVEL) {
87+
int currentXPNeeded = getExpNeeded();
8988
while (xp >= currentXPNeeded) {
9089

9190
if (lvl >= GameBalanceConfig.get().MAX_LEVEL) {
@@ -104,6 +103,8 @@ public void addExp(Player p, ItemStack stack, int added) {
104103
addStat();
105104
p.sendSystemMessage(Chats.TOOL_ADD_STAT.locName(stack.getHoverName(), getRarity().locName()).withStyle(getRarity().textFormatting()));
106105
}
106+
107+
currentXPNeeded = getExpNeeded();
107108
}
108109
}
109110
}

0 commit comments

Comments
 (0)