Skip to content

Commit

Permalink
tab completion now fails gracefully if command is not registered (can…
Browse files Browse the repository at this point in the history
…not block completions that are not registered)
  • Loading branch information
YouHaveTrouble committed Dec 6, 2020
1 parent b9db852 commit 9254c7f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>eu.endermite</groupId>
<artifactId>CommandWhitelist</artifactId>
<version>1.5.1</version>
<version>1.5.2</version>
<packaging>jar</packaging>

<name>CommandWhitelist</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ public void onCommandTabComplete(org.bukkit.event.server.TabCompleteEvent event)
String slast = CommandsList.getLastArgument(s);
String scommand = s.replace(slast, "");
cmd = cmd.replace(CommandsList.getLastArgument(cmd), "");
if (cmd.startsWith("/"+scommand+" ")) {
if (cmd.startsWith("/" + scommand + " ")) {
continue;
}
suggestions.remove(slast);
try {
suggestions.remove(slast);
} catch (Exception ignored) {}
}
event.setCompletions(suggestions);
}
Expand Down

0 comments on commit 9254c7f

Please sign in to comment.