Record Class Type
java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.api.pokemon.type.Type
public record Type(net.minecraft.network.chat.Component name, Color color, TextureProvider icon, List<TypeRelation> relations)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.minecraft.resources.ResourceKey<Type> static final com.mojang.serialization.Codec<net.minecraft.core.Holder<Type>> static final net.minecraft.resources.ResourceKey<Type> static final com.mojang.serialization.Codec<Type> static final net.minecraft.resources.ResourceKey<Type> static final net.minecraft.resources.ResourceKey<Type> static final net.minecraft.resources.ResourceKey<Type> static final net.minecraft.resources.ResourceKey<Type> static final net.minecraft.resources.ResourceKey<Type> static final net.minecraft.resources.ResourceKey<Type> static final net.minecraft.resources.ResourceKey<Type> static final net.minecraft.resources.ResourceKey<Type> static final net.minecraft.resources.ResourceKey<Type> static final net.minecraft.resources.ResourceKey<Type> static final net.minecraft.resources.ResourceKey<Type> static final net.minecraft.resources.ResourceKey<Type> static final net.minecraft.resources.ResourceKey<Type> static final net.minecraft.resources.ResourceKey<Type> static final net.minecraft.resources.ResourceKey<Type> static final net.minecraft.resources.ResourceKey<Type> static final net.minecraft.resources.ResourceKey<Type> static final net.minecraft.resources.ResourceKey<Type> -
Constructor Summary
ConstructorsConstructorDescriptionType(net.minecraft.network.chat.Component name, Color color, TextureProvider icon, List<TypeRelation> relations) Creates an instance of aTyperecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic doublecalculateInverseEffectiveness(double standardEffectiveness) color()Returns the value of thecolorrecord component.final booleanIndicates whether some other object is "equal to" this one.doublegetEffectivenessAgainst(net.minecraft.core.Holder<Type> element, boolean inverse) doublegetTotalEffectiveness(List<net.minecraft.core.Holder<Type>> elements) doublegetTotalEffectiveness(List<net.minecraft.core.Holder<Type>> elements, boolean inverse) static doublegetTotalEffectiveness(List<net.minecraft.core.Holder<Type>> elements, net.minecraft.core.Holder<Type> attackType, boolean inverse) final inthashCode()Returns a hash code value for this object.icon()Returns the value of theiconrecord component.ignoreType(net.minecraft.core.RegistryAccess access, List<net.minecraft.core.Holder<Type>> origTypes, net.minecraft.resources.ResourceKey<Type> ignoreType) net.minecraft.network.chat.Componentname()Returns the value of thenamerecord component.static net.minecraft.resources.ResourceKey<Type> parseOrNull(String type) Returns the value of therelationsrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DIRECT_CODEC
-
CODEC
-
NORMAL
-
FIRE
-
WATER
-
ELECTRIC
-
GRASS
-
ICE
-
FIGHTING
-
POISON
-
GROUND
-
FLYING
-
PSYCHIC
-
BUG
-
ROCK
-
GHOST
-
DRAGON
-
DARK
-
STEEL
-
MYSTERY
-
FAIRY
-
STELLAR
-
-
Constructor Details
-
Type
public Type(net.minecraft.network.chat.Component name, Color color, TextureProvider icon, List<TypeRelation> relations) Creates an instance of aTyperecord class.- Parameters:
name- the value for thenamerecord componentcolor- the value for thecolorrecord componenticon- the value for theiconrecord componentrelations- the value for therelationsrecord component
-
-
Method Details
-
getTotalEffectiveness
-
getTotalEffectiveness
-
getEffectivenessAgainst
-
calculateInverseEffectiveness
public static double calculateInverseEffectiveness(double standardEffectiveness) -
parseOrNull
-
getTotalEffectiveness
-
ignoreType
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
name
public net.minecraft.network.chat.Component name()Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
color
Returns the value of thecolorrecord component.- Returns:
- the value of the
colorrecord component
-
icon
Returns the value of theiconrecord component.- Returns:
- the value of the
iconrecord component
-
relations
Returns the value of therelationsrecord component.- Returns:
- the value of the
relationsrecord component
-