Interface PacketSender
@NonExtendable
public interface PacketSender
Represents something that supports sending packets to channels.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionPacket
<?> createPacket
(FabricPacket packet) Makes a packet for a fabric packet.Packet
<?> createPacket
(Identifier channelName, PacketByteBuf buf) Makes a packet for a channel.default void
sendPacket
(CustomPayload payload) Sends a packet.default void
sendPacket
(CustomPayload payload, @Nullable io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>> callback) Sends a packet.default void
sendPacket
(CustomPayload payload, @Nullable PacketCallbacks callback) Sends a packet.default 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
-
createPacket
Makes a packet for a fabric packet.- Parameters:
packet
- the fabric packet
-
sendPacket
Sends a packet.- Parameters:
packet
- the packet
-
sendPacket
Sends a packet.- Parameters:
packet
- the packet
-
sendPacket
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 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
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 payloadcallback
- 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.- Parameters:
payload
- the payloadcallback
- 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
-