Skip to content

Commit 1b24e7d

Browse files
committed
Handle all aggregates not just compound
1 parent 05af988 commit 1b24e7d

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

cloud-sponge/src/main/java/cloud/commandframework/sponge/CloudSpongeCommand.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
import cloud.commandframework.CommandComponent;
2727
import cloud.commandframework.arguments.LiteralParser;
28-
import cloud.commandframework.arguments.compound.CompoundParser;
28+
import cloud.commandframework.arguments.aggregate.AggregateParser;
2929
import cloud.commandframework.internal.CommandNode;
3030
import cloud.commandframework.permission.Permission;
3131
import cloud.commandframework.types.tuples.Pair;
@@ -136,9 +136,8 @@ private void addChildren(final CommandTreeNode<?> node, final CommandNode<C> clo
136136
final CommandTreeNode.Argument<? extends CommandTreeNode.Argument<?>> treeNode;
137137
if (value.parser() instanceof LiteralParser) {
138138
treeNode = (CommandTreeNode.Argument<? extends CommandTreeNode.Argument<?>>) CommandTreeNode.literal();
139-
} else if (value.parser() instanceof CompoundParser) {
140-
final CompoundParser<?, C, ?> compound = (CompoundParser<?, C, ?>) value.parser();
141-
this.handleCompoundArgument(node, child, compound);
139+
} else if (value.parser() instanceof AggregateParser<C, ?> aggregate) {
140+
this.handleAggregate(node, child, aggregate);
142141
continue;
143142
} else {
144143
treeNode = this.commandManager.parserMapper().mapComponent(value);
@@ -152,10 +151,10 @@ private void addChildren(final CommandTreeNode<?> node, final CommandNode<C> clo
152151
}
153152
}
154153

155-
private void handleCompoundArgument(
154+
private void handleAggregate(
156155
final CommandTreeNode<?> node,
157156
final CommandNode<C> child,
158-
final CompoundParser<?, C, ?> compound
157+
final AggregateParser<C, ?> compound
159158
) {
160159
final CommandTreeNode.Argument<? extends CommandTreeNode.Argument<?>> treeNode;
161160
final ArrayDeque<Pair<String, CommandTreeNode.Argument<? extends CommandTreeNode.Argument<?>>>> nodes = new ArrayDeque<>();

0 commit comments

Comments
 (0)