Package net.minecraftforge.network
Record Class PayloadChannel.Message<MSG extends CustomPacketPayload,BUF extends FriendlyByteBuf> 
java.lang.Object
java.lang.Record
net.minecraftforge.network.PayloadChannel.Message<MSG,BUF> 
- Enclosing class:
- PayloadChannel
private static record PayloadChannel.Message<MSG extends CustomPacketPayload,BUF extends FriendlyByteBuf> (CustomPacketPayload.Type<MSG extends CustomPacketPayload> type, @Nullable NetworkProtocol<BUF extends FriendlyByteBuf> protocol, @Nullable PacketFlow direction, StreamCodec<BUF extends FriendlyByteBuf,MSG extends CustomPacketPayload> codec, BiConsumer<MSG extends CustomPacketPayload,CustomPayloadEvent.Context> consumer)
extends Record  
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final StreamCodec<BUF, MSG> The field for thecodecrecord component.private final BiConsumer<MSG, CustomPayloadEvent.Context> The field for theconsumerrecord component.private final @Nullable PacketFlowThe field for thedirectionrecord component.private final @Nullable NetworkProtocol<BUF> The field for theprotocolrecord component.private final CustomPacketPayload.Type<MSG> The field for thetyperecord component.
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprivateMessage(CustomPacketPayload.Type<MSG> type, @Nullable NetworkProtocol<BUF> protocol, @Nullable PacketFlow direction, StreamCodec<BUF, MSG> codec, BiConsumer<MSG, CustomPayloadEvent.Context> consumer) Creates an instance of aMessagerecord class.
- 
Method SummaryModifier and TypeMethodDescriptioncodec()Returns the value of thecodecrecord component.consumer()Returns the value of theconsumerrecord component.@Nullable PacketFlowReturns the value of thedirectionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@Nullable NetworkProtocol<BUF> protocol()Returns the value of theprotocolrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
- 
Field Details- 
typeThe field for thetyperecord component.
- 
protocolThe field for theprotocolrecord component.
- 
directionThe field for thedirectionrecord component.
- 
codecThe field for thecodecrecord component.
- 
consumerThe field for theconsumerrecord component.
 
- 
- 
Constructor Details- 
Messageprivate Message(CustomPacketPayload.Type<MSG> type, @Nullable @Nullable NetworkProtocol<BUF> protocol, @Nullable @Nullable PacketFlow direction, StreamCodec<BUF, MSG> codec, BiConsumer<MSG, CustomPayloadEvent.Context> consumer) Creates an instance of aMessagerecord class.- Parameters:
- type- the value for the- typerecord component
- protocol- the value for the- protocolrecord component
- direction- the value for the- directionrecord component
- codec- the value for the- codecrecord component
- consumer- the value for the- consumerrecord component
 
 
- 
- 
Method Details- 
toStringReturns 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.
- 
hashCodepublic 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.
- 
equalsIndicates 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).
- 
typeReturns the value of thetyperecord component.- Returns:
- the value of the typerecord component
 
- 
protocolReturns the value of theprotocolrecord component.- Returns:
- the value of the protocolrecord component
 
- 
directionReturns the value of thedirectionrecord component.- Returns:
- the value of the directionrecord component
 
- 
codecReturns the value of thecodecrecord component.- Returns:
- the value of the codecrecord component
 
- 
consumerReturns the value of theconsumerrecord component.- Returns:
- the value of the consumerrecord component
 
 
-