public interface NPacket
Modifier and Type | Method and Description |
---|---|
default io.netty.buffer.ByteBuf |
create(Player p,
Version version)
Create ByteBuf of this packet with all necessary data
|
default String |
getPacketName() |
PacketType |
getPacketType()
Get type of packet
|
void |
read(PacketSerializer serializer,
Version version)
Read packet from given serializer.
|
default void |
write(PacketSerializer serializer,
Version version)
Write packet to given serializer
|
void read(PacketSerializer serializer, Version version)
serializer
- the content of packetversion
- the version of packetdefault void write(PacketSerializer serializer, Version version)
serializer
- the buffer that will receive writeversion
- the version of packetdefault io.netty.buffer.ByteBuf create(Player p, Version version)
p
- the player that will receive the packetversion
- the version of packetPacketType getPacketType()
default String getPacketName()