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 io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.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 io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.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.default <T extends FabricPacket>
voidsendPacket
(T packet) Sends a packet.default <T extends FabricPacket>
voidsendPacket
(T packet, @Nullable io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>> callback) Sends a packet.default <T extends FabricPacket>
voidsendPacket
(T packet, @Nullable PacketCallbacks callback) Sends a packet.
-
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
Sends a packet.- Parameters:
packet
- the packet
-
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 packetcallback
- an optional callback to execute after the packet is sent, may benull
. The callback may also accept aChannelFutureListener
.
-
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 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
default <T extends FabricPacket> void sendPacket(T packet, @Nullable @Nullable PacketCallbacks 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 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 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 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
-