Class CustomStat

java.lang.Object
dev.aurelium.auraskills.api.stat.CustomStat
All Implemented Interfaces:
Optioned, NamespaceIdentified, Stat

public class CustomStat extends Object implements Stat
  • Method Details

    • builder

      public static CustomStat.CustomStatBuilder builder(NamespacedId id)
      Gets a new CustomStat.CustomStatBuilder used to create a custom stat.
      Parameters:
      id - the NamespacedId identifying the stat
      Returns:
      a new builder
    • getDefined

      public CustomStat.Defined getDefined()
    • getId

      public NamespacedId getId()
      Description copied from interface: NamespaceIdentified
      Gets the NamespacedId of the object
      Specified by:
      getId in interface NamespaceIdentified
      Returns:
      the NamespacedId
    • isEnabled

      public boolean isEnabled()
      Description copied from interface: Stat
      Gets whether the stat is enabled in the configuration. Disabled stats have no effect and are hidden from menus and messages.
      Specified by:
      isEnabled in interface Stat
      Returns:
      whether the stat is enabled
    • getTraits

      public List<Trait> getTraits()
      Description copied from interface: Stat
      Gets the list of Trait instances leveled by the stat. Traits are the gameplay aspects buffed by a stat. The trait value is determined by the stat level multiplied by the modifier in stats.yml.
      Specified by:
      getTraits in interface Stat
      Returns:
      the list of traits
    • getTraitModifier

      public double getTraitModifier(Trait trait)
      Description copied from interface: Stat
      Gets the modifier value for a Trait associated with the stat defined in stats.yml. The modifier value is multiplied by the stat level to determine the trait value, which is the value directly used by the trait implementation.
      Specified by:
      getTraitModifier in interface Stat
      Parameters:
      trait - the trait modifier value
      Returns:
      the trait modifier
    • getDisplayName

      public String getDisplayName(Locale locale)
      Description copied from interface: Stat
      Gets the stat display name as defined in the locale's messages file.
      Specified by:
      getDisplayName in interface Stat
      Parameters:
      locale - the locale to get the display name in
      Returns:
      the display name in the specified locale or in a fallback language
    • getDisplayName

      public String getDisplayName(Locale locale, boolean formatted)
      Description copied from interface: Stat
      Gets the stat display name as defined in the locale's messages file.
      Specified by:
      getDisplayName in interface Stat
      Parameters:
      locale - the locale to get the display name in
      formatted - whether to apply formatting to the display name
      Returns:
      the display name in the specified locale or in a fallback language
    • getDescription

      public String getDescription(Locale locale)
      Description copied from interface: Stat
      Gets the stat description as defined in the locale's messages file.
      Specified by:
      getDescription in interface Stat
      Parameters:
      locale - the locale to get the description in
      Returns:
      the description in the specified locale or in a fallback language
    • getDescription

      public String getDescription(Locale locale, boolean formatted)
      Description copied from interface: Stat
      Gets the stat description as defined in the locale's messages file.
      Specified by:
      getDescription in interface Stat
      Parameters:
      locale - the locale to get the description in
      formatted - whether to apply formatting to the description
      Returns:
      the description in the specified locale or in a fallback language
    • getColor

      public String getColor(Locale locale)
      Description copied from interface: Stat
      Gets the stat color as defined in the messages file.
      Specified by:
      getColor in interface Stat
      Parameters:
      locale - the locale to get the color in
      Returns:
      the color in the specified locale or in a fallback language
    • getColoredName

      public String getColoredName(Locale locale)
      Description copied from interface: Stat
      Gets the stat's display name applied with its color
      Specified by:
      getColoredName in interface Stat
      Parameters:
      locale - the locale to get the name and color in
      Returns:
      the colored name
    • getSymbol

      public String getSymbol(Locale locale)
      Description copied from interface: Stat
      Gets the symbol as defined in the messages file.
      Specified by:
      getSymbol in interface Stat
      Parameters:
      locale - the locale to get the symbol in
      Returns:
      the symbol in the specified locale or in a fallback language
    • name

      public String name()
      Description copied from interface: Stat
      Gets a fully uppercase String of the stat name without the namespace
      Specified by:
      name in interface Stat
      Returns:
      the stat name in all upper case
    • optionBoolean

      public boolean optionBoolean(String key)
      Specified by:
      optionBoolean in interface Optioned
    • optionBoolean

      public boolean optionBoolean(String key, boolean def)
      Specified by:
      optionBoolean in interface Optioned
    • optionInt

      public int optionInt(String key)
      Specified by:
      optionInt in interface Optioned
    • optionInt

      public int optionInt(String key, int def)
      Specified by:
      optionInt in interface Optioned
    • optionDouble

      public double optionDouble(String key)
      Specified by:
      optionDouble in interface Optioned
    • optionDouble

      public double optionDouble(String key, double def)
      Specified by:
      optionDouble in interface Optioned
    • optionString

      public String optionString(String key)
      Specified by:
      optionString in interface Optioned
    • optionString

      public String optionString(String key, String def)
      Specified by:
      optionString in interface Optioned
    • optionStringList

      public List<String> optionStringList(String key)
      Specified by:
      optionStringList in interface Optioned
    • optionMap

      public Map<String,Object> optionMap(String key)
      Specified by:
      optionMap in interface Optioned
    • toString

      public String toString()
      Overrides:
      toString in class Object