Improve FilteringCommandSuggestionProcessor and adjust default filters (#410)
This commit is contained in:
parent
6c026f994b
commit
eca81f7372
10 changed files with 278 additions and 8 deletions
|
|
@ -27,6 +27,7 @@ import cloud.commandframework.CommandManager;
|
|||
import cloud.commandframework.CommandTree;
|
||||
import cloud.commandframework.execution.AsynchronousCommandExecutionCoordinator;
|
||||
import cloud.commandframework.execution.CommandExecutionCoordinator;
|
||||
import cloud.commandframework.execution.FilteringCommandSuggestionProcessor;
|
||||
import cloud.commandframework.meta.CommandMeta;
|
||||
import cloud.commandframework.meta.SimpleCommandMeta;
|
||||
import java.util.function.Function;
|
||||
|
|
@ -78,6 +79,9 @@ public class SpongeCommandManager<C> extends CommandManager<C> {
|
|||
this.owningPlugin = requireNonNull(container, "container");
|
||||
this.forwardMapper = requireNonNull(forwardMapper, "forwardMapper");
|
||||
this.reverseMapper = requireNonNull(reverseMapper, "reverseMapper");
|
||||
this.commandSuggestionProcessor(new FilteringCommandSuggestionProcessor<>(
|
||||
FilteringCommandSuggestionProcessor.Filter.<C>startsWith(true).andTrimBeforeLastSpace()
|
||||
));
|
||||
((SpongePluginRegistrationHandler<C>) this.commandRegistrationHandler()).initialize(this);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue