Record Class ExpirableValue<T>
java.lang.Object
java.lang.Record
net.minecraft.world.entity.ai.memory.ExpirableValue<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for thetimeToLiverecord component.private final TThe field for thevaluerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionExpirableValue(T value, Optional<Long> timeToLive) Creates an instance of aExpirableValuerecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> com.mojang.serialization.Codec<ExpirableValue<T>> codec(com.mojang.serialization.Codec<T> valueCodec) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static <T> ExpirableValue<T> of(T value) static <T> ExpirableValue<T> of(T value, long ticksUntilExpiry) Returns the value of thetimeToLiverecord component.toString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
-
Field Details
-
value
The field for thevaluerecord component. -
timeToLive
-
-
Constructor Details
-
ExpirableValue
-
-
Method Details
-
of
-
of
-
toString
-
codec
public static <T> com.mojang.serialization.Codec<ExpirableValue<T>> codec(com.mojang.serialization.Codec<T> valueCodec) -
hashCode
-
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). -
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-
timeToLive
-