Record Class ConfigurationRegistration<T extends CustomPacketPayload>
java.lang.Object
java.lang.Record
net.neoforged.neoforge.network.registration.ConfigurationRegistration<T>
- Type Parameters:
 T- The type of the payload- Record Components:
 reader- The reader for the payloadhandler- The handler for the payloadversion- The version of the payloadflow- The flow of the payloadoptional- Whether the payload is optional
- All Implemented Interfaces:
 Function<FriendlyByteBuf,,CustomPacketPayload> FriendlyByteBuf.Reader<CustomPacketPayload>,IConfigurationPayloadHandler<CustomPacketPayload>
@Internal
public record ConfigurationRegistration<T extends CustomPacketPayload>(FriendlyByteBuf.Reader<T extends CustomPacketPayload> reader, IConfigurationPayloadHandler<T extends CustomPacketPayload> handler, Optional<String> version, Optional<PacketFlow> flow, boolean optional)
extends Record
implements IConfigurationPayloadHandler<CustomPacketPayload>, FriendlyByteBuf.Reader<CustomPacketPayload>
A record that holds the information needed to describe a registered configuration payload, its reader and handler.
- 
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Optional<PacketFlow>The field for theflowrecord component.private final IConfigurationPayloadHandler<T>The field for thehandlerrecord component.private final booleanThe field for theoptionalrecord component.private final FriendlyByteBuf.Reader<T>The field for thereaderrecord component.The field for theversionrecord component. - 
Constructor Summary
ConstructorsConstructorDescriptionConfigurationRegistration(FriendlyByteBuf.Reader<T> reader, IConfigurationPayloadHandler<T> handler, Optional<String> version, Optional<PacketFlow> flow, boolean optional) Creates an instance of aConfigurationRegistrationrecord class. - 
Method Summary
Modifier and TypeMethodDescriptionapply(FriendlyByteBuf buffer) final booleanIndicates whether some other object is "equal to" this one.flow()Returns the value of theflowrecord component.voidhandle(CustomPacketPayload payload, ConfigurationPayloadContext context) Invoked to handle the given payload in the given context.handler()Returns the value of thehandlerrecord component.final inthashCode()Returns a hash code value for this object.booleanoptional()Returns the value of theoptionalrecord component.reader()Returns the value of thereaderrecord component.final StringtoString()Returns a string representation of this record class.version()Returns the value of theversionrecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.network.FriendlyByteBuf.Reader
asOptional 
- 
Field Details
 - 
Constructor Details
- 
ConfigurationRegistration
public ConfigurationRegistration(FriendlyByteBuf.Reader<T> reader, IConfigurationPayloadHandler<T> handler, Optional<String> version, Optional<PacketFlow> flow, boolean optional) Creates an instance of aConfigurationRegistrationrecord class. 
 - 
 - 
Method Details
- 
handle
Description copied from interface:IConfigurationPayloadHandlerInvoked to handle the given payload in the given context.- Specified by:
 handlein interfaceIConfigurationPayloadHandler<T extends CustomPacketPayload>- Parameters:
 payload- The payload.context- The context.
 - 
apply
- Specified by:
 applyin interfaceFunction<FriendlyByteBuf,CustomPacketPayload> 
 - 
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. - 
reader
Returns the value of thereaderrecord component.- Returns:
 - the value of the 
readerrecord component 
 - 
handler
Returns the value of thehandlerrecord component.- Returns:
 - the value of the 
handlerrecord component 
 - 
version
Returns the value of theversionrecord component.- Returns:
 - the value of the 
versionrecord component 
 - 
flow
Returns the value of theflowrecord component.- Returns:
 - the value of the 
flowrecord component 
 - 
optional
public boolean optional()Returns the value of theoptionalrecord component.- Returns:
 - the value of the 
optionalrecord component 
 
 -