Interface LoginPacketSender
- All Superinterfaces:
PacketSender
Represents something that supports sending packets to login channels.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionPacket<?> createPacket(Identifier channelName, PacketByteBuf buf) Creates a packet for sending to a login channel.default voidsendPacket(Identifier channel, PacketByteBuf buf) Sends a packet to a channel.default voidsendPacket(Identifier channel, PacketByteBuf buf, @Nullable PacketCallbacks callback) Sends a packet to a channel.Methods inherited from interface net.fabricmc.fabric.api.networking.v1.PacketSender
createPacket, disconnect, sendPacket, sendPacket, sendPacket, sendPacket
-
Method Details
-
createPacket
Creates a packet for sending to a login channel.- Parameters:
channelName- the id of the channelbuf- the content of the packet- Returns:
- the created packet
-
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 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
-