记录类 PayloadChannel.Builder.HandlerFlow<BUF extends FriendlyByteBuf,CTX,BASE extends CustomPacketPayload & SimplePacket<CTX>>
java.lang.Object
java.lang.Record
net.minecraftforge.network.PayloadChannel.Builder.HandlerFlow<BUF,CTX,BASE>
- 所有已实现的接口:
ChannelBuildable<CustomPacketPayload>
,PayloadHandlerFlow<BUF,
,BASE> PayloadHandlerProtocol<BUF,
,BASE> PayloadConnection<BASE>
,PayloadChannel.Builder.ProtocolFactory<BUF,
,BASE> BaseProtocol<PayloadHandlerFlow<BUF,
BASE>, PayloadHandlerProtocol<BUF, BASE>>
private static record PayloadChannel.Builder.HandlerFlow<BUF extends FriendlyByteBuf,CTX,BASE extends CustomPacketPayload & SimplePacket<CTX>> (io.netty.util.AttributeKey<CTX> key, PayloadChannel.Builder.BuilderContext<BUF extends FriendlyByteBuf,BASE extends CustomPacketPayload & SimplePacket<CTX>> ctx)
extends Record
implements PayloadChannel.Builder.ProtocolFactory<BUF,BASE>, PayloadHandlerFlow<BUF,BASE>
-
字段概要
字段 -
构造器概要
构造器限定符构造器说明private
HandlerFlow
(io.netty.util.AttributeKey<CTX> key, PayloadChannel.Builder.BuilderContext<BUF, BASE> ctx) 创建HandlerFlow
记录类的实例。 -
方法概要
修饰符和类型方法说明<MSG extends BASE>
PayloadHandlerFlow<BUF, BASE> add
(CustomPacketPayload.Type<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>
PayloadHandlerFlow<BUF, BASE> add
(CustomPacketPayload.Type<MSG> type, StreamCodec<BUF, MSG> codec, BiConsumer<MSG, CustomPayloadEvent.Context> consumer) Adds a packet to this channel that has it's protocol validated whenever sent or received.<MSG extends BASE>
PayloadHandlerFlow<BUF, BASE> addMain
(CustomPacketPayload.Type<MSG> type, StreamCodec<BUF, MSG> codec) Adds a packet to this channel that has it's protocol validated whenever sent or received.ctx()
返回ctx
记录组件的值。final boolean
指示某个其他对象是否“等于”此对象。flow
(@Nullable PacketFlow flow) final int
hashCode()
返回此对象的哈希代码值。io.netty.util.AttributeKey
<CTX> key()
返回key
记录组件的值。final String
toString()
返回此记录类的字符串表示形式。从接口继承的方法 net.minecraftforge.network.simple.BaseProtocol
bidirectional, bidirectional, clientbound, clientbound, flow, flow, serverbound, serverbound
从接口继承的方法 net.minecraftforge.network.PayloadChannel.Builder.ProtocolFactory
build, protocol, protocol
从接口继承的方法 net.minecraftforge.network.payload.PayloadConnection
any, any, any, any, configuration, configuration, configuration, configuration, login, login, login, login, play, play, play, play, protocol, protocol
-
字段详细资料
-
key
key
记录组件的字段。 -
ctx
private final PayloadChannel.Builder.BuilderContext<BUF extends FriendlyByteBuf,BASE extends CustomPacketPayload & SimplePacket<CTX>> ctxctx
记录组件的字段。
-
-
构造器详细资料
-
HandlerFlow
private HandlerFlow(io.netty.util.AttributeKey<CTX> key, PayloadChannel.Builder.BuilderContext<BUF, BASE> ctx) 创建HandlerFlow
记录类的实例。- 参数:
key
-key
记录组件的值ctx
-ctx
记录组件的值
-
-
方法详细资料
-
add
public <MSG extends BASE> PayloadHandlerFlow<BUF,BASE> add(CustomPacketPayload.Type<MSG> type, StreamCodec<BUF, MSG> codec) 从接口复制的说明:PayloadHandlerFlow
Adds 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 use引用无效
#addMain(Class, StreamCodec)
- 指定者:
add
在接口中PayloadHandlerFlow<BUF extends FriendlyByteBuf,
CTX>
-
addMain
public <MSG extends BASE> PayloadHandlerFlow<BUF,BASE> addMain(CustomPacketPayload.Type<MSG> type, StreamCodec<BUF, MSG> codec) 从接口复制的说明:PayloadHandlerFlow
Adds a packet to this channel that has it's protocol validated whenever sent or received.Unlike
PayloadHandlerFlow.add(Type,StreamCodec)
, the consumer is called on the main thread, and so can interact with most game state by default.- 指定者:
addMain
在接口中PayloadHandlerFlow<BUF extends FriendlyByteBuf,
CTX>
-
add
public <MSG extends BASE> PayloadHandlerFlow<BUF,BASE> add(CustomPacketPayload.Type<MSG> type, StreamCodec<BUF, MSG> codec, BiConsumer<MSG, CustomPayloadEvent.Context> consumer) 从接口复制的说明:PayloadHandlerFlow
Adds 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.- 指定者:
add
在接口中PayloadHandlerFlow<BUF extends FriendlyByteBuf,
CTX>
-
flow
- 指定者:
flow
在接口中BaseProtocol<BUF extends FriendlyByteBuf,
CTX>
-
toString
返回此记录类的字符串表示形式。此表示形式包含类的名称,后跟每个记录组件的名称和值。 -
hashCode
public final int hashCode()返回此对象的哈希代码值。此值派生自每个记录组件的哈希代码。 -
equals
指示某个其他对象是否“等于”此对象。如果两个对象属于同一个类,而且所有记录组件都相等,则这两个对象相等。 此记录类中的所有组件都使用Objects::equals(Object,Object)
进行比较。 -
key
返回key
记录组件的值。- 返回:
key
记录组件的值
-
ctx
返回ctx
记录组件的值。- 指定者:
ctx
在接口中PayloadChannel.Builder.ProtocolFactory<BUF extends FriendlyByteBuf,
CTX> - 返回:
ctx
记录组件的值
-