Class EnumType<E extends Enum<E>>

java.lang.Object
net.ixdarklord.coolcatcore.api.config.type.EnumType<E>
All Implemented Interfaces:
ConfigType<E>

public final class EnumType<E extends Enum<E>> extends Object implements ConfigType<E>
One of an enum's constants, stored by name (read case-insensitively). Give constants a name for the screen by implementing EnumType.Displayable; otherwise FANCY_LEAVES shows as "Fancy Leaves".
  • Method Details

    • enumClass

      public Class<E> enumClass()
    • constants

      public List<E> constants()
    • cycle

      public E cycle(E current, boolean backwards)
      The constant after (or before) this one, wrapping around.
    • displayName

      public net.minecraft.network.chat.Component displayName(E constant)
    • codec

      public com.mojang.serialization.Codec<E> codec()
      Specified by:
      codec in interface ConfigType<E extends Enum<E>>
    • validate

      public ValidationResult<E> validate(E value)
      Description copied from interface: ConfigType
      Checks a value, possibly correcting it.
      Specified by:
      validate in interface ConfigType<E extends Enum<E>>
    • parse

      public ValidationResult<E> parse(String text)
      Description copied from interface: ConfigType
      Reads a value typed by a player, and validates it. By default the text is JSON for the codec.
      Specified by:
      parse in interface ConfigType<E extends Enum<E>>
    • format

      public String format(E value)
      Description copied from interface: ConfigType
      The value as a player would type it, the inverse of ConfigType.parse(java.lang.String). By default compact JSON.
      Specified by:
      format in interface ConfigType<E extends Enum<E>>
    • describe

      public List<net.minecraft.network.chat.Component> describe()
      Description copied from interface: ConfigType
      The constraints in words, for the file's comments and the screen's tooltips ("Range: 0 ~ 10").
      Specified by:
      describe in interface ConfigType<E extends Enum<E>>
    • suggestions

      public List<String> suggestions()
      Description copied from interface: ConfigType
      Values to suggest in commands.
      Specified by:
      suggestions in interface ConfigType<E extends Enum<E>>