@Immutable public final class BedrockPacketCodec extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
BedrockPacketCodec.Builder |
| Constructor and Description |
|---|
BedrockPacketCodec() |
| Modifier and Type | Method and Description |
|---|---|
static BedrockPacketCodec.Builder |
builder() |
int |
getId(BedrockPacket packet) |
int |
getId(Class<? extends BedrockPacket> clazz) |
<T extends BedrockPacket> |
getPacketDefinition(Class<T> packet) |
BedrockPacketDefinition<? extends BedrockPacket> |
getPacketDefinition(int id) |
BedrockPacketCodec.Builder |
toBuilder() |
BedrockPacket |
tryDecode(ByteBuf buf,
int id,
BedrockSession session) |
void |
tryEncode(ByteBuf buf,
BedrockPacket packet,
BedrockSession session) |
public static BedrockPacketCodec.Builder builder()
public BedrockPacket tryDecode(ByteBuf buf, int id, BedrockSession session) throws PacketSerializeException
PacketSerializeExceptionpublic void tryEncode(ByteBuf buf, BedrockPacket packet, BedrockSession session) throws PacketSerializeException
PacketSerializeExceptionpublic <T extends BedrockPacket> BedrockPacketDefinition<T> getPacketDefinition(Class<T> packet)
public BedrockPacketDefinition<? extends BedrockPacket> getPacketDefinition(int id)
public int getId(BedrockPacket packet)
public int getId(Class<? extends BedrockPacket> clazz)
public BedrockPacketCodec.Builder toBuilder()
Copyright © 2018–2022 NukkitX. All rights reserved.