Package net.minecraftforge.network
Record Class SimpleChannel.HandlerFlow<BUF extends FriendlyByteBuf,CTX,BASE extends SimplePacket<CTX>>  
java.lang.Object
java.lang.Record
net.minecraftforge.network.SimpleChannel.HandlerFlow<BUF,CTX,BASE>  
- All Implemented Interfaces:
- ChannelBuildable<Object>,- BaseProtocol<SimpleHandlerFlow<BUF,,- BASE>, - SimpleHandlerProtocol<BUF, - BASE>> - SimpleHandlerFlow<BUF,,- BASE> - SimpleHandlerProtocol<BUF,,- BASE> - SimpleBuildable,- SimpleConnection<BASE>,- SimpleChannel.ProtocolFactory<BUF,- BASE> 
- Enclosing class:
- SimpleChannel
private static record SimpleChannel.HandlerFlow<BUF extends FriendlyByteBuf,CTX,BASE extends SimplePacket<CTX>>  (io.netty.util.AttributeKey<CTX> key, SimpleChannel.SimpleContext<BUF extends FriendlyByteBuf,BASE extends SimplePacket<CTX>> ctx)
extends Record
implements SimpleChannel.ProtocolFactory<BUF,BASE>, SimpleHandlerFlow<BUF,BASE>   
- 
Field SummaryFields
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprivateHandlerFlow(io.netty.util.AttributeKey<CTX> key, SimpleChannel.SimpleContext<BUF, BASE> ctx) Creates an instance of aHandlerFlowrecord class.
- 
Method SummaryModifier and TypeMethodDescription<MSG extends BASE>
 SimpleHandlerFlow<BUF, BASE> add(Class<MSG> type, StreamCodec<BUF, MSG> codec) Adds a packet to this channel that has it's protocol validated whenever sent or received.<MSG extends BASE>
 SimpleHandlerFlow<BUF, BASE> add(Class<MSG> type, StreamCodec<BUF, MSG> codec, BiConsumer<MSG, CustomPayloadEvent.Context> handler) Adds a packet to this channel that has it's protocol validated whenever sent or received.<MSG extends BASE>
 SimpleHandlerFlow<BUF, BASE> addMain(Class<MSG> type, StreamCodec<BUF, MSG> codec) Adds a packet to this channel that has it's protocol validated whenever sent or received.ctx()Returns the value of thectxrecord component.final booleanIndicates whether some other object is "equal to" this one.flow(@Nullable PacketFlow flow) final inthashCode()Returns a hash code value for this object.io.netty.util.AttributeKey<CTX> key()Returns the value of thekeyrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraftforge.network.simple.BaseProtocolbidirectional, bidirectional, clientbound, clientbound, flow, flow, serverbound, serverboundMethods inherited from interface net.minecraftforge.network.SimpleChannel.ProtocolFactorybuild, protocol, protocolMethods inherited from interface net.minecraftforge.network.simple.SimpleConnectionany, any, any, any, configuration, configuration, configuration, configuration, login, login, login, login, play, play, play, play, protocol, protocol
- 
Field Details- 
keyThe field for thekeyrecord component.
- 
ctxprivate final SimpleChannel.SimpleContext<BUF extends FriendlyByteBuf,BASE extends SimplePacket<CTX>> ctxThe field for thectxrecord component.
 
- 
- 
Constructor Details- 
HandlerFlowCreates an instance of aHandlerFlowrecord class.- Parameters:
- key- the value for the- keyrecord component
- ctx- the value for the- ctxrecord component
 
 
- 
- 
Method Details- 
addpublic <MSG extends BASE> SimpleHandlerFlow<BUF,BASE> add(Class<MSG> type, StreamCodec<BUF, MSG> codec) Description copied from interface:SimpleHandlerFlowAdds a packet to this channel that has it's protocol validated whenever sent or received.The handler is called on the network thread, and so should not interact with most game state by default. CustomPayloadEvent.Context.enqueueWork(Runnable)can be used to handle the message on the main server or client thread. Alternatively one can useSimpleHandlerFlow.addMain(Class, StreamCodec)to run the handler on the main thread.- Specified by:
- addin interface- SimpleHandlerFlow<BUF extends FriendlyByteBuf,- CTX> 
 
- 
addMainpublic <MSG extends BASE> SimpleHandlerFlow<BUF,BASE> addMain(Class<MSG> type, StreamCodec<BUF, MSG> codec) Description copied from interface:SimpleHandlerFlowAdds a packet to this channel that has it's protocol validated whenever sent or received.Unlike SimpleHandlerFlow.add(Class,StreamCodec), the consumer is called on the main thread, and so can interact with most game state by default.- Specified by:
- addMainin interface- SimpleHandlerFlow<BUF extends FriendlyByteBuf,- CTX> 
 
- 
addpublic <MSG extends BASE> SimpleHandlerFlow<BUF,BASE> add(Class<MSG> type, StreamCodec<BUF, MSG> codec, BiConsumer<MSG, CustomPayloadEvent.Context> handler) Description copied from interface:SimpleHandlerFlowAdds a packet to this channel that has it's protocol validated whenever sent or received.The handler is called on the network thread, and so should not interact with most game state by default. CustomPayloadEvent.Context.enqueueWork(Runnable)can be used to handle the message on the main server or client thread.- Specified by:
- addin interface- SimpleHandlerFlow<BUF extends FriendlyByteBuf,- CTX> 
 
- 
flow- Specified by:
- flowin interface- BaseProtocol<BUF extends FriendlyByteBuf,- CTX> 
 
- 
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).
- 
keyReturns the value of thekeyrecord component.- Returns:
- the value of the keyrecord component
 
- 
ctxReturns the value of thectxrecord component.- Specified by:
- ctxin interface- SimpleChannel.ProtocolFactory<BUF extends FriendlyByteBuf,- CTX> 
- Returns:
- the value of the ctxrecord component
 
 
-