mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-22 17:18:37 +01:00
commit
722181439e
@ -36,6 +36,18 @@ public class Commandexp extends EssentialsCommand {
|
||||
} else {
|
||||
setExp(user.getSource(), user, args[1], true);
|
||||
}
|
||||
} else if (args.length > 1 && args[0].equalsIgnoreCase("take") && user.isAuthorized("essentials.exp.take")) {
|
||||
if (args.length == 3 && user.isAuthorized("essentials.exp.take.others")) {
|
||||
expMatch(server, user.getSource(), args[1], "-" + args[2], true);
|
||||
} else {
|
||||
setExp(user.getSource(), user, "-" + args[1], true);
|
||||
}
|
||||
} else if (args.length < 3 && args[0].equalsIgnoreCase("reset") && user.isAuthorized("essentials.exp.reset")) {
|
||||
if (args.length == 2 && user.isAuthorized("essentials.exp.reset.others")) {
|
||||
expMatch(server, user.getSource(), args[1], "0", false);
|
||||
} else {
|
||||
setExp(user.getSource(), user, "0", false);
|
||||
}
|
||||
} else if (args[0].equalsIgnoreCase("show")) {
|
||||
if (args.length >= 2 && user.isAuthorized("essentials.exp.others")) {
|
||||
String match = args[1].trim();
|
||||
@ -159,6 +171,12 @@ public class Commandexp extends EssentialsCommand {
|
||||
if (user.isAuthorized("essentials.exp.give")) {
|
||||
options.add("give");
|
||||
}
|
||||
if (user.isAuthorized("essentials.exp.take")) {
|
||||
options.add("take");
|
||||
}
|
||||
if (user.isAuthorized("essentials.exp.reset")) {
|
||||
options.add("reset");
|
||||
}
|
||||
return options;
|
||||
} else if (args.length == 2) {
|
||||
if ((args[0].equalsIgnoreCase("set") && user.isAuthorized("essentials.exp.set")) || (args[0].equalsIgnoreCase("give") && user.isAuthorized("essentials.exp.give"))) {
|
||||
@ -184,7 +202,7 @@ public class Commandexp extends EssentialsCommand {
|
||||
protected List<String> getTabCompleteOptions(final Server server, final CommandSource sender, final String commandLabel, final String[] args) {
|
||||
if (args.length == 1) {
|
||||
// TODO: This seems somewhat buggy, both setting and showing - right now, ignoring that
|
||||
return Lists.newArrayList("set", "give", "show");
|
||||
return Lists.newArrayList("set", "give", "show", "take", "reset");
|
||||
} else if (args.length == 2) {
|
||||
if (args[0].equalsIgnoreCase("set") || args[0].equalsIgnoreCase("give")) {
|
||||
String levellessArg = args[1].toLowerCase(Locale.ENGLISH).replace("l", "");
|
||||
|
Loading…
Reference in New Issue
Block a user