From 22e8ba7ab972ecbbf7eda18d239c5e0183cde410 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Sun, 21 Jan 2024 22:03:47 -0700 Subject: [PATCH] Handle all aggregates not just compound --- .../commandframework/sponge/CloudSpongeCommand.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/cloud-sponge/src/main/java/cloud/commandframework/sponge/CloudSpongeCommand.java b/cloud-sponge/src/main/java/cloud/commandframework/sponge/CloudSpongeCommand.java index c7e443bf..145af35a 100644 --- a/cloud-sponge/src/main/java/cloud/commandframework/sponge/CloudSpongeCommand.java +++ b/cloud-sponge/src/main/java/cloud/commandframework/sponge/CloudSpongeCommand.java @@ -25,7 +25,7 @@ import cloud.commandframework.CommandComponent; import cloud.commandframework.arguments.LiteralParser; -import cloud.commandframework.arguments.compound.CompoundParser; +import cloud.commandframework.arguments.aggregate.AggregateParser; import cloud.commandframework.internal.CommandNode; import cloud.commandframework.permission.Permission; import cloud.commandframework.types.tuples.Pair; @@ -136,9 +136,8 @@ private void addChildren(final CommandTreeNode node, final CommandNode clo final CommandTreeNode.Argument> treeNode; if (value.parser() instanceof LiteralParser) { treeNode = (CommandTreeNode.Argument>) CommandTreeNode.literal(); - } else if (value.parser() instanceof CompoundParser) { - final CompoundParser compound = (CompoundParser) value.parser(); - this.handleCompoundArgument(node, child, compound); + } else if (value.parser() instanceof AggregateParser aggregate) { + this.handleAggregate(node, child, aggregate); continue; } else { treeNode = this.commandManager.parserMapper().mapComponent(value); @@ -152,10 +151,10 @@ private void addChildren(final CommandTreeNode node, final CommandNode clo } } - private void handleCompoundArgument( + private void handleAggregate( final CommandTreeNode node, final CommandNode child, - final CompoundParser compound + final AggregateParser compound ) { final CommandTreeNode.Argument> treeNode; final ArrayDeque>>> nodes = new ArrayDeque<>();