Interface IPacketReceiver

All Known Implementing Classes:
AssetEditorPacketHandler, AuthenticationPacketHandler, GamePacketHandler, GenericConnectionPacketHandler, GenericPacketHandler, HandshakeHandler, InitialPacketHandler, PacketHandler, PasswordPacketHandler, SetupPacketHandler

public interface IPacketReceiver
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Writes the packet, caching it first to prevent race conditions between the world thread and netty writing the packet.
    void
    Writes the packet without first caching the packet.
  • Method Details

    • write

      void write(@Nonnull ToClientPacket packet)
      Writes the packet, caching it first to prevent race conditions between the world thread and netty writing the packet.
      Parameters:
      packet - the packet to send.
    • writeNoCache

      void writeNoCache(@Nonnull ToClientPacket packet)
      Writes the packet without first caching the packet. This method should only be used if you don't store the sent packet to be reused. eg. packetHandler.writeNoCache(new Ping(...))
      Parameters:
      packet - the packet to send.