Interface ClientConfigurationNetworking.ConfigurationPacketHandler<T extends FabricPacket>

Type Parameters:
T - the type of the packet
Enclosing class:
ClientConfigurationNetworking
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 ClientConfigurationNetworking.ConfigurationPacketHandler<T extends FabricPacket>
A thread-safe packet handler utilizing FabricPacket.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    receive(T packet, PacketSender responseSender)
    Handles the incoming packet.
  • Method Details

    • receive

      void receive(T packet, PacketSender responseSender)
      Handles the incoming packet. This is called on the render thread, and can safely call client methods.

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

      
       // See FabricPacket for creating the packet
       ClientConfigurationNetworking.registerReceiver(OVERLAY_PACKET_TYPE, (player, packet, responseSender) -> {
       	MinecraftClient.getInstance().inGameHud.setOverlayMessage(packet.message(), true);
       });
       
      Parameters:
      packet - the packet
      responseSender - the packet sender
      See Also: