Interface ClientPlayNetworking.PlayChannelHandler

All Superinterfaces:
org.quiltmc.qsl.networking.api.client.ClientPlayNetworking.ChannelReceiver
Enclosing class:
ClientPlayNetworking
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@Deprecated @FunctionalInterface public static interface ClientPlayNetworking.PlayChannelHandler extends org.quiltmc.qsl.networking.api.client.ClientPlayNetworking.ChannelReceiver
Deprecated.
  • Method Details

    • receive

      default void receive(MinecraftClient client, ClientPlayNetworkHandler handler, PacketByteBuf buf, org.quiltmc.qsl.networking.api.PacketSender responseSender)
      Deprecated.
      Specified by:
      receive in interface org.quiltmc.qsl.networking.api.client.ClientPlayNetworking.ChannelReceiver
    • receive

      void receive(MinecraftClient client, ClientPlayNetworkHandler handler, PacketByteBuf buf, PacketSender responseSender)
      Deprecated.
      Handles an incoming packet.

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

      An example usage of this is to display an overlay message:

      
       ClientPlayNetworking.registerReceiver(new Identifier("mymod", "overlay"), (client, handler, buf, responseSender) -> {
       	String message = buf.readString(32767);
      
       	// All operations on the server or world must be executed on the server thread
       	client.execute(() -> {
       		client.inGameHud.setOverlayMessage(message, true);
       	});
       });
       
      Parameters:
      client - the client
      handler - the network handler that received this packet
      buf - the payload of the packet
      responseSender - the packet sender