Display correct error message if a user isn't specified on an inventory rollback
This commit is contained in:
parent
d365eb498b
commit
167b8dfabd
1 changed files with 11 additions and 4 deletions
|
|
@ -178,6 +178,16 @@ public class RollbackRestoreCommand {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (argAction.contains(4) && argAction.contains(11)) { // a:inventory
|
||||||
|
if (argUsers.size() == 0) {
|
||||||
|
Chat.sendMessage(player, Color.DARK_AQUA + "CoreProtect " + Color.WHITE + "- " + Phrase.build(Phrase.MISSING_ACTION_USER));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!argExcludeUsers.contains("#hopper")) {
|
||||||
|
argExcludeUsers.add("#hopper");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (g == 1 && (argUsers.size() > 0 || (argUsers.size() == 0 && argRadius != null))) {
|
if (g == 1 && (argUsers.size() > 0 || (argUsers.size() == 0 && argRadius != null))) {
|
||||||
Integer MAX_RADIUS = Config.getGlobal().MAX_RADIUS;
|
Integer MAX_RADIUS = Config.getGlobal().MAX_RADIUS;
|
||||||
if (argRadius != null) {
|
if (argRadius != null) {
|
||||||
|
|
@ -210,13 +220,10 @@ public class RollbackRestoreCommand {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (argAction.contains(4) && argAction.contains(11) && !argExcludeUsers.contains("#hopper")) { // a:inventory
|
|
||||||
argExcludeUsers.add("#hopper");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (argUsers.size() == 0) {
|
if (argUsers.size() == 0) {
|
||||||
argUsers.add("#global");
|
argUsers.add("#global");
|
||||||
}
|
}
|
||||||
|
|
||||||
List<String> rollbackusers = argUsers;
|
List<String> rollbackusers = argUsers;
|
||||||
int c = 0;
|
int c = 0;
|
||||||
for (String ruser : rollbackusers) {
|
for (String ruser : rollbackusers) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue