You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't know if this is a bug, something that is purposefully not implemented, or something I could work around using annotations I've missed in the documentation.
I have two commands declared:
@CommandMethod("command literal")
@CommandDescription("Performs the literal operation")
private void commandLiteral(
final CommandSender sender
) {
sender.sendMessage("Performed command with a literal match");
}
@CommandMethod("command <argument>")
@CommandDescription("Performs the operation with some variable")
private void commandArgument(
final CommandSender sender,
final @Argument(value="argument") String argument
) {
sender.sendMessage("Performed command using " + argument);
}
But get the error:
com.bergerkiller.bukkit.tc.dep.cloud.exceptions.AmbiguousNodeException: Ambiguous Node: argument cannot be added as a child to command (All children: literal, argument)
at com.bergerkiller.bukkit.tc.dep.cloud.CommandTree.checkAmbiguity(CommandTree.java:741)
at java.lang.Iterable.forEach(Iterable.java:75)
at com.bergerkiller.bukkit.tc.dep.cloud.CommandTree.checkAmbiguity(CommandTree.java:745)
at com.bergerkiller.bukkit.tc.dep.cloud.CommandTree.verifyAndRegister(CommandTree.java:672)
at com.bergerkiller.bukkit.tc.dep.cloud.CommandTree.insertCommand(CommandTree.java:617)
at com.bergerkiller.bukkit.tc.dep.cloud.CommandManager.command(CommandManager.java:210)
at com.bergerkiller.bukkit.tc.dep.cloud.annotations.AnnotationParser.parse(AnnotationParser.java:250)
I want /command literal to match one, and have /command anythingelse match the other. Obviously I can handle this by doing an equals check of the argument, but let's assume there are a lot of literals like this. Or that some literals have flags, while the variable one doesn't.
Is there a solution?
The text was updated successfully, but these errors were encountered:
An AmbiguousNodeException is thrown here because by cloud's definition, those nodes are ambiguous. A node can have multiple literals, or a single argument as children. See #130 and #106 for further context.
I don't know if this is a bug, something that is purposefully not implemented, or something I could work around using annotations I've missed in the documentation.
I have two commands declared:
But get the error:
I want /command literal to match one, and have /command anythingelse match the other. Obviously I can handle this by doing an equals check of the argument, but let's assume there are a lot of literals like this. Or that some literals have flags, while the variable one doesn't.
Is there a solution?
The text was updated successfully, but these errors were encountered: