Class CodecPacket
-
- All Implemented Interfaces:
-
net.minecraft.network.protocol.common.custom.CustomPacketPayload
public abstract class CodecPacket<P extends CodecPacket<P, T>, T extends Object> implements CustomPacketPayload
A type of packet that uses a codec for serializing and deserializing.
-
-
Constructor Summary
Constructors Constructor Description CodecPacket(Codec<T> codec)
-
Method Summary
Modifier and Type Method Description abstract ResourceLocation
getId()
final CustomPacketPayload.Type<P>
getPacketType()
final T
getData()
final Unit
setData(T data)
final Codec<T>
getCodec()
CustomPacketPayload.Type<P>
type()
final P
of(T dataIn)
final Unit
write(FriendlyByteBuf buf, P packet)
final P
read(FriendlyByteBuf buf)
final Unit
handle(P packet, IPayloadContext cx)
abstract Unit
handle(T data, IPayloadContext cx)
abstract P
factory()
-
-
Constructor Detail
-
CodecPacket
CodecPacket(Codec<T> codec)
-
-
Method Detail
-
getId
abstract ResourceLocation getId()
-
getPacketType
final CustomPacketPayload.Type<P> getPacketType()
-
-
-
-