🐛 Fix optionals not being brig executors
This commit is contained in:
parent
c9d4f39612
commit
c74ac64e5f
2 changed files with 6 additions and 0 deletions
|
|
@ -25,6 +25,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
### Changed
|
### Changed
|
||||||
- Allow for combined presence flags, such that `-a -b -c` is equivalent to `-abc`
|
- Allow for combined presence flags, such that `-a -b -c` is equivalent to `-abc`
|
||||||
- Allow for class annotations as a default for when an annotation is not present on a method.
|
- Allow for class annotations as a default for when an annotation is not present on a method.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fix arguments with no required children not being executors (cloud-brigadier)
|
||||||
|
|
||||||
## [1.0.2] - 2020-10-18
|
## [1.0.2] - 2020-10-18
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -427,6 +427,9 @@ public final class CloudBrigadierManager<C, S> {
|
||||||
if (forceExecutor || root.isLeaf() || !root.getValue().isRequired()) {
|
if (forceExecutor || root.isLeaf() || !root.getValue().isRequired()) {
|
||||||
argumentBuilder.executes(executor);
|
argumentBuilder.executes(executor);
|
||||||
}
|
}
|
||||||
|
if (root.getChildren().stream().noneMatch(node -> node.getValue().isRequired())) {
|
||||||
|
argumentBuilder.executes(executor);
|
||||||
|
}
|
||||||
for (final CommandTree.Node<CommandArgument<C, ?>> node : root.getChildren()) {
|
for (final CommandTree.Node<CommandArgument<C, ?>> node : root.getChildren()) {
|
||||||
argumentBuilder.then(constructCommandNode(forceExecutor, node, permissionChecker, executor, suggestionProvider));
|
argumentBuilder.then(constructCommandNode(forceExecutor, node, permissionChecker, executor, suggestionProvider));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue