Class PacketDefinition<T extends Packet,H extends PacketCodecHelper>
java.lang.Object
org.geysermc.mcprotocollib.network.codec.PacketDefinition<T,H>
- Type Parameters:
T- the packet type
Represents a definition of a packet with various
information about it, such as it's id, class and
factory for construction.
-
Constructor Summary
ConstructorsConstructorDescriptionPacketDefinition(int id, Class<T> packetClass, PacketSerializer<T, H> serializer) -
Method Summary
Modifier and TypeMethodDescriptionintgetId()Returns the id of the packet.Returns the class of the packet.Returns thePacketSerializerof the packet.newInstance(io.netty.buffer.ByteBuf buf, H helper)
-
Constructor Details
-
PacketDefinition
-
-
Method Details
-
getId
public int getId()Returns the id of the packet.- Returns:
- the id of the packet
-
getPacketClass
Returns the class of the packet.- Returns:
- the class of the packet
-
getSerializer
Returns thePacketSerializerof the packet.- Returns:
- the packet serializer of the packet
-
newInstance
-