mirror of
https://github.com/Minestom/Minestom.git
synced 2025-03-02 11:21:15 +01:00
Move some CommandDispatcher methods
This commit is contained in:
parent
367889a374
commit
1d64cafcf2
@ -55,6 +55,23 @@ public class CommandDispatcher {
|
||||
this.commands.remove(command);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Set<Command> getCommands() {
|
||||
return Collections.unmodifiableSet(commands);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the command class associated with the name.
|
||||
*
|
||||
* @param commandName the command name
|
||||
* @return the {@link Command} associated with the name, null if not any
|
||||
*/
|
||||
@Nullable
|
||||
public Command findCommand(@NotNull String commandName) {
|
||||
commandName = commandName.toLowerCase();
|
||||
return commandMap.getOrDefault(commandName, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the command exists, and execute it.
|
||||
*
|
||||
@ -114,23 +131,6 @@ public class CommandDispatcher {
|
||||
return result;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Set<Command> getCommands() {
|
||||
return Collections.unmodifiableSet(commands);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the command class associated with the name.
|
||||
*
|
||||
* @param commandName the command name
|
||||
* @return the {@link Command} associated with the name, null if not any
|
||||
*/
|
||||
@Nullable
|
||||
public Command findCommand(@NotNull String commandName) {
|
||||
commandName = commandName.toLowerCase();
|
||||
return commandMap.getOrDefault(commandName, null);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private ParsedCommand findParsedCommand(@NotNull Command command, @NotNull String[] args) {
|
||||
ParsedCommand parsedCommand = new ParsedCommand();
|
||||
|
Loading…
Reference in New Issue
Block a user