Record Class NetworkRegistry.ServerReplyHandler
java.lang.Object
java.lang.Record
net.neoforged.neoforge.network.registration.NetworkRegistry.ServerReplyHandler
- All Implemented Interfaces:
IReplyHandler
- Enclosing class:
- NetworkRegistry
private static record NetworkRegistry.ServerReplyHandler(ServerCommonPacketListener listener)
extends Record
implements IReplyHandler
-
Field Summary
Modifier and TypeFieldDescriptionprivate final ServerCommonPacketListener
The field for thelistener
record component. -
Constructor Summary
ModifierConstructorDescriptionprivate
ServerReplyHandler
(ServerCommonPacketListener listener) Creates an instance of aServerReplyHandler
record class. -
Method Summary
Modifier and TypeMethodDescriptionvoid
disconnect
(Component reason) Disconnects the player from the network.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.listener()
Returns the value of thelistener
record component.void
send
(CustomPacketPayload payload) Sends the given payload back to the player.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
listener
The field for thelistener
record component.
-
-
Constructor Details
-
ServerReplyHandler
Creates an instance of aServerReplyHandler
record class.- Parameters:
listener
- the value for thelistener
record component
-
-
Method Details
-
send
Description copied from interface:IReplyHandler
Sends the given payload back to the player.- Specified by:
send
in interfaceIReplyHandler
- Parameters:
payload
- The payload to send back.
-
disconnect
Description copied from interface:IReplyHandler
Disconnects the player from the network.- Specified by:
disconnect
in interfaceIReplyHandler
-
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 thelistener
record component.- Returns:
- the value of the
listener
record component
-