mirror of
https://github.com/Zrips/Jobs.git
synced 2025-01-16 13:11:19 +01:00
[IMPROVE] Add -sa argument for skip admin success message
This commit is contained in:
parent
3fc3da0659
commit
bdc2f847cb
@ -55,14 +55,14 @@ public class exp implements Cmd {
|
|||||||
double amount = 0.0;
|
double amount = 0.0;
|
||||||
|
|
||||||
/* Add random argument, ex: rand_5-10 */
|
/* Add random argument, ex: rand_5-10 */
|
||||||
if(args[3].startsWith("rand_")){
|
if (args[3].startsWith("rand_")) {
|
||||||
String data= args[3].split("(?i)rand_")[1];
|
String data = args[3].split("(?i)rand_")[1];
|
||||||
String[] arr = data.split("-");
|
String[] arr = data.split("-");
|
||||||
|
|
||||||
int amountMin = Integer.parseInt(arr[0]);
|
int amountMin = Integer.parseInt(arr[0]);
|
||||||
int amountMax = Integer.parseInt(arr[1]);
|
int amountMax = Integer.parseInt(arr[1]);
|
||||||
|
|
||||||
if(amountMin <= amountMax){
|
if (amountMin <= amountMax) {
|
||||||
amount = amountMin + new Random().nextDouble() * (amountMax - amountMin);
|
amount = amountMin + new Random().nextDouble() * (amountMax - amountMin);
|
||||||
} else {
|
} else {
|
||||||
amount = amountMax;
|
amount = amountMax;
|
||||||
@ -100,6 +100,7 @@ public class exp implements Cmd {
|
|||||||
|
|
||||||
Player player = jPlayer.getPlayer();
|
Player player = jPlayer.getPlayer();
|
||||||
boolean isSilent = false;
|
boolean isSilent = false;
|
||||||
|
boolean isSilentAdmin = false;
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
for (String one : args) {
|
for (String one : args) {
|
||||||
if (one.equalsIgnoreCase("-s")) {
|
if (one.equalsIgnoreCase("-s")) {
|
||||||
@ -111,7 +112,15 @@ public class exp implements Cmd {
|
|||||||
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"));
|
for (String one : args) {
|
||||||
|
if (one.equalsIgnoreCase("-sa")) {
|
||||||
|
isSilentAdmin = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!isSilentAdmin) {
|
||||||
|
sender.sendMessage(Jobs.getLanguage().getMessage("general.admin.success"));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
sender.sendMessage(Jobs.getLanguage().getMessage("general.give.output.notonline"));
|
sender.sendMessage(Jobs.getLanguage().getMessage("general.give.output.notonline"));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user