decode

abstract fun <Result> decode(buffer: JagByteBuf, betaWorld: Boolean, decoder: LoginBlockDecodingFunction<Result>): CompletableFuture<LoginBlock<Result>>

Decodes a login block buffer using the decoder implementation. The default implementation for login decoder utilizes a ForkJoinPool.

Return

a completable future instance that may be completed on a different thread, to avoid blocking Netty threads.

Parameters

buffer

the buffer to decode

betaWorld

whether the login connection came from a beta world, which means the decoding is only partial

decoder

the decoder function used to turn the buffer into a login block