Package net.fabricmc.fabric.api.network
Interface ClientSidePacketRegistry
- All Superinterfaces:
PacketRegistry
Deprecated.
The client-side packet registry.
It is used for:
- registering client-side packet receivers (server -> client packets)
- sending packets to the server (client -> server packets).
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Deprecated.Check if the server declared the ability to receive a given packet ID using the vanilla "register/unregister" protocol.default void
sendToServer
(Packet<?> packet) Deprecated.Send a packet to the server.void
sendToServer
(Packet<?> packet, GenericFutureListener<? extends Future<? super Void>> completionListener) Deprecated.Send a packet to the server.default void
sendToServer
(Identifier id, PacketByteBuf buf) Deprecated.Send an identifier/buffer-based packet to the server.default void
sendToServer
(Identifier id, PacketByteBuf buf, GenericFutureListener<? extends Future<? super Void>> completionListener) Deprecated.Send an identifier/buffer-based packet to the server.Methods inherited from interface net.fabricmc.fabric.api.network.PacketRegistry
register, toPacket, unregister
-
Field Details
-
INSTANCE
Deprecated.
-
-
Method Details
-
canServerReceive
Deprecated.Check if the server declared the ability to receive a given packet ID using the vanilla "register/unregister" protocol.- Parameters:
id
- The packet identifier.- Returns:
- True if the server side declared a given packet identifier.
-
sendToServer
void sendToServer(Packet<?> packet, GenericFutureListener<? extends Future<? super Void>> completionListener) Deprecated.Send a packet to the server.- Parameters:
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.
-
sendToServer
default void sendToServer(Identifier id, PacketByteBuf buf, GenericFutureListener<? extends Future<? super Void>> completionListener) Deprecated.Send an identifier/buffer-based packet to the server.- Parameters:
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.
-
sendToServer
Deprecated.Send a packet to the server.- Parameters:
packet
- The packet to be sent.
-
sendToServer
Deprecated.Send an identifier/buffer-based packet to the server.- Parameters:
id
- The packet identifier.buf
- The packet byte buffer.
-
ClientPlayNetworking
.