Skip to content

Commit

Permalink
Added "include" parameter to purge tab completion
Browse files Browse the repository at this point in the history
  • Loading branch information
Intelli committed Aug 16, 2024
1 parent 8ab582d commit 64eedb0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/net/coreprotect/command/TabHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ else if (args.length == 2) {
return StringUtil.copyPartialMatches(argument1, completions, new ArrayList<>(completions.size()));
}
else if (argument0.equals("purge") && sender.hasPermission("coreprotect.purge")) {
List<String> completions = new ArrayList<>(Arrays.asList("t:", "r:"));
List<String> completions = new ArrayList<>(Arrays.asList("t:", "r:", "i:"));
return StringUtil.copyPartialMatches(argument1, completions, new ArrayList<>(completions.size()));
}
else if ((sender.hasPermission("coreprotect.lookup") && (argument0.equals("l") || argument0.equals("lookup"))) || (sender.hasPermission("coreprotect.rollback") && (argument0.equals("rollback") || argument0.equals("rb") || argument0.equals("ro"))) || (sender.hasPermission("coreprotect.restore") && (argument0.equals("restore") || argument0.equals("rs") || argument0.equals("re")))) {
Expand All @@ -349,10 +349,10 @@ else if ((sender.hasPermission("coreprotect.lookup") && (argument0.equals("l") |
}
else if (args.length == 3 && argument0.equals("purge") && sender.hasPermission("coreprotect.purge")) {
if (argument1.startsWith("t:")) {
List<String> completions = new ArrayList<>(Arrays.asList("r:"));
List<String> completions = new ArrayList<>(Arrays.asList("r:", "i:"));
return StringUtil.copyPartialMatches(args[2].toLowerCase(Locale.ROOT), completions, new ArrayList<>(completions.size()));
}
else if (argument1.startsWith("r:")) {
else if (argument1.startsWith("r:") || argument1.startsWith("i:")) {
List<String> completions = new ArrayList<>(Arrays.asList("t:"));
return StringUtil.copyPartialMatches(args[2].toLowerCase(Locale.ROOT), completions, new ArrayList<>(completions.size()));
}
Expand Down

0 comments on commit 64eedb0

Please sign in to comment.