Record Class TimerQueue.Event.Packed<T>
java.lang.Object
java.lang.Record
net.minecraft.world.level.timers.TimerQueue.Event.Packed<T>
- Enclosing class:
TimerQueue.Event<T>
public static record TimerQueue.Event.Packed<T>(long triggerTime, String id, TimerCallback<T> callback)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final TimerCallback<T> The field for thecallbackrecord component.private final StringThe field for theidrecord component.private final longThe field for thetriggerTimerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionPacked(long triggerTime, String id, TimerCallback<T> callback) Creates an instance of aPackedrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncallback()Returns the value of thecallbackrecord component.static <T> com.mojang.serialization.Codec<TimerQueue.Event.Packed<T>> codec(com.mojang.serialization.Codec<TimerCallback<T>> callbackCodec) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.final StringtoString()Returns a string representation of this record class.longReturns the value of thetriggerTimerecord component.
-
Field Details
-
triggerTime
private final long triggerTimeThe field for thetriggerTimerecord component. -
id
The field for theidrecord component. -
callback
The field for thecallbackrecord component.
-
-
Constructor Details
-
Packed
Creates an instance of aPackedrecord class.- Parameters:
triggerTime- the value for thetriggerTimerecord componentid- the value for theidrecord componentcallback- the value for thecallbackrecord component
-
-
Method Details
-
codec
public static <T> com.mojang.serialization.Codec<TimerQueue.Event.Packed<T>> codec(com.mojang.serialization.Codec<TimerCallback<T>> callbackCodec) -
toString
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
triggerTime
public long triggerTime()Returns the value of thetriggerTimerecord component.- Returns:
- the value of the
triggerTimerecord component
-
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
callback
Returns the value of thecallbackrecord component.- Returns:
- the value of the
callbackrecord component
-