Check permissions in command suggestions and Dispatcher.

This commit is contained in:
sk89q
2014-06-28 16:57:11 -07:00
parent 205fee3c36
commit 10c45fcb22
6 changed files with 42 additions and 33 deletions

View File

@ -258,7 +258,9 @@ public final class CommandManager {
@Subscribe
public void handleCommandSuggestion(CommandSuggestionEvent event) {
try {
event.setSuggestions(dispatcher.getSuggestions(event.getArguments()));
CommandLocals locals = new CommandLocals();
locals.put(Actor.class, event.getActor());
event.setSuggestions(dispatcher.getSuggestions(event.getArguments(), locals));
} catch (CommandException e) {
event.getActor().printError(e.getMessage());
}