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

    Fields
    Modifier and Type
    Field
    Description
    static 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

    Constructors
    Constructor
    Description
    Type(net.minecraft.network.chat.Component name, Color color, TextureProvider icon, List<TypeRelation> relations)
    Creates an instance of a Type record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    calculateInverseEffectiveness(double standardEffectiveness)
     
    Returns the value of the color record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    double
    getEffectivenessAgainst(net.minecraft.core.Holder<Type> element, boolean inverse)
     
    double
    getTotalEffectiveness(List<net.minecraft.core.Holder<Type>> elements)
     
    double
    getTotalEffectiveness(List<net.minecraft.core.Holder<Type>> elements, boolean inverse)
     
    static double
    getTotalEffectiveness(List<net.minecraft.core.Holder<Type>> elements, net.minecraft.core.Holder<Type> attackType, boolean inverse)
     
    final int
    Returns a hash code value for this object.
    Returns the value of the icon record component.
    static List<net.minecraft.core.Holder<Type>>
    ignoreType(net.minecraft.core.RegistryAccess access, List<net.minecraft.core.Holder<Type>> origTypes, net.minecraft.resources.ResourceKey<Type> ignoreType)
     
    net.minecraft.network.chat.Component
    Returns the value of the name record component.
    static net.minecraft.resources.ResourceKey<Type>
     
    Returns the value of the relations record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • DIRECT_CODEC

      public static final com.mojang.serialization.Codec<Type> DIRECT_CODEC
    • CODEC

      public static final com.mojang.serialization.Codec<net.minecraft.core.Holder<Type>> CODEC
    • NORMAL

      public static final net.minecraft.resources.ResourceKey<Type> NORMAL
    • FIRE

      public static final net.minecraft.resources.ResourceKey<Type> FIRE
    • WATER

      public static final net.minecraft.resources.ResourceKey<Type> WATER
    • ELECTRIC

      public static final net.minecraft.resources.ResourceKey<Type> ELECTRIC
    • GRASS

      public static final net.minecraft.resources.ResourceKey<Type> GRASS
    • ICE

      public static final net.minecraft.resources.ResourceKey<Type> ICE
    • FIGHTING

      public static final net.minecraft.resources.ResourceKey<Type> FIGHTING
    • POISON

      public static final net.minecraft.resources.ResourceKey<Type> POISON
    • GROUND

      public static final net.minecraft.resources.ResourceKey<Type> GROUND
    • FLYING

      public static final net.minecraft.resources.ResourceKey<Type> FLYING
    • PSYCHIC

      public static final net.minecraft.resources.ResourceKey<Type> PSYCHIC
    • BUG

      public static final net.minecraft.resources.ResourceKey<Type> BUG
    • ROCK

      public static final net.minecraft.resources.ResourceKey<Type> ROCK
    • GHOST

      public static final net.minecraft.resources.ResourceKey<Type> GHOST
    • DRAGON

      public static final net.minecraft.resources.ResourceKey<Type> DRAGON
    • DARK

      public static final net.minecraft.resources.ResourceKey<Type> DARK
    • STEEL

      public static final net.minecraft.resources.ResourceKey<Type> STEEL
    • MYSTERY

      public static final net.minecraft.resources.ResourceKey<Type> MYSTERY
    • FAIRY

      public static final net.minecraft.resources.ResourceKey<Type> FAIRY
    • STELLAR

      public static final net.minecraft.resources.ResourceKey<Type> STELLAR
  • Constructor Details

    • Type

      public Type(net.minecraft.network.chat.Component name, Color color, TextureProvider icon, List<TypeRelation> relations)
      Creates an instance of a Type record class.
      Parameters:
      name - the value for the name record component
      color - the value for the color record component
      icon - the value for the icon record component
      relations - the value for the relations record component
  • Method Details

    • getTotalEffectiveness

      public double getTotalEffectiveness(List<net.minecraft.core.Holder<Type>> elements)
    • getTotalEffectiveness

      public double getTotalEffectiveness(List<net.minecraft.core.Holder<Type>> elements, boolean inverse)
    • getEffectivenessAgainst

      public double getEffectivenessAgainst(net.minecraft.core.Holder<Type> element, boolean inverse)
    • calculateInverseEffectiveness

      public static double calculateInverseEffectiveness(double standardEffectiveness)
    • parseOrNull

      public static net.minecraft.resources.ResourceKey<Type> parseOrNull(String type)
    • getTotalEffectiveness

      public static double getTotalEffectiveness(List<net.minecraft.core.Holder<Type>> elements, net.minecraft.core.Holder<Type> attackType, boolean inverse)
    • ignoreType

      public static List<net.minecraft.core.Holder<Type>> ignoreType(net.minecraft.core.RegistryAccess access, List<net.minecraft.core.Holder<Type>> origTypes, net.minecraft.resources.ResourceKey<Type> ignoreType)
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      public net.minecraft.network.chat.Component name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • color

      public Color color()
      Returns the value of the color record component.
      Returns:
      the value of the color record component
    • icon

      public TextureProvider icon()
      Returns the value of the icon record component.
      Returns:
      the value of the icon record component
    • relations

      public List<TypeRelation> relations()
      Returns the value of the relations record component.
      Returns:
      the value of the relations record component