From 7970b15d02f5d837bb05241dbb3e581a5492ba03 Mon Sep 17 00:00:00 2001 From: Zrips Date: Thu, 10 Mar 2022 12:44:01 +0200 Subject: [PATCH] Properly performing all commands on each level in any case --- src/main/java/com/gamingmesh/jobs/PlayerManager.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gamingmesh/jobs/PlayerManager.java b/src/main/java/com/gamingmesh/jobs/PlayerManager.java index 0dcb2dcb..26b7602a 100644 --- a/src/main/java/com/gamingmesh/jobs/PlayerManager.java +++ b/src/main/java/com/gamingmesh/jobs/PlayerManager.java @@ -702,7 +702,7 @@ public class PlayerManager { jPlayer.reloadHonorific(); Jobs.getPermissionHandler().recalculatePermissions(jPlayer); - performCommandOnLevelUp(jPlayer, prog, oldLevel); + performCommandOnLevelUp(jPlayer, prog, oldLevel, prog.getLevel()); Jobs.getSignUtil().updateAllSign(job); return; } @@ -848,7 +848,7 @@ public class PlayerManager { jPlayer.reloadHonorific(); Jobs.getPermissionHandler().recalculatePermissions(jPlayer); - performCommandOnLevelUp(jPlayer, prog, oldLevel); + performCommandOnLevelUp(jPlayer, prog, oldLevel, prog.getLevel()); Jobs.getSignUtil().updateAllSign(job); if (player != null && !job.getMaxLevelCommands().isEmpty() && prog.getLevel() == jPlayer.getMaxJobLevelAllowed(prog.getJob())) { @@ -898,6 +898,7 @@ public class PlayerManager { if ((command.getLevelFrom() == 0 && command.getLevelUntil() == 0) || (newLevel >= command.getLevelFrom() && newLevel <= command.getLevelUntil())) { for (String commandString : new ArrayList<>(command.getCommands())) { commandString = commandString.replace("[player]", jPlayer.getName()) + .replace("[playerName]", jPlayer.getName()) .replace("[oldlevel]", Integer.toString(newLevel - 1)) .replace("[newlevel]", Integer.toString(newLevel)) .replace("[jobname]", prog.getJob().getName());