Command comments

This commit is contained in:
themode 2020-10-08 01:28:40 +02:00
parent af369dedde
commit 28332cd09d
2 changed files with 8 additions and 1 deletions

View File

@ -102,6 +102,7 @@ public class Command {
/**
* Get the default executor (which is called when there is no argument)
* or if no corresponding syntax has been found
*
* @return the default executor
*/
@ -144,6 +145,8 @@ public class Command {
* <p>
* WARNING: the {@link CommandCondition} is not executed, and all the {@link CommandSyntax} are not checked,
* this is called every time a {@link CommandSender} send a command which start by {@link #getName()} or {@link #getAliases()}.
* <p>
* Can be used if you wish to still suggest the player syntaxes but want to parse things mostly by yourself.
*
* @param sender the {@link CommandSender}
* @param arguments the UNCHECKED arguments of the command, some can be null even when unexpected

View File

@ -234,7 +234,11 @@ public class CommandDispatcher {
}
/**
* Represents a command ready to be executed (already parsed)
*/
private static class CommandResult {
// Command
private Command command;
@ -271,7 +275,7 @@ public class CommandDispatcher {
// An executor has been found
executor.apply(source, arguments);
} else if (callback != null) {
// No syntax has been validated but the faulty argument has been found
// No syntax has been validated but the faulty argument with a callback has been found
// Execute the faulty argument callback
callback.apply(source, value, error);
}