Fix multi-alias flag not checking permissions

This commit is contained in:
Frank van der Heijden 2021-07-23 23:27:29 +02:00 committed by Jason
parent d0beddf9eb
commit 87a28b135b

View file

@ -355,6 +355,12 @@ public final class FlagArgument<C> extends CommandArgument<C, Object> {
FailureReason.DUPLICATE_FLAG,
commandContext
));
} else if (!commandContext.hasPermission(flag.getCommandPermission())) {
return ArgumentParseResult.failure(new FlagParseException(
string,
FailureReason.NO_PERMISSION,
commandContext
));
}
parsedFlags.add(flag);
commandContext.flags().addPresenceFlag(flag);