registerC2S

abstract fun <T : CustomPayload> registerC2S(id: Identifier, function: Function<PacketByteBuf, T>, handler: C2SPayloadHandler<T>)

registers a serverbound (C2S) payload type and receipt handler. This must be done on both logical sides (client and server). A common entrypoint is typically the best place for this.

Author

fzzyhmstrs

Since

0.4.1

Parameters

T

the payload type to register

id

Identifier the id of the custom payload

function

Function<PacketByteBuf,T> the function for building the payload from a given buf

handler

S2CPayloadHandler a handler for dealing with receiving the payload. This handler will be on the server handling a payload sent from the client.