Class PacketDefinition<T extends Packet,H extends PacketCodecHelper>

java.lang.Object
com.github.steveice10.packetlib.codec.PacketDefinition<T,H>
Type Parameters:
T - the packet type

public class PacketDefinition<T extends Packet,H extends PacketCodecHelper> extends Object
Represents a definition of a packet with various information about it, such as it's id, class and factory for construction.
  • Constructor Details

  • Method Details

    • getId

      public int getId()
      Returns the id of the packet.
      Returns:
      the id of the packet
    • getPacketClass

      public Class<T> getPacketClass()
      Returns the class of the packet.
      Returns:
      the class of the packet
    • getSerializer

      public PacketSerializer<T,H> getSerializer()
      Returns the PacketSerializer of the packet.
      Returns:
      the packet serializer of the packet
    • newInstance

      public T newInstance(io.netty.buffer.ByteBuf buf, H helper) throws IOException
      Throws:
      IOException