File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
minestom/src/main/java/revxrsal/commands/minestom/hooks Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 3131import net .minestom .server .command .builder .arguments .Argument ;
3232import net .minestom .server .command .builder .arguments .ArgumentLiteral ;
3333import net .minestom .server .command .builder .arguments .ArgumentType ;
34+ import net .minestom .server .command .builder .condition .CommandCondition ;
3435import net .minestom .server .command .builder .exception .ArgumentSyntaxException ;
3536import net .minestom .server .command .builder .suggestion .SuggestionCallback ;
3637import net .minestom .server .command .builder .suggestion .SuggestionEntry ;
@@ -77,6 +78,10 @@ public MinestomCommandHooks(
7778 String name = command .firstNode ().name ();
7879 Command minestomCommand = registeredRootNames .computeIfAbsent (name , k -> {
7980 Command c = new Command (k );
81+ c .setCondition ((sender , cmd ) -> {
82+ A actor = actorFactory .create (sender , command .lamp ());
83+ return command .permission ().isExecutableBy (actor );
84+ });
8085 MinecraftServer .getCommandManager ().register (c );
8186 return c ;
8287 });
You can’t perform that action at this time.
0 commit comments