mirror of
https://github.com/Zrips/Jobs.git
synced 2024-12-29 04:18:07 +01:00
Save a player after adjusting job experience
This commit is contained in:
parent
c96b24bb10
commit
e0f8125e97
@ -102,21 +102,24 @@ public class exp implements Cmd {
|
||||
JobProgression prog = jPlayer.getJobProgression(job);
|
||||
|
||||
switch (action) {
|
||||
case Add:
|
||||
int oldLevel = prog.getLevel();
|
||||
if (prog.addExperience(amount))
|
||||
Jobs.getPlayerManager().performLevelUp(jPlayer, prog.getJob(), oldLevel);
|
||||
break;
|
||||
case Set:
|
||||
prog.setExperience(amount);
|
||||
break;
|
||||
case Take:
|
||||
prog.takeExperience(amount);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
case Add:
|
||||
int oldLevel = prog.getLevel();
|
||||
if (prog.addExperience(amount))
|
||||
Jobs.getPlayerManager().performLevelUp(jPlayer, prog.getJob(), oldLevel);
|
||||
break;
|
||||
case Set:
|
||||
prog.setExperience(amount);
|
||||
break;
|
||||
case Take:
|
||||
prog.takeExperience(amount);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
jPlayer.setSaved(false);
|
||||
jPlayer.save(true);
|
||||
|
||||
Player player = jPlayer.getPlayer();
|
||||
if (player == null) {
|
||||
Language.sendMessage(sender, "general.give.output.notonline");
|
||||
|
Loading…
Reference in New Issue
Block a user