Interface LiteCommandsBuilder<SENDER,SETTINGS extends dev.rollczi.litecommands.platform.PlatformSettings,B extends LiteCommandsBuilder<SENDER,SETTINGS,B>>

Type Parameters:
SENDER - type of sender
SETTINGS - type of platform settings
B - self type for builder
All Known Subinterfaces:
LiteCommandsAdvanced<SENDER,SETTINGS,B>
All Known Implementing Classes:
LiteCommandsBaseBuilder

public interface LiteCommandsBuilder<SENDER,SETTINGS extends dev.rollczi.litecommands.platform.PlatformSettings,B extends LiteCommandsBuilder<SENDER,SETTINGS,B>>
Builder for LiteCommands. Use LiteCommandsFactory.builder(Class, Platform) to create new instance of builder.
  • Method Details

    • advanced

      @Experimental <A extends LiteCommandsAdvanced<SENDER, SETTINGS, A>> A advanced()
      Returns advanced builder. This builder is used to configure advanced settings.
    • settings

      B settings(dev.rollczi.litecommands.platform.PlatformSettingsConfigurator<SETTINGS> configurator)
      Configure platform settings.
      Parameters:
      configurator - configurator for platform settings
      Returns:
      this builder
      See Also:
      • PlatformSettings
    • commands

      B commands(dev.rollczi.litecommands.LiteCommandsProvider<SENDER> commandsProvider)
      Register commands from given provider.
      Parameters:
      commandsProvider - provider of commands
      Returns:
      this builder
      See Also:
    • commands

      B commands(Object... commands)
      This method is used to register additional commands. There are several types of objects that can be registered: Using annotations:
      • An instance annotated with Command
      • An instance annotated with RootCommand
      • A class annotated with Command
      • A class annotated with RootCommand
      Programmatically:
      • An instance of LiteCommand
      Please note that this method is experimental and may be deprecated or removed in the future.
      Parameters:
      commands - commands to register
      Returns:
      This method returns the current LiteCommand builder instance This allows you to chain multiple calls together, using the builder design pattern.
      See Also:
    • argumentParser

      <T> B argumentParser(Class<T> type, dev.rollczi.litecommands.argument.parser.Parser<SENDER,T> parser)
    • argumentParser

      <T> B argumentParser(Class<T> type, dev.rollczi.litecommands.argument.ArgumentKey key, dev.rollczi.litecommands.argument.parser.Parser<SENDER,T> parser)
    • argumentSuggestion

      <T> B argumentSuggestion(Class<T> type, dev.rollczi.litecommands.suggestion.SuggestionResult suggestion)
    • argumentSuggestion

      <T> B argumentSuggestion(Class<T> type, dev.rollczi.litecommands.argument.ArgumentKey key, dev.rollczi.litecommands.suggestion.SuggestionResult suggestion)
    • argumentSuggester

      <T> B argumentSuggester(Class<T> type, dev.rollczi.litecommands.argument.suggester.Suggester<SENDER,T> suggester)
    • argumentSuggester

      <T> B argumentSuggester(Class<T> type, dev.rollczi.litecommands.argument.ArgumentKey key, dev.rollczi.litecommands.argument.suggester.Suggester<SENDER,T> suggester)
    • argument

      <T> B argument(Class<T> type, dev.rollczi.litecommands.argument.resolver.ArgumentResolverBase<SENDER,T> resolver)
      [Argument Parser and Suggester] Register argument parser and suggester for given type.
      Parameters:
      type - type of argument
      resolver - parser and suggester for a given type
      Returns:
      this builder
    • argument

      <T> B argument(Class<T> type, dev.rollczi.litecommands.argument.ArgumentKey key, dev.rollczi.litecommands.argument.resolver.ArgumentResolverBase<SENDER,T> resolver)
      [Keyed Argument Parser and Suggester] Register argument parser and suggester for a given type and key. Key is used to define namespace for given parser. It is used to identify which parsers with same type should be used. Argument type is used to define what type is compatible with given parser.
      Parameters:
      type - type of argument
      key - key of argument
      resolver - parser and suggester for a given type
      Returns:
      this builder
    • context

      default <T> B context(Class<T> on, dev.rollczi.litecommands.context.ContextProvider<SENDER,T> bind)
    • bind

      default <T> B bind(Class<T> on, dev.rollczi.litecommands.bind.BindProvider<T> bindProvider)
    • bind

      <T> B bind(Class<T> on, Supplier<T> bind)
    • bindUnsafe

      B bindUnsafe(Class<?> on, Supplier<?> bind)
    • scheduler

      B scheduler(dev.rollczi.litecommands.scheduler.Scheduler scheduler)
    • message

      <T, CONTEXT> B message(dev.rollczi.litecommands.message.MessageKey<CONTEXT> key, dev.rollczi.litecommands.message.Message<T,CONTEXT> message)
    • message

      <T, CONTEXT> B message(dev.rollczi.litecommands.message.MessageKey<CONTEXT> key, dev.rollczi.litecommands.message.InvokedMessage<SENDER,T,CONTEXT> message)
    • message

      <T, CONTEXT> B message(dev.rollczi.litecommands.message.MessageKey<CONTEXT> key, T message)
    • editorGlobal

      B editorGlobal(dev.rollczi.litecommands.editor.Editor<SENDER> editor)
    • editor

      B editor(dev.rollczi.litecommands.scope.Scope scope, dev.rollczi.litecommands.editor.Editor<SENDER> editor)
    • validatorGlobal

      @Deprecated B validatorGlobal(dev.rollczi.litecommands.validator.Validator<SENDER> validator)
      Deprecated.
    • validator

      @Deprecated B validator(dev.rollczi.litecommands.scope.Scope scope, dev.rollczi.litecommands.validator.Validator<SENDER> validator)
      Deprecated.
    • validatorMarked

      default B validatorMarked(dev.rollczi.litecommands.validator.Validator<SENDER> validator)
    • result

      <T> B result(Class<T> resultType, dev.rollczi.litecommands.handler.result.ResultHandler<SENDER,? extends T> handler)
    • resultUnexpected

      B resultUnexpected(dev.rollczi.litecommands.handler.result.ResultHandler<SENDER,Object> handler)
    • exception

      <E extends Throwable> B exception(Class<E> exceptionType, dev.rollczi.litecommands.handler.exception.ExceptionHandler<SENDER,? extends E> handler)
    • exceptionUnexpected

      B exceptionUnexpected(dev.rollczi.litecommands.handler.exception.ExceptionHandler<SENDER,Throwable> handler)
    • missingPermission

      B missingPermission(dev.rollczi.litecommands.permission.MissingPermissionsHandler<SENDER> handler)
    • invalidUsage

      B invalidUsage(dev.rollczi.litecommands.invalidusage.InvalidUsageHandler<SENDER> handler)
    • schematicGenerator

      B schematicGenerator(dev.rollczi.litecommands.schematic.SchematicGenerator<SENDER> schematicGenerator)
    • schematicGenerator

      B schematicGenerator(dev.rollczi.litecommands.schematic.SchematicFormat format)
    • schematicGenerator

      B schematicGenerator(dev.rollczi.litecommands.schematic.SchematicFastFormat format)
    • strictMode

      @Experimental B strictMode(dev.rollczi.litecommands.strict.StrictMode strictMode)
      Set the default strict mode for all commands. If strict mode is enabled, the command will fail if the user provides too many arguments.
    • listener

      @Experimental B listener(dev.rollczi.litecommands.event.EventListener listener)
      Register event listener for the LiteCommands event system. See Event, Subscriber and EventListener for more information. Example listener:@
       
           public class MyListener implements EventListener {
      
               \@Subscriber
               public void onEvent(CommandPreExecutionEvent event) {
                   // your code
               }
      
               \@Subscriber
               public void onEvent(CommandPostExecutionEvent event) {
                   // your code
               }
           }
       
       
    • listener

      @Experimental <E extends dev.rollczi.litecommands.event.Event> B listener(Class<E> event, Consumer<E> listener)
    • selfProcessor

      @Deprecated default B selfProcessor(LiteBuilderAction<SENDER,SETTINGS> processor)
      Deprecated.
    • preProcessor

      @Deprecated default B preProcessor(LiteBuilderAction<SENDER,SETTINGS> preProcessor)
      Deprecated.
    • postProcessor

      @Deprecated default B postProcessor(LiteBuilderAction<SENDER,SETTINGS> postProcessor)
      Deprecated.
    • self

    • beforeBuild

      B beforeBuild(LiteBuilderAction<SENDER,SETTINGS> action)
    • afterBuild

      B afterBuild(LiteBuilderAction<SENDER,SETTINGS> action)
    • permissionResolver

      B permissionResolver(dev.rollczi.litecommands.permission.PermissionResolver permissionResolver)
    • extension

      <CONFIGURATION> B extension(LiteExtension<SENDER,CONFIGURATION> extension)
      Register extension for this builder.
      Type Parameters:
      CONFIGURATION - type of configuration
      Parameters:
      extension - extension to register Example:
        
        .extension(new LiteAdventureExtension<>())
        
       
      Returns:
      this builder
    • extension

      <CONFIGURATION, E extends LiteExtension<SENDER, CONFIGURATION>> B extension(E extension, LiteConfigurator<CONFIGURATION> configurator)
      Register extension for this builder with configurator.
      Type Parameters:
      CONFIGURATION - type of configuration
      Parameters:
      extension - extension to register
      configurator - configurator for extension Example:
        
        .extension(new LiteAdventureExtension<>(), configuration -> configuration
          .colorizeArgument(true)
          .miniMessage(true)
          .legacyColor(true)
          .serializer(ComponentSerializer.miniMessage())
        )
        
       
      Returns:
      this builder
    • annotations

      @Experimental B annotations(LiteConfigurator<AnnotationsExtension<SENDER>> configurator)
      [Experimental] Register extension for annotations processing/ Please note that this method is experimental and may be deprecated or removed in the future.
      Parameters:
      configurator - configurator for extension
      • processor - register new annotation processor
      • validator - register new validator for requirement
      Example:
       
       .extensionAnnotation(extension -> extension
           .processor(new MyAnnotationProcessor())
           .validator(String.class, IsValid.class, new StringValidator())
       )
       
       
      Returns:
      this builder
    • build

      dev.rollczi.litecommands.LiteCommands<SENDER> build()
    • build

      dev.rollczi.litecommands.LiteCommands<SENDER> build(boolean register)