Package net.fabricmc.fabric.api.network
Interface ServerSidePacketRegistry
- All Superinterfaces:
PacketRegistry
Deprecated.
The server-side packet registry.
It is used for:
- registering server-side packet receivers (client -> server packets)
- sending packets to clients (server -> client packets).
For iterating over clients in a server, see PlayerStream
.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canPlayerReceive
(PlayerEntity player, Identifier id) Deprecated.Check if a given client declared the ability to receive a given packet ID using the vanilla "register/unregister" protocol.default void
sendToPlayer
(PlayerEntity player, Packet<?> packet) Deprecated.Send a packet to a given client.void
sendToPlayer
(PlayerEntity player, Packet<?> packet, GenericFutureListener<? extends Future<? super Void>> completionListener) Deprecated.Send a packet to a given client.default void
sendToPlayer
(PlayerEntity player, Identifier id, PacketByteBuf buf) Deprecated.Send an identifier/buffer-based packet to a given client.default void
sendToPlayer
(PlayerEntity player, Identifier id, PacketByteBuf buf, GenericFutureListener<? extends Future<? super Void>> completionListener) Deprecated.Send an identifier/buffer-based packet to a given client.Methods inherited from interface net.fabricmc.fabric.api.network.PacketRegistry
register, toPacket, unregister
-
Field Details
-
INSTANCE
Deprecated.
-
-
Method Details
-
canPlayerReceive
Deprecated.Check if a given client declared the ability to receive a given packet ID using the vanilla "register/unregister" protocol.- Parameters:
id
- The packet identifier.- Returns:
- True if the client side declared a given packet identifier.
-
sendToPlayer
void sendToPlayer(PlayerEntity player, Packet<?> packet, GenericFutureListener<? extends Future<? super Void>> completionListener) Deprecated.Send a packet to a given client.- Parameters:
player
- The given client.packet
- The packet to be sent.completionListener
- Completion listener. Can be used to check for the success or failure of sending a given packet, among others.
-
sendToPlayer
default void sendToPlayer(PlayerEntity player, Identifier id, PacketByteBuf buf, GenericFutureListener<? extends Future<? super Void>> completionListener) Deprecated.Send an identifier/buffer-based packet to a given client.- Parameters:
player
- The given client.id
- The packet identifier.buf
- The packet byte buffer.completionListener
- Completion listener. Can be used to check for the success or failure of sending a given packet, among others.
-
sendToPlayer
Deprecated.Send a packet to a given client.- Parameters:
player
- The given client.packet
- The packet to be sent.
-
sendToPlayer
Deprecated.Send an identifier/buffer-based packet to a given client.- Parameters:
player
- The given client.id
- The packet identifier.buf
- The packet byte buffer.
-
ServerPlayNetworking
.