接口 PacketListener
-
- 所有已知子接口:
ClientLoginPacketListener,ClientPlayPacketListener,ClientQueryPacketListener,ServerHandshakePacketListener,ServerLoginPacketListener,ServerPlayPacketListener,ServerQueryPacketListener
- 所有已知实现类:
ClientLoginNetworkHandler,ClientPlayNetworkHandler,LocalServerHandshakeNetworkHandler,ServerHandshakeNetworkHandler,ServerLoginNetworkHandler,ServerPlayNetworkHandler,ServerQueryNetworkHandler
public interface PacketListenerA packet listener listens to packets on a connection.Its listener methods will be called on the netty event loop than the client or server game engine threads.
- Mappings:
Namespace Name official oeintermediary net/minecraft/class_2547named net/minecraft/network/listener/PacketListener
-
-
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 ClientConnectiongetConnection()Returns the connection this packet listener intends to listen to.voidonDisconnected(Text reason)Called when the connection this listener listens to has disconnected.
-
-
-
方法详细资料
-
onDisconnected
void onDisconnected(Text reason)
Called when the connection this listener listens to has disconnected. Can be used to display the disconnection reason.- 参数:
reason- the reason of disconnection; may be a generic message- Mappings:
Namespace Name Mixin selector official aLoe;a(Lon;)Vintermediary method_10839Lnet/minecraft/class_2547;method_10839(Lnet/minecraft/class_2561;)Vnamed onDisconnectedLnet/minecraft/network/listener/PacketListener;onDisconnected(Lnet/minecraft/text/Text;)V
-
getConnection
ClientConnection getConnection()
Returns the connection this packet listener intends to listen to.- 另请参阅:
ClientConnection.getPacketListener()- API Note:
- The returned connection may or may not have this listener as its current packet listener.
- Mappings:
Namespace Name Mixin selector official aLoe;a()Lnz;intermediary method_2872Lnet/minecraft/class_2547;method_2872()Lnet/minecraft/class_2535;named getConnectionLnet/minecraft/network/listener/PacketListener;getConnection()Lnet/minecraft/network/ClientConnection;
-
-