1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-12-30 21:07:48 +01:00

Properly performing all commands on each level in any case

This commit is contained in:
Zrips 2022-03-10 12:44:01 +02:00
parent f119c1fa29
commit 7970b15d02

View File

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