Interface PacketSender


public interface PacketSender
Represents something that supports sending packets to channels.
See Also:
PacketByteBufs
  • Method Summary

    Modifier and Type Method Description
    net.minecraft.network.Packet<?> createPacket​(net.minecraft.util.Identifier channelName, net.minecraft.network.PacketByteBuf buf)
    Makes a packet for a channel.
    void sendPacket​(net.minecraft.network.Packet<?> packet)
    Sends a packet.
    void sendPacket​(net.minecraft.network.Packet<?> packet, @Nullable io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>> callback)
    Sends a packet.
    default void sendPacket​(net.minecraft.util.Identifier channel, net.minecraft.network.PacketByteBuf buf)
    Sends a packet to a channel.
    default void sendPacket​(net.minecraft.util.Identifier channel, net.minecraft.network.PacketByteBuf buf, @Nullable io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>> callback)
    Sends a packet to a channel.
  • Method Details

    • createPacket

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

      void sendPacket​(net.minecraft.network.Packet<?> packet)
      Sends a packet.
      Parameters:
      packet - the packet
    • sendPacket

      void sendPacket​(net.minecraft.network.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 void sendPacket​(net.minecraft.util.Identifier channel, net.minecraft.network.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​(net.minecraft.util.Identifier channel, net.minecraft.network.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