Interface ServerSidePacketRegistry

All Superinterfaces:
PacketRegistry

@Deprecated public interface ServerSidePacketRegistry extends PacketRegistry
Deprecated.
Please migrate to ServerPlayNetworking.
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

    Fields
    Modifier and Type
    Field
    Description
    Deprecated.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    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

  • 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.