Record Class NetworkRegistry.ClientPacketHandler
java.lang.Object
java.lang.Record
net.neoforged.neoforge.network.registration.NetworkRegistry.ClientPacketHandler
- All Implemented Interfaces:
 IPacketHandler
- Enclosing class:
 - NetworkRegistry
 
private static record NetworkRegistry.ClientPacketHandler(ClientCommonPacketListener listener)
extends Record
implements IPacketHandler
- 
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClientCommonPacketListenerThe field for thelistenerrecord component. - 
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateCreates an instance of aClientPacketHandlerrecord class. - 
Method Summary
Modifier and TypeMethodDescriptionvoiddisconnect(Component reason) Trigger a disconnect from the network.final booleanIndicates whether some other object is "equal to" this one.voidhandle(CustomPacketPayload payload) Invoked to handle the given custom payload.voidInvoked to handle the given packet.final inthashCode()Returns a hash code value for this object.listener()Returns the value of thelistenerrecord component.private static <T extends PacketListener>
voidresolvePacketGenerics(Packet<T> packet, ClientCommonPacketListener listener) final StringtoString()Returns a string representation of this record class. 
- 
Field Details
- 
listener
The field for thelistenerrecord component. 
 - 
 - 
Constructor Details
- 
ClientPacketHandler
Creates an instance of aClientPacketHandlerrecord class.- Parameters:
 listener- the value for thelistenerrecord component
 
 - 
 - 
Method Details
- 
handle
Description copied from interface:IPacketHandlerInvoked to handle the given packet.- Specified by:
 handlein interfaceIPacketHandler- Parameters:
 packet- The packet.
 - 
handle
Description copied from interface:IPacketHandlerInvoked to handle the given custom payload.- Specified by:
 handlein interfaceIPacketHandler- Parameters:
 payload- The payload.
 - 
disconnect
Description copied from interface:IPacketHandlerTrigger a disconnect from the network.- Specified by:
 disconnectin interfaceIPacketHandler- Parameters:
 reason- The reason for the disconnect.
 - 
resolvePacketGenerics
private static <T extends PacketListener> void resolvePacketGenerics(Packet<T> packet, ClientCommonPacketListener listener)  - 
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 
 
 -