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(net.minecraft.entity.player.PlayerEntity player, net.minecraft.util.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(net.minecraft.entity.player.PlayerEntity player, net.minecraft.network.Packet<?> packet)
Deprecated.Send a packet to a given client.void
sendToPlayer(net.minecraft.entity.player.PlayerEntity player, net.minecraft.network.Packet<?> packet, io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>> completionListener)
Deprecated.Send a packet to a given client.default void
sendToPlayer(net.minecraft.entity.player.PlayerEntity player, net.minecraft.util.Identifier id, net.minecraft.network.PacketByteBuf buf)
Deprecated.Send an identifier/buffer-based packet to a given client.default void
sendToPlayer(net.minecraft.entity.player.PlayerEntity player, net.minecraft.util.Identifier id, net.minecraft.network.PacketByteBuf buf, io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.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
boolean canPlayerReceive(net.minecraft.entity.player.PlayerEntity player, net.minecraft.util.Identifier id)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(net.minecraft.entity.player.PlayerEntity player, net.minecraft.network.Packet<?> packet, io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.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(net.minecraft.entity.player.PlayerEntity player, net.minecraft.util.Identifier id, net.minecraft.network.PacketByteBuf buf, io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.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
default void sendToPlayer(net.minecraft.entity.player.PlayerEntity player, net.minecraft.network.Packet<?> packet)Deprecated.Send a packet to a given client.- Parameters:
player
- The given client.packet
- The packet to be sent.
-
sendToPlayer
default void sendToPlayer(net.minecraft.entity.player.PlayerEntity player, net.minecraft.util.Identifier id, net.minecraft.network.PacketByteBuf buf)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
.