public interface PacketSender
PacketByteBufs
Modifier and Type | Method and Description |
---|---|
net.minecraft.network.Packet<?> |
createPacket(net.minecraft.util.Identifier channelName,
net.minecraft.network.PacketByteBuf buf)
Makes a packet for a channel.
|
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.
|
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.
|
net.minecraft.network.Packet<?> createPacket(net.minecraft.util.Identifier channelName, net.minecraft.network.PacketByteBuf buf)
channelName
- the id of the channelbuf
- the content of the packetvoid sendPacket(net.minecraft.network.Packet<?> packet)
packet
- the packetvoid sendPacket(net.minecraft.network.Packet<?> packet, @Nullable @Nullable io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>> callback)
packet
- the packetcallback
- an optional callback to execute after the packet is sent, may be null
. The callback may also accept a ChannelFutureListener
.default void sendPacket(net.minecraft.util.Identifier channel, net.minecraft.network.PacketByteBuf buf)
channel
- the id of the channelbuf
- the content of the packetdefault 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)
channel
- the id of the channelbuf
- the content of the packetcallback
- an optional callback to execute after the packet is sent, may be null