mirror of
https://github.com/YouHaveTrouble/CommandWhitelist.git
synced 2026-05-12 14:36:56 +00:00
tab completion now fails gracefully if command is not registered (cannot block completions that are not registered)
This commit is contained in:
+4
-2
@@ -22,10 +22,12 @@ public class TabCompleteBlockerListener implements Listener {
|
||||
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user