Record Class QueuedPacket.CustomPayload
java.lang.Object
java.lang.Record
net.neoforged.neoforge.network.handling.QueuedPacket.CustomPayload
- All Implemented Interfaces:
QueuedPacket
- Enclosing interface:
QueuedPacket
public static record QueuedPacket.CustomPayload(Runnable task)
extends Record
implements QueuedPacket
-
Nested Class Summary
Nested classes/interfaces inherited from interface QueuedPacket
QueuedPacket.CustomPayload -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCustomPayload(Runnable task) Creates an instance of aCustomPayloadrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.voidhandle()final inthashCode()Returns a hash code value for this object.task()Returns the value of thetaskrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
task
The field for thetaskrecord component.
-
-
Constructor Details
-
CustomPayload
Creates an instance of aCustomPayloadrecord class.- Parameters:
task- the value for thetaskrecord component
-
-
Method Details
-
handle
public void handle()- Specified by:
handlein interfaceQueuedPacket
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
task
Returns the value of thetaskrecord component.- Returns:
- the value of the
taskrecord component
-