mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-21 15:41:38 +01:00
Fix syntax condition isn't checked when building the graph
This commit is contained in:
parent
8b789e0f30
commit
ba73c742f4
@ -133,6 +133,12 @@ final class GraphBuilder {
|
||||
|
||||
// Add syntax to the command
|
||||
for (CommandSyntax syntax : command.getSyntaxes()) {
|
||||
if (player != null) {
|
||||
// Check if user can use the syntax
|
||||
final CommandCondition condition = syntax.getCommandCondition();
|
||||
if (condition != null && !condition.canUse(player, null)) continue;
|
||||
}
|
||||
|
||||
boolean executable = false;
|
||||
Node[] lastArgNodes = new Node[] {cmdNode}; // First arg links to cmd root
|
||||
@NotNull Argument<?>[] arguments = syntax.getArguments();
|
||||
|
Loading…
Reference in New Issue
Block a user