Class CustomTrait
java.lang.Object
dev.aurelium.auraskills.api.trait.CustomTrait
- All Implemented Interfaces:
Optioned
,NamespaceIdentified
,ReloadableIdentifier
,Trait
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuilder
(NamespacedId id) Gets a newCustomTrait.CustomTraitBuilder
used to create a custom trait.getDisplayName
(Locale locale) Gets the trait display name as defined in the locale's messages file.getDisplayName
(Locale locale, boolean formatted) Gets the trait display name as defined in the locale's messages file.getId()
Gets theNamespacedId
of the objectgetMenuDisplay
(double value, Locale locale) Formats the given value of this trait to the format shown in the stats menu.boolean
Gets whether the trait is enabled.name()
Gets a fully uppercase String of the trait name without the namespaceboolean
optionBoolean
(String key) boolean
optionBoolean
(String key, boolean def) double
optionDouble
(String key) double
optionDouble
(String key, double def) int
int
optionString
(String key) optionString
(String key, String def) optionStringList
(String key) toString()
-
Method Details
-
builder
Gets a newCustomTrait.CustomTraitBuilder
used to create a custom trait.- Parameters:
id
- theNamespacedId
identifying the trait- Returns:
- a new builder
-
getId
Description copied from interface:NamespaceIdentified
Gets theNamespacedId
of the object- Specified by:
getId
in interfaceNamespaceIdentified
- Returns:
- the
NamespacedId
-
isEnabled
public boolean isEnabled()Description copied from interface:Trait
Gets whether the trait is enabled. Disabled traits will have no effect and will be hidden from menus. -
getDisplayName
Description copied from interface:Trait
Gets the trait display name as defined in the locale's messages file.- Specified by:
getDisplayName
in interfaceTrait
- Parameters:
locale
- the locale to get the display name- Returns:
- the display name in the specified locale or a fallback language
-
getDisplayName
Description copied from interface:Trait
Gets the trait display name as defined in the locale's messages file.- Specified by:
getDisplayName
in interfaceTrait
- Parameters:
locale
- the locale to get the display nameformatted
- whether to apply formatting to the display name- Returns:
- the display name in the specified locale or a fallback language
-
getMenuDisplay
Description copied from interface:Trait
Formats the given value of this trait to the format shown in the stats menu.- Specified by:
getMenuDisplay
in interfaceTrait
- Parameters:
value
- the value of the traitlocale
- the locale to format in- Returns:
- the formatted value
-
name
Description copied from interface:Trait
Gets a fully uppercase String of the trait name without the namespace- Specified by:
name
in interfaceReloadableIdentifier
- Specified by:
name
in interfaceTrait
- Returns:
- the trait name in all upper case
-
optionBoolean
- Specified by:
optionBoolean
in interfaceOptioned
-
optionBoolean
- Specified by:
optionBoolean
in interfaceOptioned
-
optionInt
-
optionInt
-
optionDouble
- Specified by:
optionDouble
in interfaceOptioned
-
optionDouble
- Specified by:
optionDouble
in interfaceOptioned
-
optionString
- Specified by:
optionString
in interfaceOptioned
-
optionString
- Specified by:
optionString
in interfaceOptioned
-
optionStringList
- Specified by:
optionStringList
in interfaceOptioned
-
optionMap
-
toString
-