Interface PayloadTypeRegistry<B extends PacketByteBuf>
A registry for payload types.
-
Method Summary
Modifier and TypeMethodDescriptionstatic PayloadTypeRegistry
<PacketByteBuf> static PayloadTypeRegistry
<PacketByteBuf> static PayloadTypeRegistry
<RegistryByteBuf> playC2S()
static PayloadTypeRegistry
<RegistryByteBuf> playS2C()
<T extends CustomPayload>
CustomPayload.Type<? super B, T> register
(CustomPayload.Id<T> id, PacketCodec<? super B, T> codec) Registers a custom payload type.
-
Method Details
-
register
<T extends CustomPayload> CustomPayload.Type<? super B,T> register(CustomPayload.Id<T> id, PacketCodec<? super B, T> codec) Registers a custom payload type.This must be done on both the sending and receiving side, usually during mod initialization and before registering a packet handler.
- Type Parameters:
T
- the payload type- Parameters:
id
- the id of the payload typecodec
- the codec for the payload type- Returns:
- the registered payload type
-
configurationC2S
- Returns:
- the
PayloadTypeRegistry
instance for the client to server configuration channel.
-
configurationS2C
- Returns:
- the
PayloadTypeRegistry
instance for the server to client configuration channel.
-
playC2S
- Returns:
- the
PayloadTypeRegistry
instance for the client to server play channel.
-
playS2C
- Returns:
- the
PayloadTypeRegistry
instance for the server to client play channel.
-