From e0f8125e97ff26185952ff210ecfae6fb1583505 Mon Sep 17 00:00:00 2001 From: FireML <106587317+FireML@users.noreply.github.com> Date: Thu, 21 Mar 2024 11:57:01 +0000 Subject: [PATCH 1/2] Save a player after adjusting job experience --- .../gamingmesh/jobs/commands/list/exp.java | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/exp.java b/src/main/java/com/gamingmesh/jobs/commands/list/exp.java index e6c3cc92..63ec3485 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/exp.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/exp.java @@ -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"); From 36c05eb0b65c85b4e5b79a5698598522b7569644 Mon Sep 17 00:00:00 2001 From: FireML <106587317+FireML@users.noreply.github.com> Date: Thu, 21 Mar 2024 11:57:54 +0000 Subject: [PATCH 2/2] Save a player after adjusting job level --- src/main/java/com/gamingmesh/jobs/commands/list/level.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/level.java b/src/main/java/com/gamingmesh/jobs/commands/list/level.java index f5186f9d..3f033930 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/level.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/level.java @@ -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(),