Interface PacketSender
public interface PacketSender
Represents something that supports sending packets to channels.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionPacket<?>
createPacket
(Identifier channelName, PacketByteBuf buf) Makes a packet for a channel.void
sendPacket
(Packet<?> packet) Sends a packet.void
sendPacket
(Packet<?> packet, @Nullable GenericFutureListener<? extends Future<? super Void>> callback) Sends a packet.void
sendPacket
(Packet<?> packet, @Nullable PacketCallbacks callback) Sends a packet.default void
sendPacket
(Identifier channel, PacketByteBuf buf) Sends a packet to a channel.default void
sendPacket
(Identifier channel, PacketByteBuf buf, @Nullable GenericFutureListener<? extends Future<? super Void>> callback) Sends a packet to a channel.default void
sendPacket
(Identifier channel, PacketByteBuf buf, @Nullable PacketCallbacks callback) Sends a packet to a channel.
-
Method Details
-
createPacket
Makes a packet for a channel.- Parameters:
channelName
- the id of the channelbuf
- the content of the packet
-
sendPacket
Sends a packet.- Parameters:
packet
- the packet
-
sendPacket
void sendPacket(Packet<?> packet, @Nullable @Nullable GenericFutureListener<? extends Future<? super Void>> callback) Sends a packet.- Parameters:
packet
- the packetcallback
- an optional callback to execute after the packet is sent, may benull
. The callback may also accept aChannelFutureListener
.
-
sendPacket
Sends a packet.- Parameters:
packet
- the packetcallback
- an optional callback to execute after the packet is sent, may benull
. The callback may also accept aChannelFutureListener
.
-
sendPacket
Sends a packet to a channel.- Parameters:
channel
- the id of the channelbuf
- the content of the packet
-
sendPacket
default void sendPacket(Identifier channel, PacketByteBuf buf, @Nullable @Nullable GenericFutureListener<? extends Future<? super Void>> callback) Sends a packet to a channel.- Parameters:
channel
- the id of the channelbuf
- the content of the packetcallback
- an optional callback to execute after the packet is sent, may benull
-
sendPacket
default void sendPacket(Identifier channel, PacketByteBuf buf, @Nullable @Nullable PacketCallbacks callback) Sends a packet to a channel.- Parameters:
channel
- the id of the channelbuf
- the content of the packetcallback
- an optional callback to execute after the packet is sent, may benull
-