public interface ClientSidePacketRegistry extends PacketRegistry
It is used for:
Modifier and Type | Field and Description |
---|---|
static ClientSidePacketRegistry |
INSTANCE |
Modifier and Type | Method and Description |
---|---|
boolean |
canServerReceive(net.minecraft.util.Identifier id)
Check if the server declared the ability to receive a given packet ID
using the vanilla "register/unregister" protocol.
|
default void |
sendToServer(net.minecraft.util.Identifier id,
net.minecraft.network.PacketByteBuf buf)
Send an identifier/buffer-based packet to the server.
|
default void |
sendToServer(net.minecraft.util.Identifier id,
net.minecraft.network.PacketByteBuf buf,
io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>> completionListener)
Send an identifier/buffer-based packet to the server.
|
default void |
sendToServer(net.minecraft.network.Packet<?> packet)
Send a packet to the server.
|
void |
sendToServer(net.minecraft.network.Packet<?> packet,
io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>> completionListener)
Send a packet to the server.
|
register, toPacket, unregister
static final ClientSidePacketRegistry INSTANCE
boolean canServerReceive(net.minecraft.util.Identifier id)
id
- The packet identifier.void sendToServer(net.minecraft.network.Packet<?> packet, io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>> completionListener)
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.default void sendToServer(net.minecraft.util.Identifier id, net.minecraft.network.PacketByteBuf buf, io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>> completionListener)
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.default void sendToServer(net.minecraft.network.Packet<?> packet)
packet
- The packet to be sent.default void sendToServer(net.minecraft.util.Identifier id, net.minecraft.network.PacketByteBuf buf)
id
- The packet identifier.buf
- The packet byte buffer.