接口 PacketListener

    • 方法详细资料

      • 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 a Loe;a(Lon;)V
        intermediary method_10839 Lnet/minecraft/class_2547;method_10839(Lnet/minecraft/class_2561;)V
        named onDisconnected Lnet/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 a Loe;a()Lnz;
        intermediary method_2872 Lnet/minecraft/class_2547;method_2872()Lnet/minecraft/class_2535;
        named getConnection Lnet/minecraft/network/listener/PacketListener;getConnection()Lnet/minecraft/network/ClientConnection;