Record Class AttributeType<Value>

java.lang.Object
java.lang.Record
net.minecraft.world.attribute.AttributeType<Value>

public record AttributeType<Value>(com.mojang.serialization.Codec<Value> valueCodec, Map<AttributeModifier.OperationId,AttributeModifier<Value,?>> modifierLibrary, com.mojang.serialization.Codec<AttributeModifier<Value,?>> modifierCodec, LerpFunction<Value> keyframeLerp, LerpFunction<Value> stateChangeLerp, LerpFunction<Value> spatialLerp, LerpFunction<Value> partialTickLerp) extends Record
  • Field Details

    • valueCodec

      private final com.mojang.serialization.Codec<Value> valueCodec
      The field for the valueCodec record component.
    • modifierLibrary

      private final Map<AttributeModifier.OperationId,AttributeModifier<Value,?>> modifierLibrary
      The field for the modifierLibrary record component.
    • modifierCodec

      private final com.mojang.serialization.Codec<AttributeModifier<Value,?>> modifierCodec
      The field for the modifierCodec record component.
    • keyframeLerp

      private final LerpFunction<Value> keyframeLerp
      The field for the keyframeLerp record component.
    • stateChangeLerp

      private final LerpFunction<Value> stateChangeLerp
      The field for the stateChangeLerp record component.
    • spatialLerp

      private final LerpFunction<Value> spatialLerp
      The field for the spatialLerp record component.
    • partialTickLerp

      private final LerpFunction<Value> partialTickLerp
      The field for the partialTickLerp record component.
  • Constructor Details

    • AttributeType

      public AttributeType(com.mojang.serialization.Codec<Value> valueCodec, Map<AttributeModifier.OperationId,AttributeModifier<Value,?>> modifierLibrary, com.mojang.serialization.Codec<AttributeModifier<Value,?>> modifierCodec, LerpFunction<Value> keyframeLerp, LerpFunction<Value> stateChangeLerp, LerpFunction<Value> spatialLerp, LerpFunction<Value> partialTickLerp)
      Creates an instance of a AttributeType record class.
      Parameters:
      valueCodec - the value for the valueCodec record component
      modifierLibrary - the value for the modifierLibrary record component
      modifierCodec - the value for the modifierCodec record component
      keyframeLerp - the value for the keyframeLerp record component
      stateChangeLerp - the value for the stateChangeLerp record component
      spatialLerp - the value for the spatialLerp record component
      partialTickLerp - the value for the partialTickLerp record component
  • Method Details

    • ofInterpolated

      public static <Value> AttributeType<Value> ofInterpolated(com.mojang.serialization.Codec<Value> pValueCodec, Map<AttributeModifier.OperationId,AttributeModifier<Value,?>> pModifierLibrary, LerpFunction<Value> pSpatialLerp)
    • ofInterpolated

      public static <Value> AttributeType<Value> ofInterpolated(com.mojang.serialization.Codec<Value> pValueCodec, Map<AttributeModifier.OperationId,AttributeModifier<Value,?>> pModifierLibrary, LerpFunction<Value> pSpatialLerp, LerpFunction<Value> pPartialTickLerp)
    • ofNotInterpolated

      public static <Value> AttributeType<Value> ofNotInterpolated(com.mojang.serialization.Codec<Value> pValueCodec, Map<AttributeModifier.OperationId,AttributeModifier<Value,?>> pModifierLibrary)
    • ofNotInterpolated

      public static <Value> AttributeType<Value> ofNotInterpolated(com.mojang.serialization.Codec<Value> pValueCodec)
    • createModifierCodec

      private static <Value> com.mojang.serialization.Codec<AttributeModifier<Value,?>> createModifierCodec(Map<AttributeModifier.OperationId,AttributeModifier<Value,?>> pModifierLibrary)
    • checkAllowedModifier

      public void checkAllowedModifier(AttributeModifier<Value,?> pModifier)
    • toString

      public 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.
    • valueCodec

      public com.mojang.serialization.Codec<Value> valueCodec()
      Returns the value of the valueCodec record component.
      Returns:
      the value of the valueCodec record component
    • modifierLibrary

      Returns the value of the modifierLibrary record component.
      Returns:
      the value of the modifierLibrary record component
    • modifierCodec

      public com.mojang.serialization.Codec<AttributeModifier<Value,?>> modifierCodec()
      Returns the value of the modifierCodec record component.
      Returns:
      the value of the modifierCodec record component
    • keyframeLerp

      public LerpFunction<Value> keyframeLerp()
      Returns the value of the keyframeLerp record component.
      Returns:
      the value of the keyframeLerp record component
    • stateChangeLerp

      public LerpFunction<Value> stateChangeLerp()
      Returns the value of the stateChangeLerp record component.
      Returns:
      the value of the stateChangeLerp record component
    • spatialLerp

      public LerpFunction<Value> spatialLerp()
      Returns the value of the spatialLerp record component.
      Returns:
      the value of the spatialLerp record component
    • partialTickLerp

      public LerpFunction<Value> partialTickLerp()
      Returns the value of the partialTickLerp record component.
      Returns:
      the value of the partialTickLerp record component