Interface BrushSettingsRegistry


public interface BrushSettingsRegistry
Class to register, save and parse brush settings.
  • Method Details

    • registerSelector

      void registerSelector(SelectorProvider provider)
      Registers a new selector.
      Parameters:
      provider - provider of the selector
      Throws:
      AlreadyRegisteredException - when a selector with this name is already registered
    • registerSchematicSelection

      void registerSchematicSelection(SchematicSelectionProvider provider)
      Registers a new schematic selection.
      Parameters:
      provider - provider of the schematic selection
      Throws:
      AlreadyRegisteredException - when a schematic selection with this name is already registered
    • registerSchematicModifier

      void registerSchematicModifier(SchematicModifier type, ModifierProvider provider)
      Register a new schematic modifier.
      Parameters:
      type - type of modifier
      provider - provider to add
      Throws:
      AlreadyRegisteredException - when a modifier with this type and name is already registered
    • registerPlacementModifier

      void registerPlacementModifier(PlacementModifier type, ModifierProvider provider)
      Register a new schematic modifier.
      Parameters:
      type - type of modifier
      provider - provider to add
      Throws:
      AlreadyRegisteredException - when a modifier with this type and name is already registered
    • defaultSelector

      Selector defaultSelector()
      Get the default selector. This selector will be the first registered selector.
      Returns:
      selector instance
    • defaultSchematicModifier

      Map<SchematicModifier, Mutator<?>> defaultSchematicModifier()
      Get the default schematic modifier
      Returns:
      map containing all registered modifier types with one instance.
    • defaultPlacementModifier

      Map<PlacementModifier, Mutator<?>> defaultPlacementModifier()
      Get the default placement modifier
      Returns:
      map containing all registered modifier types with one instance.
    • parseSelector

      Selector parseSelector(Arguments args) throws CommandException
      Parse a selector from arguments
      Parameters:
      args - arguments to parse
      Returns:
      the parsed selector
      Throws:
      CommandException - if the arguments could not be parsed or the sender lacks the provider's permission
    • parseSchematicSelection

      SchematicSelection parseSchematicSelection(Arguments args) throws CommandException
      Parse a schematic selection from arguments
      Parameters:
      args - arguments to parse
      Returns:
      the parsed selector
      Throws:
      CommandException - if the arguments could not be parsed or the sender lacks the provider's permission
    • parseSchematicModifier

      Pair<SchematicModifier, Mutator<?>> parseSchematicModifier(Arguments args) throws CommandException
      Parse a schematic modifier from arguments
      Parameters:
      args - arguments to parse
      Returns:
      a pair containing the type and the parsed modifier
      Throws:
      CommandException - if the arguments could not be parsed or the sender lacks the provider's permission
    • parsePlacementModifier

      Pair<PlacementModifier, Mutator<?>> parsePlacementModifier(Arguments args) throws CommandException
      Parse a placement modifier from arguments
      Parameters:
      args - arguments to parse
      Returns:
      a pair containing the type and the parsed modifier
      Throws:
      CommandException - if the arguments could not be parsed or the sender lacks the provider's permission
    • selector

      List<SelectorProvider> selector()
      Get registered selectors.
      Returns:
      unmodifiable list of selectors
    • schematicSelections

      List<SchematicSelectionProvider> schematicSelections()
      Get registered schematic selections.
      Returns:
      unmodifiable list of selectors
    • schematicModifier

      Map<SchematicModifier, List<ModifierProvider>> schematicModifier()
      Get registered schematic modifier
      Returns:
      unmodifiable map of all registered schematic modifier
    • placementModifier

      Map<PlacementModifier, List<ModifierProvider>> placementModifier()
      Get registered placement modifier
      Returns:
      unmodifiable map of all registered placement modifier
    • getPlacementModifier

      Optional<PlacementModifierRegistration> getPlacementModifier(String name)
      Gets a modifier registration.
      Parameters:
      name - name of the registration
      Returns:
      Optional holding the registration if present
    • getSchematicModifier

      Optional<SchematicModifierRegistration> getSchematicModifier(String name)
      Gets a modifier registration.
      Parameters:
      name - name of the registration
      Returns:
      Optional holding the registration if present
    • completeSelector

      List<String> completeSelector(Arguments args, Player player) throws CommandException
      Complete selectors
      Parameters:
      args - arguments to complete
      player - player which requested completion
      Returns:
      list of possible values
      Throws:
      CommandException - if the arguments are invalid
    • completeSchematicSelection

      List<String> completeSchematicSelection(Arguments args, Player player) throws CommandException
      Complete schematic selection
      Parameters:
      args - arguments to complete
      player - player which requested completion
      Returns:
      list of possible values
      Throws:
      CommandException - if the arguments are invalid
    • completePlacementModifier

      List<String> completePlacementModifier(Arguments args) throws CommandException
      Complete placement modifier
      Parameters:
      args - arguments to complete
      Returns:
      list of possible values
      Throws:
      CommandException - if the arguments are invalid
    • completeSchematicModifier

      List<String> completeSchematicModifier(Arguments args) throws CommandException
      Complete schematic modifier
      Parameters:
      args - arguments to complete
      Returns:
      list of possible values
      Throws:
      CommandException - if the arguments are invalid
    • getPlacementModifier

      default Optional<PlacementModifierRegistration> getPlacementModifier(Nameable key)
      Gets a modifier registration.
      Parameters:
      key - Key or name of the registration
      Returns:
      Optional holding the registration if present
    • getSchematicModifier

      default Optional<SchematicModifierRegistration> getSchematicModifier(Nameable key)
      Gets a modifier registration.
      Parameters:
      key - Key or name of the registration
      Returns:
      Optional holding the registration if present