Enum Class Element

java.lang.Object
java.lang.Enum<Element>
com.pixelmonmod.pixelmon.api.pokemon.Element
All Implemented Interfaces:
ITranslatable, Serializable, Comparable<Element>, Constable, net.minecraft.util.StringRepresentable

public enum Element extends Enum<Element> implements ITranslatable, net.minecraft.util.StringRepresentable
A Pokémon type.
  • Enum Constant Details

    • NORMAL

      public static final Element NORMAL
    • FIRE

      public static final Element FIRE
    • WATER

      public static final Element WATER
    • ELECTRIC

      public static final Element ELECTRIC
    • GRASS

      public static final Element GRASS
    • ICE

      public static final Element ICE
    • FIGHTING

      public static final Element FIGHTING
    • POISON

      public static final Element POISON
    • GROUND

      public static final Element GROUND
    • FLYING

      public static final Element FLYING
    • PSYCHIC

      public static final Element PSYCHIC
    • BUG

      public static final Element BUG
    • ROCK

      public static final Element ROCK
    • GHOST

      public static final Element GHOST
    • DRAGON

      public static final Element DRAGON
    • DARK

      public static final Element DARK
    • STEEL

      public static final Element STEEL
    • MYSTERY

      public static final Element MYSTERY
    • FAIRY

      public static final Element FAIRY
  • Field Details

    • textureX

      public float textureX
    • textureY

      public float textureY
  • Method Details

    • values

      public static Element[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Element valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getElements

      public static Set<Element> getElements()
      Returns the list of valid elements
      Returns:
      Set
    • getColor

      public int getColor()
      Returns the type's associated color on GUIs.
      Returns:
      The type's color.
    • getName

      public String getName()
      Returns the type's name.
      Returns:
      The type's name.
    • getTranslationKey

      public String getTranslationKey()
      Specified by:
      getTranslationKey in interface ITranslatable
    • getLocalizedName

      public String getLocalizedName()
      Returns the localized type name.
      Specified by:
      getLocalizedName in interface ITranslatable
      Returns:
      The localized type name.
    • parseType

      public static Element parseType(int index)
      Gets a type from its index. Returns NORMAL if not found
      Parameters:
      index - The index of the type.
      Returns:
      The type with the specified index, or Normal if the index is out of bounds.
    • parseType

      public static Element parseType(String name)
      Gets a type from its name. Returns NORMAL if not found
      Parameters:
      name - The name of the type.
      Returns:
      The type with the specified name, or Normal if there is no type with the specified name.
    • parseOrNull

      public static Element parseOrNull(int index)
      Gets the type for the given index or returns null
      Parameters:
      index - The index of the type
      Returns:
      The element at the given index
    • parseOrNull

      public static Element parseOrNull(String name)
      Gets a type from its name. Returns null if not found
      Parameters:
      name - The name of the type.
      Returns:
      The type with the specified name, or Normal if there is no type with the specified name.
    • getAllTypes

      public static List<Element> getAllTypes()
      Returns a list of all types.
      Returns:
      A list of all types.
    • getTotalEffectiveness

      public static float getTotalEffectiveness(List<Element> elements, Element attackType)
      Determines the effectiveness of an attack on a list of types.
      Parameters:
      elements - The defending types.
      attackType - The attacking type.
      Returns:
      The effectiveness of the attack on the types.
    • getTotalEffectiveness

      public static float getTotalEffectiveness(List<Element> elements, Element attackType, boolean inverse)
      Determines the effectiveness of an attack on a list of types.
      Parameters:
      elements - The defending types.
      attackType - The attacking type.
      inverse - Whether to
      Returns:
      The effectiveness of the attack on the types.
    • inverseEffectiveness

      public static float inverseEffectiveness(float effectiveness)
      Inverses type effectiveness for an inverse battle.
      Parameters:
      effectiveness - The original type effectiveness before inversing it.
      Returns:
      The inversed type effectiveness.
    • getEffectiveness

      public static Effectiveness getEffectiveness(Element t, Element t1)
      Determines the effectiveness of one type onto another.
      Parameters:
      t - The attacking type.
      t1 - The defending type.
      Returns:
      The type effectiveness matchup.
    • getEffectiveness

      public static Effectiveness getEffectiveness(Element t, Element t1, boolean inverse)
      Determines the effectiveness of one type onto another.
      Parameters:
      t - The attacking type.
      t1 - The defending type.
      inverse - Is inversed typings
      Returns:
      The type effectiveness matchup.
    • getIndex

      public int getIndex()
      Returns the index of the enum.
      Returns:
      The index of the enum.
    • makeTypeList

      public List<Element> makeTypeList()
      Makes a list of types consisting of the specified type.
      Returns:
      A list of types consisting of the specified type.
    • hasType

      public static boolean hasType(String name)
      Determines whether there is a type with a specified name.
      Parameters:
      name - The type to find.
      Returns:
      Whether there is a type with the given name.
    • ignoreType

      public static List<Element> ignoreType(List<Element> origTypes, Element ignoreType)
      Ignores a particular type from a list of types Becomes a mystery type (neutral type effectiveness everywhere) if the only type is ignored.
      Parameters:
      origTypes - The original types.
      ignoreType - The type to ignore.
      Returns:
      The type after ignoring ignoreType.
    • getSerializedName

      public String getSerializedName()
      Specified by:
      getSerializedName in interface net.minecraft.util.StringRepresentable
    • getRandomType

      public static Element getRandomType(boolean mystery)
    • getRandomTypes

      public static List<Element> getRandomTypes(int count, boolean mystery, boolean unique)
    • getTypeNames

      public static String[] getTypeNames(boolean mystery)