Enum Class 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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
Nested classes/interfaces inherited from interface net.minecraft.util.StringRepresentable
net.minecraft.util.StringRepresentable.EnumCodec<E extends Enum<E> & net.minecraft.util.StringRepresentable>
-
Enum Constant Summary
-
Field Summary
Fields inherited from interface net.minecraft.util.StringRepresentable
PRE_BUILT_MAP_THRESHOLD
-
Method Summary
Modifier and TypeMethodDescriptionReturns a list of all types.static net.minecraft.ChatFormatting
Gets ChatFormatting that has the color closest to the color the Pokémon type given.int
getColor()
Returns the type's associated color on GUIs.static Effectiveness
getEffectiveness
(Element t, Element t1) Determines the effectiveness of one type onto another.static Effectiveness
getEffectiveness
(Element t, Element t1, boolean inverse) Determines the effectiveness of one type onto another.Returns the list of valid elementsint
getIndex()
Returns the index of the enum.Returns the localized type name.getName()
Returns the type's name.static Element
getRandomType
(boolean mystery) getRandomTypes
(int count, boolean mystery, boolean unique) static float
getTotalEffectiveness
(List<Element> elements, Element attackType) Determines the effectiveness of an attack on a list of types.static float
getTotalEffectiveness
(List<Element> elements, Element attackType, boolean inverse) Determines the effectiveness of an attack on a list of types.static String[]
getTypeNames
(boolean mystery) static boolean
Determines whether there is a type with a specified name.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.static float
inverseEffectiveness
(float effectiveness) Inverses type effectiveness for an inverse battle.Makes a list of types consisting of the specified type.static Element
parseOrNull
(int index) Gets the type for the given index or returns nullstatic Element
parseOrNull
(String name) Gets a type from its name.static Element
parseType
(int index) Gets a type from its index.static Element
Gets a type from its name.static Element
Returns the enum constant of this class with the specified name.static Element[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from interface com.pixelmonmod.pixelmon.api.util.ITranslatable
getTranslatedName
-
Enum Constant Details
-
NORMAL
-
FIRE
-
WATER
-
ELECTRIC
-
GRASS
-
ICE
-
FIGHTING
-
POISON
-
GROUND
-
FLYING
-
PSYCHIC
-
BUG
-
ROCK
-
GHOST
-
DRAGON
-
DARK
-
STEEL
-
MYSTERY
-
FAIRY
-
-
Field Details
-
textureX
public float textureX -
textureY
public float textureY
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
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
Returns the type's name.- Returns:
- The type's name.
-
getTranslationKey
- Specified by:
getTranslationKey
in interfaceITranslatable
-
getLocalizedName
Returns the localized type name.- Specified by:
getLocalizedName
in interfaceITranslatable
- Returns:
- The localized type name.
-
parseType
Gets a type from its index. ReturnsNORMAL
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
Gets a type from its name. ReturnsNORMAL
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
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
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
Returns a list of all types.- Returns:
- A list of all types.
-
getTotalEffectiveness
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
Determines the effectiveness of one type onto another.- Parameters:
t
- The attacking type.t1
- The defending type.- Returns:
- The type effectiveness matchup.
-
getEffectiveness
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
Makes a list of types consisting of the specified type.- Returns:
- A list of types consisting of the specified type.
-
hasType
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
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
- Specified by:
getSerializedName
in interfacenet.minecraft.util.StringRepresentable
-
getRandomType
-
getRandomTypes
-
getTypeNames
-
getClosestChatFormattingColorForType
Gets ChatFormatting that has the color closest to the color the Pokémon type given.Only to be used with strings. If you can build a Component, it is suggested using code along the line of
-