T - the packet typepublic class PacketDefinition<T extends Packet,H extends PacketCodecHelper> extends Object
| Constructor and Description |
|---|
PacketDefinition(int id,
Class<T> packetClass,
PacketSerializer<T,H> serializer) |
| Modifier and Type | Method and Description |
|---|---|
int |
getId()
Returns the id of the packet.
|
Class<T> |
getPacketClass()
Returns the class of the packet.
|
PacketSerializer<T,H> |
getSerializer()
Returns the
PacketSerializer of the packet. |
T |
newInstance(io.netty.buffer.ByteBuf buf,
H helper) |
public PacketDefinition(int id,
Class<T> packetClass,
PacketSerializer<T,H> serializer)
public int getId()
public Class<T> getPacketClass()
public PacketSerializer<T,H> getSerializer()
PacketSerializer of the packet.public T newInstance(io.netty.buffer.ByteBuf buf, H helper) throws IOException
IOExceptionCopyright © 2022. All rights reserved.