Interface PacketHandler<T>


public interface PacketHandler<T>
An interface implementing the logic on how to handle a type of packet. Note that PacketSerializer and PacketHandler may not be implemented on the same class.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    A thread target for a PacketHandler.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    handle(T msg, Supplier<net.minecraftforge.network.NetworkEvent.Context> ctx)
    Handles the given message.
    The target thread, this handler should run on.
  • Method Details

    • target

      The target thread, this handler should run on.
    • handle

      boolean handle(T msg, Supplier<net.minecraftforge.network.NetworkEvent.Context> ctx)
      Handles the given message.
      Returns:
      Whether the message was handled. This is ignored on the main thread target.