@Environment(value=CLIENT) @FunctionalInterface public static interface ClientLoginNetworking.LoginQueryRequestHandler
Modifier and Type | Method and Description |
---|---|
CompletableFuture<net.minecraft.network.PacketByteBuf> |
receive(net.minecraft.client.MinecraftClient client,
net.minecraft.client.network.ClientLoginNetworkHandler handler,
net.minecraft.network.PacketByteBuf buf,
Consumer<io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>>> listenerAdder)
Handles an incoming query request from a server.
|
CompletableFuture<net.minecraft.network.PacketByteBuf> receive(net.minecraft.client.MinecraftClient client, net.minecraft.client.network.ClientLoginNetworkHandler handler, net.minecraft.network.PacketByteBuf buf, Consumer<io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>>> listenerAdder)
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 CompletableFuture.completedFuture(Object)
to wrap your response for immediate sending.
client
- the clienthandler
- the network handler that received this packetbuf
- the payload of the packetlistenerAdder
- listeners to be called when the response packet is sent to the servernull
, then the server will be notified that the client did not understand the query.