Improve FilteringCommandSuggestionProcessor and adjust default filters (#410)

This commit is contained in:
Jason 2022-11-28 13:23:11 -07:00
parent 6c026f994b
commit eca81f7372
10 changed files with 278 additions and 8 deletions

View file

@ -29,6 +29,7 @@ import cloud.commandframework.bungee.arguments.PlayerArgument;
import cloud.commandframework.bungee.arguments.ServerArgument;
import cloud.commandframework.captions.FactoryDelegatingCaptionRegistry;
import cloud.commandframework.execution.CommandExecutionCoordinator;
import cloud.commandframework.execution.FilteringCommandSuggestionProcessor;
import cloud.commandframework.meta.SimpleCommandMeta;
import io.leangen.geantyref.TypeToken;
import java.util.function.Function;
@ -76,6 +77,10 @@ public class BungeeCommandManager<C> extends CommandManager<C> {
this.commandSenderMapper = commandSenderMapper;
this.backwardsCommandSenderMapper = backwardsCommandSenderMapper;
this.commandSuggestionProcessor(new FilteringCommandSuggestionProcessor<>(
FilteringCommandSuggestionProcessor.Filter.<C>startsWith(true).andTrimBeforeLastSpace()
));
/* Register Bungee Preprocessor */
this.registerCommandPreProcessor(new BungeeCommandPreprocessor<>(this));