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:
parent
c96b24bb10
commit
e0f8125e97
@ -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");
|
||||||
|
Loading…
Reference in New Issue
Block a user