Interface IPacketHandler

All Known Implementing Classes:
NetworkRegistry.ClientPacketHandler, NetworkRegistry.ServerPacketHandler

public interface IPacketHandler
Describes a handler for a packet. Allows for the handling of full packets from custom payloads
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Trigger a disconnect from the network.
    void
    Invoked to handle the given custom payload.
    void
    handle(Packet<?> packet)
    Invoked to handle the given packet.
  • Method Details

    • handle

      void handle(Packet<?> packet)
      Invoked to handle the given packet.
      Parameters:
      packet - The packet.
    • handle

      void handle(CustomPacketPayload payload)
      Invoked to handle the given custom payload.
      Parameters:
      payload - The payload.
    • disconnect

      void disconnect(Component reason)
      Trigger a disconnect from the network.
      Parameters:
      reason - The reason for the disconnect.