Interface ClientLoginNetworking.LoginQueryRequestHandler

Enclosing class:
ClientLoginNetworking
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@Environment(CLIENT)
@FunctionalInterface
public static interface ClientLoginNetworking.LoginQueryRequestHandler
  • Method Summary

    Modifier and Type Method Description
    CompletableFuture<@Nullable 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.
  • Method Details

    • receive

      CompletableFuture<@Nullable 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.

      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.

      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
      Returns:
      a completable future which contains the payload to respond to the server with. If the future contains null, then the server will be notified that the client did not understand the query.