mirror of
https://github.com/Zrips/Jobs.git
synced 2024-12-30 21:07:48 +01:00
Merge pull request #1723 from FireML/player-saving
Save players after adjusting job progression via commands
This commit is contained in:
commit
85a052f855
@ -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");
|
||||
|
@ -110,6 +110,9 @@ public class level implements Cmd {
|
||||
break;
|
||||
}
|
||||
|
||||
jPlayer.setSaved(false);
|
||||
jPlayer.save(true);
|
||||
|
||||
Player player = jPlayer.getPlayer();
|
||||
if (player != null)
|
||||
Language.sendMessage(player, "command.level.output.target", "%jobname%", job.getDisplayName(), "%level%", prog.getLevel(),
|
||||
|
Loading…
Reference in New Issue
Block a user