Package net.minecraftforge.network
Record Class SimpleChannel.Message<MSG,BUF extends FriendlyByteBuf> 
java.lang.Object
java.lang.Record
net.minecraftforge.network.SimpleChannel.Message<MSG,BUF> 
- Enclosing class:
- SimpleChannel
protected static record SimpleChannel.Message<MSG,BUF extends FriendlyByteBuf> (int index, Class<MSG> type, NetworkProtocol<BUF extends FriendlyByteBuf> protocol, PacketFlow direction, BiConsumer<MSG,BUF extends FriendlyByteBuf> encoder, Function<BUF extends FriendlyByteBuf,MSG> decoder, BiConsumer<MSG,CustomPayloadEvent.Context> consumer)
extends Record   
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final BiConsumer<MSG, CustomPayloadEvent.Context> The field for theconsumerrecord component.The field for thedecoderrecord component.private final PacketFlowThe field for thedirectionrecord component.private final BiConsumer<MSG, BUF> The field for theencoderrecord component.private final intThe field for theindexrecord component.private final NetworkProtocol<BUF> The field for theprotocolrecord component.The field for thetyperecord component.
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedMessage(int index, Class<MSG> type, NetworkProtocol<BUF> protocol, PacketFlow direction, BiConsumer<MSG, BUF> encoder, Function<BUF, MSG> decoder, BiConsumer<MSG, CustomPayloadEvent.Context> consumer) Creates an instance of aMessagerecord class.
- 
Method SummaryModifier and TypeMethodDescriptionconsumer()Returns the value of theconsumerrecord component.decoder()Returns the value of thedecoderrecord component.Returns the value of thedirectionrecord component.encoder()Returns the value of theencoderrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intindex()Returns the value of theindexrecord component.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- 
indexprivate final int indexThe field for theindexrecord component.
- 
typeThe field for thetyperecord component.
- 
protocolThe field for theprotocolrecord component.
- 
directionThe field for thedirectionrecord component.
- 
encoderThe field for theencoderrecord component.
- 
decoderThe field for thedecoderrecord component.
- 
consumerThe field for theconsumerrecord component.
 
- 
- 
Constructor Details- 
Messageprotected Message(int index, Class<MSG> type, NetworkProtocol<BUF> protocol, PacketFlow direction, BiConsumer<MSG, BUF> encoder, Function<BUF, MSG> decoder, BiConsumer<MSG, CustomPayloadEvent.Context> consumer) Creates an instance of aMessagerecord class.- Parameters:
- index- the value for the- indexrecord component
- type- the value for the- typerecord component
- protocol- the value for the- protocolrecord component
- direction- the value for the- directionrecord component
- encoder- the value for the- encoderrecord component
- decoder- the value for the- decoderrecord 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='.
- 
indexpublic int index()Returns the value of theindexrecord component.- Returns:
- the value of the indexrecord component
 
- 
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
 
- 
encoderReturns the value of theencoderrecord component.- Returns:
- the value of the encoderrecord component
 
- 
decoderReturns the value of thedecoderrecord component.- Returns:
- the value of the decoderrecord component
 
- 
consumerReturns the value of theconsumerrecord component.- Returns:
- the value of the consumerrecord component
 
 
-