Interface BrushSettingsRegistry
public interface BrushSettingsRegistry
Class to register, save and parse brush settings.
-
Method Summary
Modifier and TypeMethodDescriptionComplete placement modifierComplete schematic modifiercompleteSchematicSelection(Arguments args, Player player) Complete schematic selectioncompleteSelector(Arguments args, Player player) Complete selectorsMap<PlacementModifier, Mutator<?>> Get the default placement modifierMap<SchematicModifier, Mutator<?>> Get the default schematic modifierGet the default selector.default Optional<PlacementModifierRegistration> Gets a modifier registration.getPlacementModifier(String name) Gets a modifier registration.default Optional<SchematicModifierRegistration> Gets a modifier registration.getSchematicModifier(String name) Gets a modifier registration.Pair<PlacementModifier, Mutator<?>> Parse a placement modifier from argumentsPair<SchematicModifier, Mutator<?>> Parse a schematic modifier from argumentsParse a schematic selection from argumentsparseSelector(Arguments args) Parse a selector from argumentsGet registered placement modifiervoidregisterPlacementModifier(PlacementModifier type, ModifierProvider provider) Register a new schematic modifier.voidregisterSchematicModifier(SchematicModifier type, ModifierProvider provider) Register a new schematic modifier.voidRegisters a new schematic selection.voidregisterSelector(SelectorProvider provider) Registers a new selector.Get registered schematic modifierGet registered schematic selections.selector()Get registered selectors.
-
Method Details
-
registerSelector
Registers a new selector.- Parameters:
provider- provider of the selector- Throws:
AlreadyRegisteredException- when a selector with this name is already registered
-
registerSchematicSelection
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
Register a new schematic modifier.- Parameters:
type- type of modifierprovider- provider to add- Throws:
AlreadyRegisteredException- when a modifier with this type and name is already registered
-
registerPlacementModifier
Register a new schematic modifier.- Parameters:
type- type of modifierprovider- 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
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
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
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
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
-
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
Gets a modifier registration.- Parameters:
name- name of the registration- Returns:
- Optional holding the registration if present
-
getSchematicModifier
Gets a modifier registration.- Parameters:
name- name of the registration- Returns:
- Optional holding the registration if present
-
completeSelector
Complete selectors- Parameters:
args- arguments to completeplayer- player which requested completion- Returns:
- list of possible values
- Throws:
CommandException- if the arguments are invalid
-
completeSchematicSelection
Complete schematic selection- Parameters:
args- arguments to completeplayer- player which requested completion- Returns:
- list of possible values
- Throws:
CommandException- if the arguments are invalid
-
completePlacementModifier
Complete placement modifier- Parameters:
args- arguments to complete- Returns:
- list of possible values
- Throws:
CommandException- if the arguments are invalid
-
completeSchematicModifier
Complete schematic modifier- Parameters:
args- arguments to complete- Returns:
- list of possible values
- Throws:
CommandException- if the arguments are invalid
-
getPlacementModifier
Gets a modifier registration.- Parameters:
key- Key or name of the registration- Returns:
- Optional holding the registration if present
-
getSchematicModifier
Gets a modifier registration.- Parameters:
key- Key or name of the registration- Returns:
- Optional holding the registration if present
-