类 SimpleChannel
- 所有已实现的接口:
SimpleConnection<Object>
-
嵌套类概要
嵌套类修饰符和类型类说明private static final record
SimpleChannel.Flow<BUF extends FriendlyByteBuf,
BASE> private static final record
SimpleChannel.HandlerFlow<BUF extends FriendlyByteBuf,
CTX, BASE extends SimplePacket<CTX>> private static final record
SimpleChannel.HandlerProtocol<BUF extends FriendlyByteBuf,
CTX, BASE extends SimplePacket<CTX>> protected static final record
SimpleChannel.Message<MSG,
BUF extends FriendlyByteBuf> static class
private static final record
SimpleChannel.Protocol<BUF extends FriendlyByteBuf,
BASE> private static interface
private static final record
从类继承的嵌套类/接口 net.minecraftforge.network.Channel
Channel.VersionTest
-
字段概要
字段修饰符和类型字段说明private boolean
protected it.unimi.dsi.fastutil.ints.Int2ObjectMap
<SimpleChannel.Message<?, ?>> protected it.unimi.dsi.fastutil.objects.Object2ObjectMap
<Class<?>, SimpleChannel.Message<?, ?>> protected int
private static final org.apache.logging.log4j.Logger
private static final org.apache.logging.log4j.Marker
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明build()
Finishes off the builder side of the SimpleChanel.protected void
void
encode
(FriendlyByteBuf out, Object message) private void
private SimpleChannel.Message
<Object, FriendlyByteBuf> get
(int id) private SimpleChannel.Message
<Object, FriendlyByteBuf> messageBuilder
(Class<M> type) Build a new MessageBuilder, using the next available discriminator.messageBuilder
(Class<M> type, int discriminator) Build a new MessageBuilder.<M,
B extends FriendlyByteBuf>
SimpleChannel.MessageBuilder<M, B> messageBuilder
(Class<M> type, int discriminator, NetworkDirection<B> direction) Build a new MessageBuilder.<M,
B extends FriendlyByteBuf>
SimpleChannel.MessageBuilder<M, B> messageBuilder
(Class<M> type, int discriminator, NetworkProtocol<B> protocol) Build a new MessageBuilder, using the next available discriminator.<M,
B extends FriendlyByteBuf>
SimpleChannel.MessageBuilder<M, B> messageBuilder
(Class<M> type, NetworkDirection<B> direction) Build a new MessageBuilder, using the next available discriminator.<M,
B extends FriendlyByteBuf>
SimpleChannel.MessageBuilder<M, B> messageBuilder
(Class<M> type, NetworkProtocol<B> protocol) Build a new MessageBuilder, using the next available discriminator.private void
protected int
<NEWBUF extends FriendlyByteBuf,
CTX, NEWBASE extends SimplePacket<CTX>>
SimpleHandlerProtocol<NEWBUF, NEWBASE> protocol
(io.netty.util.AttributeKey<CTX> context, NetworkProtocol<NEWBUF> protocol) Creates a builder grouping together all packets under the same protocol.<NEWBUF extends FriendlyByteBuf,
NEWBASE>
SimpleProtocol<NEWBUF, NEWBASE> protocol
(NetworkProtocol<NEWBUF> protocol) Creates a builder grouping together all packets under the same protocol.protected Packet
<?> toVanillaPacket
(Connection con, Object message) 从类继承的方法 net.minecraftforge.network.Channel
getName, getName, getProtocolVersion, isRemotePresent, reply, send, send, validate
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 net.minecraftforge.network.simple.SimpleConnection
any, any, any, any, configuration, configuration, configuration, configuration, login, login, login, login, play, play, play, play, protocol, protocol
-
字段详细资料
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER -
MARKER
private static final org.apache.logging.log4j.Marker MARKER -
built
private boolean built -
lastIndex
protected int lastIndex -
byId
-
byType
protected it.unimi.dsi.fastutil.objects.Object2ObjectMap<Class<?>,SimpleChannel.Message<?, byType?>>
-
-
构造器详细资料
-
SimpleChannel
-
-
方法详细资料
-
protocol
public <NEWBUF extends FriendlyByteBuf,NEWBASE> SimpleProtocol<NEWBUF,NEWBASE> protocol(NetworkProtocol<NEWBUF> protocol) 从接口复制的说明:SimpleConnection
Creates a builder grouping together all packets under the same protocol. This will validate that the protocol matches before the packet is sent or received.- 指定者:
protocol
在接口中SimpleConnection<Object>
-
protocol
public <NEWBUF extends FriendlyByteBuf,CTX, SimpleHandlerProtocol<NEWBUF,NEWBASE extends SimplePacket<CTX>> NEWBASE> protocol(io.netty.util.AttributeKey<CTX> context, NetworkProtocol<NEWBUF> protocol) 从接口复制的说明:SimpleConnection
Creates a builder grouping together all packets under the same protocol. This will validate that the protocol matches before the packet is sent or received.- 指定者:
protocol
在接口中SimpleConnection<Object>
-
messageBuilder
Build a new MessageBuilder, using the next available discriminator.- 类型参数:
M
- Type of type- 参数:
type
- Type of message
-
messageBuilder
public <M> SimpleChannel.MessageBuilder<M,FriendlyByteBuf> messageBuilder(Class<M> type, int discriminator) Build a new MessageBuilder.- 类型参数:
M
- Type of type- 参数:
type
- Type of messagediscriminator
- Manually configured discriminator, Must be a positive number.
-
messageBuilder
public <M,B extends FriendlyByteBuf> SimpleChannel.MessageBuilder<M,B> messageBuilder(Class<M> type, NetworkProtocol<B> protocol) Build a new MessageBuilder, using the next available discriminator.- 类型参数:
M
- Type of type- 参数:
type
- Type of messageprotocol
- The protocol that this packet is allowed to be sent/received in, Use enforce strict state handling to prevent spoofing.
-
messageBuilder
public <M,B extends FriendlyByteBuf> SimpleChannel.MessageBuilder<M,B> messageBuilder(Class<M> type, NetworkDirection<B> direction) Build a new MessageBuilder, using the next available discriminator.- 类型参数:
M
- Type of type- 参数:
type
- Type of messagedirection
- a impl direction which will be asserted before any processing of this message occurs. Use to enforce strict sided handling to prevent spoofing.
-
messageBuilder
public <M,B extends FriendlyByteBuf> SimpleChannel.MessageBuilder<M,B> messageBuilder(Class<M> type, int discriminator, NetworkProtocol<B> protocol) Build a new MessageBuilder, using the next available discriminator.- 类型参数:
M
- Type of type- 参数:
type
- Type of messagediscriminator
- Manually configured discriminator, Must be a positive number.protocol
- The protocol that this packet is allowed to be sent/received in, Use enforce strict state handling to prevent spoofing.
-
messageBuilder
public <M,B extends FriendlyByteBuf> SimpleChannel.MessageBuilder<M,B> messageBuilder(Class<M> type, int discriminator, NetworkDirection<B> direction) Build a new MessageBuilder.- 类型参数:
M
- Type of type- 参数:
type
- Type of messagediscriminator
- Manually configured discriminator, Must be a positive number.direction
- a impl direction which will be asserted before any processing of this message occurs. Use to enforce strict sided handling to prevent spoofing.
-
build
Finishes off the builder side of the SimpleChanel. This prevents adding more messages to this channel. -
checkBuilt
protected void checkBuilt() -
get
-
get
-
nextIndex
protected int nextIndex() -
networkEventListener
-
toVanillaPacket
- 覆盖:
toVanillaPacket
在类中Channel<Object>
-
encode
-
error
-