Skip to content

Commit

Permalink
More readme
Browse files Browse the repository at this point in the history
  • Loading branch information
TBlueF committed Sep 3, 2023
1 parent 7a9093a commit dc1dde0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,14 @@ commandFactory.setAnnotationContextPredicate(Permission.class, (permission, comm
return commandSender.hasPermission(permission.value());
});
```
When the annotation is present, the command will now only be available if the registered predicate returns `true`.

### Merging commands
You can merge multiple commands into one. E.g. if you have multiple objects that hold command-methods:
```java
BlueCommands<CommandSender> commandFactory = new BlueCommands<>();
Command<CommandSender, Object> root = new Command<>();
root.tryMerge(commandFactory.createCommand(object1));
root.tryMerge(commandFactory.createCommand(object2));
root.tryMerge(commandFactory.createCommand(object3));
```

0 comments on commit dc1dde0

Please sign in to comment.