receive

abstract CompletableFuture<PacketByteBufreceive(MinecraftClient client, ClientLoginNetworkHandler handler, PacketByteBuf buf, Consumer<GenericFutureListener<? extends Future<? extends Object>>> listenerAdder)

Handles an incoming query request from a server.

This method is executed on netty's event loops.Modification to the game should be scheduled using the provided Minecraft client instance.

The return value of this method is a completable future that may be used to delay the login process to the server until a task is done.The future should complete in reasonably time to prevent disconnection by the server.If your request processes instantly, you may use completedFuture to wrap your response for immediate sending.

Return

a completable future which contains the payload to respond to the server with.If the future contains {@code null}, then the server will be notified that the client did not understand the query.

Parameters

client

the client

handler

the network handler that received this packet

buf

the payload of the packet

listenerAdder

listeners to be called when the response packet is sent to the server

Sources

jvm source
Link copied to clipboard