public enum Element extends java.lang.Enum<Element> implements ITranslatable, net.minecraft.util.IStringSerializable
Modifier and Type | Class and Description |
---|---|
static class |
Element.TypeAdapter |
Enum Constant and Description |
---|
BUG |
DARK |
DRAGON |
ELECTRIC |
FAIRY |
FIGHTING |
FIRE |
FLYING |
GHOST |
GRASS |
GROUND |
ICE |
MYSTERY |
NORMAL |
POISON |
PSYCHIC |
ROCK |
STEEL |
WATER |
Modifier and Type | Method and Description |
---|---|
static java.util.List<Element> |
getAllTypes()
Returns a list of all types.
|
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.
|
static java.util.Set<Element> |
getElements()
Returns the list of valid elements
|
int |
getIndex()
Returns the index of the enum.
|
java.lang.String |
getLocalizedName()
Returns the localized type name.
|
java.lang.String |
getName()
Returns the type's name.
|
static Element |
getRandomType(boolean mystery) |
static java.util.List<Element> |
getRandomTypes(int count,
boolean mystery,
boolean unique) |
java.lang.String |
getSerializedName() |
static float |
getTotalEffectiveness(java.util.List<Element> elements,
Element attackType)
Determines the effectiveness of an attack on a list of types.
|
static float |
getTotalEffectiveness(java.util.List<Element> elements,
Element attackType,
boolean inverse)
Determines the effectiveness of an attack on a list of types.
|
java.lang.String |
getTranslationKey() |
static java.lang.String[] |
getTypeNames(boolean mystery) |
static boolean |
hasType(java.lang.String name)
Determines whether there is a type with a specified name.
|
static java.util.List<Element> |
ignoreType(java.util.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.
|
java.util.List<Element> |
makeTypeList()
Makes a list of types consisting of the specified type.
|
static Element |
parseOrNull(int index)
Gets the type for the given index or returns null
|
static Element |
parseOrNull(java.lang.String name)
Gets a type from its name.
|
static Element |
parseType(int index)
Gets a type from its index.
|
static Element |
parseType(java.lang.String name)
Gets a type from its name.
|
static Element |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Element[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
getTranslatedName
public static final Element NORMAL
public static final Element FIRE
public static final Element WATER
public static final Element ELECTRIC
public static final Element GRASS
public static final Element ICE
public static final Element FIGHTING
public static final Element POISON
public static final Element GROUND
public static final Element FLYING
public static final Element PSYCHIC
public static final Element BUG
public static final Element ROCK
public static final Element GHOST
public static final Element DRAGON
public static final Element DARK
public static final Element STEEL
public static final Element MYSTERY
public static final Element FAIRY
public static Element[] values()
for (Element c : Element.values()) System.out.println(c);
public static Element valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static java.util.Set<Element> getElements()
public int getColor()
public java.lang.String getName()
public java.lang.String getTranslationKey()
getTranslationKey
in interface ITranslatable
public java.lang.String getLocalizedName()
getLocalizedName
in interface ITranslatable
public static Element parseType(int index)
NORMAL
if not foundindex
- The index of the type.public static Element parseType(java.lang.String name)
NORMAL
if not foundname
- The name of the type.public static Element parseOrNull(int index)
index
- The index of the typepublic static Element parseOrNull(java.lang.String name)
name
- The name of the type.public static java.util.List<Element> getAllTypes()
public static float getTotalEffectiveness(java.util.List<Element> elements, Element attackType)
elements
- The defending types.attackType
- The attacking type.public static float getTotalEffectiveness(java.util.List<Element> elements, Element attackType, boolean inverse)
elements
- The defending types.attackType
- The attacking type.inverse
- Whether topublic static float inverseEffectiveness(float effectiveness)
effectiveness
- The original type effectiveness before inversing it.public static Effectiveness getEffectiveness(Element t, Element t1)
t
- The attacking type.t1
- The defending type.public static Effectiveness getEffectiveness(Element t, Element t1, boolean inverse)
t
- The attacking type.t1
- The defending type.inverse
- Is inversed typingspublic int getIndex()
public java.util.List<Element> makeTypeList()
public static boolean hasType(java.lang.String name)
name
- The type to find.public static java.util.List<Element> ignoreType(java.util.List<Element> origTypes, Element ignoreType)
origTypes
- The original types.ignoreType
- The type to ignore.public java.lang.String getSerializedName()
getSerializedName
in interface net.minecraft.util.IStringSerializable
public static Element getRandomType(boolean mystery)
public static java.util.List<Element> getRandomTypes(int count, boolean mystery, boolean unique)
public static java.lang.String[] getTypeNames(boolean mystery)