mirror of
https://github.com/Minestom/Minestom.git
synced 2025-03-12 22:59:07 +01:00
Command comments
This commit is contained in:
parent
af369dedde
commit
28332cd09d
src/main/java/net/minestom/server/command/builder
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user