Record Class ModdedPlayPayloadRegistration<T extends CustomPacketPayload>
java.lang.Object
java.lang.Record
net.neoforged.neoforge.network.registration.ModdedPlayPayloadRegistration<T>
- Type Parameters:
T- The type of payload.- Record Components:
id- The id of the payload.type- The type of payload.handler- The handler for the payload.reader- The reader for the payload.
@Internal
public record ModdedPlayPayloadRegistration<T extends CustomPacketPayload>(Identifier id, Class<T extends CustomPacketPayload> type, IPayloadHandler<T extends CustomPacketPayload> handler, StreamCodec<RegistryFriendlyByteBuf, T extends CustomPacketPayload> reader)
extends Record
Registration for a custom packet payload.
This type holds the negotiated preferredVersion of the payload to use, and the handler for it.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final IPayloadHandler<T> The field for thehandlerrecord component.private final IdentifierThe field for theidrecord component.private final StreamCodec<RegistryFriendlyByteBuf, T> The field for thereaderrecord component.The field for thetyperecord component. -
Constructor Summary
ConstructorsConstructorDescriptionModdedPlayPayloadRegistration(Identifier id, Class<T> type, IPayloadHandler<T> handler, StreamCodec<RegistryFriendlyByteBuf, T> reader) Creates an instance of aModdedPlayPayloadRegistrationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.handler()Returns the value of thehandlerrecord component.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.reader()Returns the value of thereaderrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Field Details
-
Constructor Details
-
ModdedPlayPayloadRegistration
public ModdedPlayPayloadRegistration(Identifier id, Class<T> type, IPayloadHandler<T> handler, StreamCodec<RegistryFriendlyByteBuf, T> reader) Creates an instance of aModdedPlayPayloadRegistrationrecord class.
-
-
Method Details
-
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). -
id
-
type
-
handler
-
reader
-