1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-12-29 04:18:07 +01:00

Merge pull request #1723 from FireML/player-saving

Save players after adjusting job progression via commands
This commit is contained in:
Zrips 2024-04-15 12:41:53 +03:00 committed by GitHub
commit 85a052f855
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 19 additions and 13 deletions

View File

@ -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");

View File

@ -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(),