Various code simplification/fixes and a lot of typo/grammar fixes (may brake some stuff)
This commit is contained in:
@@ -29,7 +29,7 @@ public abstract class BrigadierCommand<S> {
|
||||
* Returns a builder for this command.
|
||||
* Concrete class should include any element in the builder that is needed to build the command (sub-commands and
|
||||
* arguments, requirements, redirection, ...).
|
||||
* If any of the sub-commands and arguments needs to know the {@link LiteralCommandNode} builded from the returned
|
||||
* If any of the sub-commands and arguments needs to know the {@link LiteralCommandNode} built from the returned
|
||||
* {@link LiteralArgumentBuilder}, this can be done by overriding {@link #postBuildCommand(LiteralCommandNode)}.
|
||||
* @return a builder for this command.
|
||||
*/
|
||||
@@ -37,16 +37,16 @@ public abstract class BrigadierCommand<S> {
|
||||
|
||||
/**
|
||||
* Method to override if the reference to the command node has to be known when building the subcommands.
|
||||
* @param commandNode the command node builded from {@link #buildCommand()}.
|
||||
* @param commandNode the command node built from {@link #buildCommand()}.
|
||||
*/
|
||||
protected void postBuildCommand(LiteralCommandNode<S> commandNode) {
|
||||
// default implementation does nothing.
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to override if this command have any aliases.
|
||||
* Method to override if this command has any aliases.
|
||||
* @return an array of string corresponding to the aliases. This must not include the orignal command name (that
|
||||
* is the name of the literal command node builded from {@link #buildCommand()}).
|
||||
* is the name of the literal command node built from {@link #buildCommand()}).
|
||||
*/
|
||||
protected String[] getAliases() {
|
||||
return new String[0];
|
||||
|
@@ -13,7 +13,7 @@ import java.util.concurrent.CompletableFuture;
|
||||
|
||||
/**
|
||||
* Abstract class that holds a Brigadier {@link CommandDispatcher} instance.
|
||||
* Subclasses contains logic to integrate this commands dispatcher into their environment (like Bungee or CLI app).
|
||||
* Subclasses contain logic to integrate this commands dispatcher into their environment (like Bungee or CLI app).
|
||||
* @param <S> the command source (or command sender) type.
|
||||
*/
|
||||
public abstract class BrigadierDispatcher<S> {
|
||||
@@ -43,7 +43,7 @@ public abstract class BrigadierDispatcher<S> {
|
||||
/**
|
||||
* Executes the provided command as the provided sender.
|
||||
* @param sender the command sender.
|
||||
* @param commandWithoutSlash the command, without the eventual slash at the begining.
|
||||
* @param commandWithoutSlash the command, without the eventual slash at the beginning.
|
||||
* @return the value returned by the executed command.
|
||||
*/
|
||||
public int execute(S sender, String commandWithoutSlash) {
|
||||
|
@@ -18,7 +18,7 @@ import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
/**
|
||||
* Utility methods to replace some functionalities of Brigadier, especialy suggestion sorting that we don’t like.
|
||||
* Utility methods to replace some functionalities of Brigadier, especially suggestion sorting that we don’t like.
|
||||
*/
|
||||
public class BrigadierSuggestionsUtil {
|
||||
|
||||
|
@@ -14,7 +14,7 @@ import java.util.stream.LongStream;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* Functionnal interface providing suggestions for an argument of a command.
|
||||
* Functional interface providing suggestions for an argument of a command.
|
||||
* @param <S> the type of the command sender.
|
||||
*/
|
||||
@FunctionalInterface
|
||||
@@ -66,7 +66,7 @@ public interface SuggestionsSupplier<S> {
|
||||
* Filter the provided {@link Stream} of string according to the provided token, using the filter returned by {@link #filter(String)},
|
||||
* then returns the strings collected into a {@link List}.
|
||||
* <p>
|
||||
* This methods consume the provided stream, so will not be usable anymore.
|
||||
* This method consume the provided stream, so will not be usable anymore.
|
||||
* @param stream the stream to filter and collet.
|
||||
* @param token the token to consider for filtering.
|
||||
* @return the stream, filtered and collected into a {@link List}.
|
||||
@@ -505,7 +505,7 @@ public interface SuggestionsSupplier<S> {
|
||||
/**
|
||||
* Creates a new {@link SuggestionsSupplier} containing all the suggestions of this instance,
|
||||
* but if this list is still empty, returns the suggestions from the provided one.
|
||||
* @param other another {@link SuggestionsSupplier} to fallback to.
|
||||
* @param other another {@link SuggestionsSupplier} to fall back to.
|
||||
* @return a new {@link SuggestionsSupplier}.
|
||||
*/
|
||||
default SuggestionsSupplier<S> orIfEmpty(SuggestionsSupplier<S> other) {
|
||||
|
Reference in New Issue
Block a user