Package net.minecraft.world.attribute
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 Summary
FieldsModifier and TypeFieldDescriptionprivate final LerpFunction<Value> The field for thekeyframeLerprecord component.private final com.mojang.serialization.Codec<AttributeModifier<Value, ?>> The field for themodifierCodecrecord component.private final Map<AttributeModifier.OperationId, AttributeModifier<Value, ?>> The field for themodifierLibraryrecord component.private final LerpFunction<Value> The field for thepartialTickLerprecord component.private final LerpFunction<Value> The field for thespatialLerprecord component.private final LerpFunction<Value> The field for thestateChangeLerprecord component.private final com.mojang.serialization.Codec<Value> The field for thevalueCodecrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionAttributeType(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 aAttributeTyperecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckAllowedModifier(AttributeModifier<Value, ?> pModifier) private static <Value> com.mojang.serialization.Codec<AttributeModifier<Value, ?>> createModifierCodec(Map<AttributeModifier.OperationId, AttributeModifier<Value, ?>> pModifierLibrary) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thekeyframeLerprecord component.com.mojang.serialization.Codec<AttributeModifier<Value, ?>> Returns the value of themodifierCodecrecord component.Returns the value of themodifierLibraryrecord component.static <Value> AttributeType<Value> ofInterpolated(com.mojang.serialization.Codec<Value> pValueCodec, Map<AttributeModifier.OperationId, AttributeModifier<Value, ?>> pModifierLibrary, LerpFunction<Value> pSpatialLerp) static <Value> AttributeType<Value> ofInterpolated(com.mojang.serialization.Codec<Value> pValueCodec, Map<AttributeModifier.OperationId, AttributeModifier<Value, ?>> pModifierLibrary, LerpFunction<Value> pSpatialLerp, LerpFunction<Value> pPartialTickLerp) static <Value> AttributeType<Value> ofNotInterpolated(com.mojang.serialization.Codec<Value> pValueCodec) static <Value> AttributeType<Value> ofNotInterpolated(com.mojang.serialization.Codec<Value> pValueCodec, Map<AttributeModifier.OperationId, AttributeModifier<Value, ?>> pModifierLibrary) Returns the value of thepartialTickLerprecord component.Returns the value of thespatialLerprecord component.Returns the value of thestateChangeLerprecord component.toString()Returns a string representation of this record class.com.mojang.serialization.Codec<Value> Returns the value of thevalueCodecrecord component.
-
Field Details
-
valueCodec
The field for thevalueCodecrecord component. -
modifierLibrary
The field for themodifierLibraryrecord component. -
modifierCodec
The field for themodifierCodecrecord component. -
keyframeLerp
The field for thekeyframeLerprecord component. -
stateChangeLerp
The field for thestateChangeLerprecord component. -
spatialLerp
The field for thespatialLerprecord component. -
partialTickLerp
The field for thepartialTickLerprecord 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 aAttributeTyperecord class.- Parameters:
valueCodec- the value for thevalueCodecrecord componentmodifierLibrary- the value for themodifierLibraryrecord componentmodifierCodec- the value for themodifierCodecrecord componentkeyframeLerp- the value for thekeyframeLerprecord componentstateChangeLerp- the value for thestateChangeLerprecord componentspatialLerp- the value for thespatialLerprecord componentpartialTickLerp- the value for thepartialTickLerprecord 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
-
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). -
valueCodec
Returns the value of thevalueCodecrecord component.- Returns:
- the value of the
valueCodecrecord component
-
modifierLibrary
Returns the value of themodifierLibraryrecord component.- Returns:
- the value of the
modifierLibraryrecord component
-
modifierCodec
Returns the value of themodifierCodecrecord component.- Returns:
- the value of the
modifierCodecrecord component
-
keyframeLerp
Returns the value of thekeyframeLerprecord component.- Returns:
- the value of the
keyframeLerprecord component
-
stateChangeLerp
Returns the value of thestateChangeLerprecord component.- Returns:
- the value of the
stateChangeLerprecord component
-
spatialLerp
Returns the value of thespatialLerprecord component.- Returns:
- the value of the
spatialLerprecord component
-
partialTickLerp
Returns the value of thepartialTickLerprecord component.- Returns:
- the value of the
partialTickLerprecord component
-