Interface PacketSender


@NonExtendable public interface PacketSender
Represents something that supports sending packets to channels.
See Also:
  • Method Details

    • createPacket

      Packet<?> createPacket(Identifier channelName, PacketByteBuf buf)
      Makes a packet for a channel.
      Parameters:
      channelName - the id of the channel
      buf - the content of the packet
    • createPacket

      Packet<?> createPacket(FabricPacket packet)
      Makes a packet for a fabric packet.
      Parameters:
      packet - the fabric packet
    • sendPacket

      default void sendPacket(Packet<?> packet)
      Sends a packet.
      Parameters:
      packet - the packet
    • sendPacket

      default <T extends FabricPacket> void sendPacket(T packet)
      Sends a packet.
      Parameters:
      packet - the packet
    • sendPacket

      default void sendPacket(CustomPayload payload)
      Sends a packet.
      Parameters:
      payload - the payload
    • sendPacket

      void sendPacket(Packet<?> packet, @Nullable @Nullable io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>> callback)
      Sends a packet.
      Parameters:
      packet - the packet
      callback - an optional callback to execute after the packet is sent, may be null. The callback may also accept a ChannelFutureListener.
    • sendPacket

      default <T extends FabricPacket> void sendPacket(T packet, @Nullable @Nullable io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>> callback)
      Sends a packet.
      Parameters:
      packet - the packet
      callback - an optional callback to execute after the packet is sent, may be null. The callback may also accept a ChannelFutureListener.
    • sendPacket

      default void sendPacket(CustomPayload payload, @Nullable @Nullable io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>> callback)
      Sends a packet.
      Parameters:
      payload - the payload
      callback - an optional callback to execute after the packet is sent, may be null. The callback may also accept a ChannelFutureListener.
    • sendPacket

      void sendPacket(Packet<?> packet, @Nullable @Nullable PacketCallbacks callback)
      Sends a packet.
      Parameters:
      packet - the packet
      callback - an optional callback to execute after the packet is sent, may be null. The callback may also accept a ChannelFutureListener.
    • sendPacket

      default <T extends FabricPacket> void sendPacket(T packet, @Nullable @Nullable PacketCallbacks callback)
      Sends a packet.
      Parameters:
      packet - the packet
      callback - an optional callback to execute after the packet is sent, may be null. The callback may also accept a ChannelFutureListener.
    • sendPacket

      default void sendPacket(CustomPayload payload, @Nullable @Nullable PacketCallbacks callback)
      Sends a packet.
      Parameters:
      payload - the payload
      callback - an optional callback to execute after the packet is sent, may be null. The callback may also accept a ChannelFutureListener.
    • sendPacket

      default void sendPacket(Identifier channel, PacketByteBuf buf)
      Sends a packet to a channel.
      Parameters:
      channel - the id of the channel
      buf - the content of the packet
    • sendPacket

      default void sendPacket(Identifier channel, PacketByteBuf buf, @Nullable @Nullable io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>> callback)
      Sends a packet to a channel.
      Parameters:
      channel - the id of the channel
      buf - the content of the packet
      callback - an optional callback to execute after the packet is sent, may be null
    • sendPacket

      default void sendPacket(Identifier channel, PacketByteBuf buf, @Nullable @Nullable PacketCallbacks callback)
      Sends a packet to a channel.
      Parameters:
      channel - the id of the channel
      buf - the content of the packet
      callback - an optional callback to execute after the packet is sent, may be null