1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-12-30 21:07:48 +01:00

Save a player after adjusting job experience

This commit is contained in:
FireML 2024-03-21 11:57:01 +00:00
parent c96b24bb10
commit e0f8125e97

View File

@ -102,21 +102,24 @@ public class exp implements Cmd {
JobProgression prog = jPlayer.getJobProgression(job); JobProgression prog = jPlayer.getJobProgression(job);
switch (action) { switch (action) {
case Add: case Add:
int oldLevel = prog.getLevel(); int oldLevel = prog.getLevel();
if (prog.addExperience(amount)) if (prog.addExperience(amount))
Jobs.getPlayerManager().performLevelUp(jPlayer, prog.getJob(), oldLevel); Jobs.getPlayerManager().performLevelUp(jPlayer, prog.getJob(), oldLevel);
break; break;
case Set: case Set:
prog.setExperience(amount); prog.setExperience(amount);
break; break;
case Take: case Take:
prog.takeExperience(amount); prog.takeExperience(amount);
break; break;
default: default:
break; break;
} }
jPlayer.setSaved(false);
jPlayer.save(true);
Player player = jPlayer.getPlayer(); Player player = jPlayer.getPlayer();
if (player == null) { if (player == null) {
Language.sendMessage(sender, "general.give.output.notonline"); Language.sendMessage(sender, "general.give.output.notonline");