registerC2S

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

registers a server-bound (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

clazz

Class<T> class type of the registered 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.