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.

@FunctionalInterface public static interface ClientLoginNetworking.LoginQueryRequestHandler
  • Method Details

    • receive

      CompletableFuture<@Nullable PacketByteBuf> receive(MinecraftClient client, ClientLoginNetworkHandler handler, 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.