Package net.minecraft.world.timeline
Record Class AttributeTrack<Value,Argument>
java.lang.Object
java.lang.Record
net.minecraft.world.timeline.AttributeTrack<Value,Argument>
public record AttributeTrack<Value,Argument> (AttributeModifier<Value,Argument> modifier, KeyframeTrack<Argument> argumentTrack)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final KeyframeTrack<Argument> The field for theargumentTrackrecord component.private final AttributeModifier<Value, Argument> The field for themodifierrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionAttributeTrack(AttributeModifier<Value, Argument> modifier, KeyframeTrack<Argument> argumentTrack) Creates an instance of aAttributeTrackrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theargumentTrackrecord component.bakeSampler(EnvironmentAttribute<Value> pAttribute, Optional<Integer> pPeriodTicks, LongSupplier pDayTimeGetter) static <Value> com.mojang.serialization.Codec<AttributeTrack<Value, ?>> createCodec(EnvironmentAttribute<Value> pAttribute) private static <Value,Argument>
com.mojang.serialization.MapCodec<AttributeTrack<Value, Argument>> createCodecWithModifier(EnvironmentAttribute<Value> pAttribute, AttributeModifier<Value, Argument> pModifier) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.modifier()Returns the value of themodifierrecord component.final StringtoString()Returns a string representation of this record class.static com.mojang.serialization.DataResult<AttributeTrack<?, ?>> validatePeriod(AttributeTrack<?, ?> pTrack, int pMax)
-
Field Details
-
modifier
The field for themodifierrecord component. -
argumentTrack
The field for theargumentTrackrecord component.
-
-
Constructor Details
-
AttributeTrack
public AttributeTrack(AttributeModifier<Value, Argument> modifier, KeyframeTrack<Argument> argumentTrack) Creates an instance of aAttributeTrackrecord class.- Parameters:
modifier- the value for themodifierrecord componentargumentTrack- the value for theargumentTrackrecord component
-
-
Method Details
-
createCodec
public static <Value> com.mojang.serialization.Codec<AttributeTrack<Value,?>> createCodec(EnvironmentAttribute<Value> pAttribute) -
createCodecWithModifier
private static <Value,Argument> com.mojang.serialization.MapCodec<AttributeTrack<Value,Argument>> createCodecWithModifier(EnvironmentAttribute<Value> pAttribute, AttributeModifier<Value, Argument> pModifier) -
bakeSampler
public AttributeTrackSampler<Value,Argument> bakeSampler(EnvironmentAttribute<Value> pAttribute, Optional<Integer> pPeriodTicks, LongSupplier pDayTimeGetter) -
validatePeriod
public static com.mojang.serialization.DataResult<AttributeTrack<?,?>> validatePeriod(AttributeTrack<?, ?> pTrack, int pMax) -
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). -
modifier
Returns the value of themodifierrecord component.- Returns:
- the value of the
modifierrecord component
-
argumentTrack
Returns the value of theargumentTrackrecord component.- Returns:
- the value of the
argumentTrackrecord component
-