Interface PacketListener

All Known Subinterfaces:
ClientCommonPacketListener, ClientConfigurationPacketListener, ClientLoginPacketListener, ClientPacketListener, ClientPingResultPacketListener, ClientPlayPacketListener, ClientQueryPacketListener, ServerCommonPacketListener, ServerConfigurationPacketListener, ServerCrashSafePacketListener, ServerHandshakePacketListener, ServerLoginPacketListener, ServerPacketListener, ServerPlayPacketListener, ServerQueryPacketListener, ServerQueryPingPacketListener, TickablePacketListener
All Known Implementing Classes:
ClientCommonNetworkHandler, ClientConfigurationNetworkHandler, ClientLoginNetworkHandler, ClientPlayNetworkHandler, LocalServerHandshakeNetworkHandler, ServerCommonNetworkHandler, ServerConfigurationNetworkHandler, ServerHandshakeNetworkHandler, ServerLoginNetworkHandler, ServerPlayNetworkHandler, ServerQueryNetworkHandler

public interface PacketListener
A 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 uo
intermediary net/minecraft/class_2547
named net/minecraft/network/listener/PacketListener
  • Method Details

    • getSide

      NetworkSide getSide()
      Mappings:
      Namespace Name Mixin selector
      official a Luo;a()Lxg;
      intermediary method_52895 Lnet/minecraft/class_2547;method_52895()Lnet/minecraft/class_2598;
      named getSide Lnet/minecraft/network/listener/PacketListener;getSide()Lnet/minecraft/network/NetworkSide;
    • getState

      NetworkState getState()
      Mappings:
      Namespace Name Mixin selector
      official b Luo;b()Luh;
      intermediary method_52280 Lnet/minecraft/class_2547;method_52280()Lnet/minecraft/class_2539;
      named getState Lnet/minecraft/network/listener/PacketListener;getState()Lnet/minecraft/network/NetworkState;
    • onDisconnected

      void onDisconnected(Text reason)
      Called when the connection this listener listens to has disconnected. Can be used to display the disconnection reason.
      Parameters:
      reason - the reason of disconnection; may be a generic message
      Mappings:
      Namespace Name Mixin selector
      official a Luo;a(Lvf;)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
    • isConnectionOpen

      boolean isConnectionOpen()
      Mappings:
      Namespace Name Mixin selector
      official c Luo;c()Z
      intermediary method_48106 Lnet/minecraft/class_2547;method_48106()Z
      named isConnectionOpen Lnet/minecraft/network/listener/PacketListener;isConnectionOpen()Z
    • accepts

      default boolean accepts(Packet<?> packet)
      Mappings:
      Namespace Name Mixin selector
      official a Luo;a(Lxf;)Z
      intermediary method_52413 Lnet/minecraft/class_2547;method_52413(Lnet/minecraft/class_2596;)Z
      named accepts Lnet/minecraft/network/listener/PacketListener;accepts(Lnet/minecraft/network/packet/Packet;)Z
    • shouldCrashOnException

      default boolean shouldCrashOnException()
      Returns whether uncaught exceptions in main thread should crash the game instead of logging and ignoring them.
      Returns:
      whether uncaught exceptions in main thread should crash the game instead of logging and ignoring them
      See Also:
      API Note:
      This only affects the processing on the main thread done by calling methods in NetworkThreadUtils. Uncaught exceptions in other threads or processing in the main thread using the client.execute(() -> {}) code will be unaffected, and always gets logged without crashing.
      Implementation Note:
      This is true by default.
      Mappings:
      Namespace Name Mixin selector
      official d Luo;d()Z
      intermediary method_40065 Lnet/minecraft/class_2547;method_40065()Z
      named shouldCrashOnException Lnet/minecraft/network/listener/PacketListener;shouldCrashOnException()Z
    • fillCrashReport

      default void fillCrashReport(CrashReport report)
      Mappings:
      Namespace Name Mixin selector
      official a Luo;a(Lo;)V
      intermediary method_55622 Lnet/minecraft/class_2547;method_55622(Lnet/minecraft/class_128;)V
      named fillCrashReport Lnet/minecraft/network/listener/PacketListener;fillCrashReport(Lnet/minecraft/util/crash/CrashReport;)V
    • addCustomCrashReportInfo

      default void addCustomCrashReportInfo(CrashReportSection section)
      Mappings:
      Namespace Name Mixin selector
      official a Luo;a(Lp;)V
      intermediary method_55597 Lnet/minecraft/class_2547;method_55597(Lnet/minecraft/class_129;)V
      named addCustomCrashReportInfo Lnet/minecraft/network/listener/PacketListener;addCustomCrashReportInfo(Lnet/minecraft/util/crash/CrashReportSection;)V