Class CustomTrait

java.lang.Object
dev.aurelium.auraskills.api.trait.CustomTrait
All Implemented Interfaces:
Optioned, NamespaceIdentified, ReloadableIdentifier, Trait

public class CustomTrait extends Object implements Trait
  • Method Details

    • builder

      public static CustomTrait.CustomTraitBuilder builder(NamespacedId id)
      Gets a new CustomTrait.CustomTraitBuilder used to create a custom trait.
      Parameters:
      id - the NamespacedId identifying the trait
      Returns:
      a new builder
    • 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: Trait
      Gets whether the trait is enabled. Disabled traits will have no effect and will be hidden from menus.
      Specified by:
      isEnabled in interface Trait
      Returns:
      whether the trait is enabled
    • getDisplayName

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

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

      public String getMenuDisplay(double value, Locale locale)
      Description copied from interface: Trait
      Formats the given value of this trait to the format shown in the stats menu.
      Specified by:
      getMenuDisplay in interface Trait
      Parameters:
      value - the value of the trait
      locale - the locale to format in
      Returns:
      the formatted value
    • name

      public String name()
      Description copied from interface: Trait
      Gets a fully uppercase String of the trait name without the namespace
      Specified by:
      name in interface ReloadableIdentifier
      Specified by:
      name in interface Trait
      Returns:
      the trait 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