Class SettingProvider<T>
java.lang.Object
de.eldoria.schematicbrush.brush.config.provider.SettingProvider<T>
- Type Parameters:
T- type of provided class
- Direct Known Subclasses:
ModifierProvider, SchematicSelectionProvider, SelectorProvider
Base class for the provider classes.
See implementation to use them.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSettingProvider(String name, String localizedName, String description) Create a new settings provider -
Method Summary
Modifier and TypeMethodDescriptionArgument[]Return the required and optional arguments to parse this setting.Returns the command type to use when building buttons.Method to complete the arguments for the class provided by this providerabstract TProvides a default instance for this typeProvides a short description of the setting.booleanbooleanDefines whether the provider requires arguments or not.inthashCode()booleanChecks if the provider requires a permissionbooleanhasPermission(Permissible permissible) Checks if thePermissiblecan use this setting.The inputs the dialog editor shows to enter the arguments of this setting.booleanChecks if the first argument matches the name.name()Name of this providerabstract TParse the arguments to the provided class if possibleReturns the permission for this setting.
-
Field Details
-
name
Name of the provider -
description
-
-
Constructor Details
-
SettingProvider
-
-
Method Details
-
isMatch
Checks if the first argument matches the name.- Parameters:
args- arguments- Returns:
- true if the first argument is equal to the name, ignoring case.
-
parse
Parse the arguments to the provided class if possible- Parameters:
args- args to parse- Returns:
- instance of the provided class
- Throws:
CommandException- if the arguments can't be parsed.
-
arguments
Return the required and optional arguments to parse this setting.- Returns:
- the arguments of the setting
-
inputs
The inputs the dialog editor shows to enter the arguments of this setting.Defaults to one empty text input per
argument. Override it to offer choices, toggles or numbers instead, and to start from the current value.- Parameters:
current- the current setting of the same type, which may come from another provider; null if none is set- Returns:
- inputs in argument order
-
hasArguments
public boolean hasArguments()Defines whether the provider requires arguments or not.- Returns:
- true if arguments are required
-
commandType
Returns the command type to use when building buttons. Will differ between suggesting and running a command.- Returns:
- string to build command.
-
complete
Method to complete the arguments for the class provided by this provider- Parameters:
args- args to completeplayer- player which requests completion- Returns:
- list of strings for the current argument
- Throws:
CommandException
-
name
-
localizedName
-
defaultSetting
Provides a default instance for this type- Returns:
- instance of default setting
-
permission
Returns the permission for this setting.Leave blank when no permission is required.
- Returns:
- the permission
-
hasPermission
public boolean hasPermission()Checks if the provider requires a permission- Returns:
- true if a permission is required.
-
hasPermission
Checks if thePermissiblecan use this setting.- Parameters:
permissible- the permissible to check- Returns:
- true if it has the permission.
-
description
Provides a short description of the setting.- Returns:
- the setting description
-
equals
-
hashCode
-
localizedDescription
-