记录类 SimpleChannel.Flow<BUF extends FriendlyByteBuf,BASE>
java.lang.Object
java.lang.Record
net.minecraftforge.network.SimpleChannel.Flow<BUF,BASE>
- 所有已实现的接口:
ChannelBuildable<Object>
,BaseProtocol<SimpleFlow<BUF,
,BASE>, SimpleProtocol<BUF, BASE>> SimpleBuildable
,SimpleConnection<BASE>
,SimpleFlow<BUF,
,BASE> SimpleProtocol<BUF,
,BASE> SimpleChannel.ProtocolFactory<BUF,
BASE>
- 封闭类:
SimpleChannel
private static record SimpleChannel.Flow<BUF extends FriendlyByteBuf,BASE> (SimpleChannel.SimpleContext<BUF extends FriendlyByteBuf,BASE> ctx)
extends Record
implements SimpleChannel.ProtocolFactory<BUF,BASE>, SimpleFlow<BUF,BASE>
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明<MSG extends BASE>
SimpleChannel.Flow<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.ctx()
返回ctx
记录组件的值。final boolean
指示某个其他对象是否“等于”此对象。flow
(@Nullable PacketFlow flow) final int
hashCode()
返回此对象的哈希代码值。final String
toString()
返回此记录类的字符串表示形式。从接口继承的方法 net.minecraftforge.network.simple.BaseProtocol
bidirectional, bidirectional, clientbound, clientbound, flow, flow, serverbound, serverbound
从接口继承的方法 net.minecraftforge.network.SimpleChannel.ProtocolFactory
build, protocol, protocol
从接口继承的方法 net.minecraftforge.network.simple.SimpleConnection
any, any, any, any, configuration, configuration, configuration, configuration, login, login, login, login, play, play, play, play, protocol, protocol
从接口继承的方法 net.minecraftforge.network.simple.SimpleFlow
addMain
-
字段详细资料
-
ctx
ctx
记录组件的字段。
-
-
构造器详细资料
-
Flow
创建Flow
记录类的实例。- 参数:
ctx
-ctx
记录组件的值
-
-
方法详细资料
-
add
public <MSG extends BASE> SimpleChannel.Flow<BUF,BASE> add(Class<MSG> type, StreamCodec<BUF, MSG> codec, BiConsumer<MSG, CustomPayloadEvent.Context> handler) 从接口复制的说明:SimpleFlow
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
在接口中SimpleFlow<BUF extends FriendlyByteBuf,
BASE>
-
flow
- 指定者:
flow
在接口中BaseProtocol<BUF extends FriendlyByteBuf,
BASE>
-
toString
返回此记录类的字符串表示形式。此表示形式包含类的名称,后跟每个记录组件的名称和值。 -
hashCode
public final int hashCode()返回此对象的哈希代码值。此值派生自每个记录组件的哈希代码。 -
equals
指示某个其他对象是否“等于”此对象。如果两个对象属于同一个类,而且所有记录组件都相等,则这两个对象相等。 此记录类中的所有组件都使用Objects::equals(Object,Object)
进行比较。 -
ctx
返回ctx
记录组件的值。- 指定者:
ctx
在接口中SimpleChannel.ProtocolFactory<BUF extends FriendlyByteBuf,
BASE> - 返回:
ctx
记录组件的值
-