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.brigadier.BrigadierManagerHolder;
import cloud.commandframework.brigadier.CloudBrigadierManager;
import cloud.commandframework.captions.FactoryDelegatingCaptionRegistry;
import cloud.commandframework.execution.CommandExecutionCoordinator;
import cloud.commandframework.execution.FilteringCommandSuggestionProcessor;
import cloud.commandframework.meta.CommandMeta;
import cloud.commandframework.meta.SimpleCommandMeta;
import cloud.commandframework.velocity.arguments.PlayerArgument;
@ -114,6 +115,10 @@ public class VelocityCommandManager<C> extends CommandManager<C> implements Brig
this.commandSenderMapper = commandSenderMapper;
this.backwardsCommandSenderMapper = backwardsCommandSenderMapper;
this.commandSuggestionProcessor(new FilteringCommandSuggestionProcessor<>(
FilteringCommandSuggestionProcessor.Filter.<C>startsWith(true).andTrimBeforeLastSpace()
));
/* Register Velocity Preprocessor */
this.registerCommandPreProcessor(new VelocityCommandPreprocessor<>(this));