Package net.minecraft.network
Record Class PacketProcessor.ListenerAndPacket<T extends PacketListener>
java.lang.Object
java.lang.Record
net.minecraft.network.PacketProcessor.ListenerAndPacket<T>
- All Implemented Interfaces:
QueuedPacket
- Enclosing class:
PacketProcessor
static record PacketProcessor.ListenerAndPacket<T extends PacketListener>(T extends PacketListener listener, Packet<T extends PacketListener> packet)
extends Record
implements QueuedPacket
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.neoforged.neoforge.network.handling.QueuedPacket
QueuedPacket.CustomPayload -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionListenerAndPacket(T listener, Packet<T> packet) Creates an instance of aListenerAndPacketrecord 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.listener()Returns the value of thelistenerrecord component.packet()Returns the value of thepacketrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
listener
The field for thelistenerrecord component. -
packet
The field for thepacketrecord component.
-
-
Constructor Details
-
ListenerAndPacket
Creates an instance of aListenerAndPacketrecord class.- Parameters:
listener- the value for thelistenerrecord componentpacket- the value for thepacketrecord component
-
-
Method Details
-
handle
public void handle()- Specified by:
handlein interfaceQueuedPacket
-
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). -
listener
Returns the value of thelistenerrecord component.- Returns:
- the value of the
listenerrecord component
-
packet
Returns the value of thepacketrecord component.- Returns:
- the value of the
packetrecord component
-