1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-01-04 23:37:49 +01:00

[IMPROVE] Add -s argument for /exp command

This commit is contained in:
Teyir 2022-11-28 14:56:29 +01:00
parent 8343995c8f
commit 5a5b82e630

View File

@ -80,12 +80,25 @@ public class exp implements Cmd {
} }
Player player = jPlayer.getPlayer(); Player player = jPlayer.getPlayer();
if (player != null) boolean isSilent = false;
if (player != null) {
for (String one : args) {
if (one.equalsIgnoreCase("-s")) {
isSilent = true;
break;
}
}
if (!isSilent) {
player.sendMessage(Jobs.getLanguage().getMessage("command.exp.output.target", "%jobname%", job.getDisplayName(), "%level%", prog.getLevelFormatted(), "%exp%", prog player.sendMessage(Jobs.getLanguage().getMessage("command.exp.output.target", "%jobname%", job.getDisplayName(), "%level%", prog.getLevelFormatted(), "%exp%", prog
.getExperience())); .getExperience()));
}
sender.sendMessage(Jobs.getLanguage().getMessage("general.admin.success")); sender.sendMessage(Jobs.getLanguage().getMessage("general.admin.success"));
} else } else {
sender.sendMessage(Jobs.getLanguage().getMessage("general.give.output.notonline"));
}
} else {
sender.sendMessage(Jobs.getLanguage().getMessage("command.exp.error.nojob")); sender.sendMessage(Jobs.getLanguage().getMessage("command.exp.error.nojob"));
}
} catch (Exception e) { } catch (Exception e) {
sender.sendMessage(Jobs.getLanguage().getMessage("general.admin.error")); sender.sendMessage(Jobs.getLanguage().getMessage("general.admin.error"));
} }