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 selectorsGet the default placement modifierGet 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.Parse a placement modifier from argumentsParse a schematic modifier from argumentsParse a schematic selection from argumentsparseSelector
(Arguments args) Parse a selector from argumentsGet registered placement modifiervoid
registerPlacementModifier
(PlacementModifier type, ModifierProvider provider) Register a new schematic modifier.void
registerSchematicModifier
(SchematicModifier type, ModifierProvider provider) Register a new schematic modifier.void
Registers a new schematic selection.void
registerSelector
(SelectorProvider provider) Registers a new selector.Get registered schematic modifierGet registered schematic selections.selector()
Get registered selectors.
-
Method Details
-
registerSelector
Registers a new selector.This will also call
ConfigurationSerialization.registerClass(Class)
- Parameters:
provider
- provider of the selector- Throws:
AlreadyRegisteredException
- when a selector with this name is already registered
-
registerSchematicSelection
Registers a new schematic selection.This will also call
ConfigurationSerialization.registerClass(Class)
- 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.This will also call
ConfigurationSerialization.registerClass(Class)
- 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.This will also call
ConfigurationSerialization.registerClass(Class)
- 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
-
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
-
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
-
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
-
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
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
-