Package net.minecraftforge.network
Record Class SimpleChannel.Message<MSG>
java.lang.Object
java.lang.Record
net.minecraftforge.network.SimpleChannel.Message<MSG>
- Enclosing class:
- SimpleChannel
private static record SimpleChannel.Message<MSG>(int index, Class<MSG> type, Optional<NetworkDirection> direction, BiConsumer<MSG,FriendlyByteBuf> encoder, Function<FriendlyByteBuf,MSG> decoder, BiConsumer<MSG,CustomPayloadEvent.Context> consumer)
extends Record   
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final BiConsumer<MSG,CustomPayloadEvent.Context> The field for theconsumerrecord component.private final Function<FriendlyByteBuf,MSG> The field for thedecoderrecord component.private final Optional<NetworkDirection>The field for thedirectionrecord component.private final BiConsumer<MSG,FriendlyByteBuf> The field for theencoderrecord component.private final intThe field for theindexrecord component.The field for thetyperecord component.
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprivateMessage(int index, Class<MSG> type, Optional<NetworkDirection> direction, BiConsumer<MSG, FriendlyByteBuf> encoder, Function<FriendlyByteBuf, 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.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.
- 
directionThe field for thedirectionrecord component.
- 
encoderThe field for theencoderrecord component.
- 
decoderThe field for thedecoderrecord component.
- 
consumerThe field for theconsumerrecord component.
 
- 
- 
Constructor Details- 
Messageprivate Message(int index, Class<MSG> type, Optional<NetworkDirection> direction, BiConsumer<MSG, FriendlyByteBuf> encoder, Function<FriendlyByteBuf, 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
- 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
 
- 
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
 
 
-