public interface PacketRegistry
Modifier and Type | Method and Description |
---|---|
void |
register(net.minecraft.util.Identifier id,
PacketConsumer consumer)
Register a packet.
|
net.minecraft.network.Packet<?> |
toPacket(net.minecraft.util.Identifier id,
net.minecraft.network.PacketByteBuf buf)
Turn a (identifier, byte buffer) pair into a "custom payload" packet
suitable for sending in the PacketRegistry's sending direction.
|
void |
unregister(net.minecraft.util.Identifier id)
Unregister a packet.
|
net.minecraft.network.Packet<?> toPacket(net.minecraft.util.Identifier id, net.minecraft.network.PacketByteBuf buf)
id
- The identifier.buf
- The byte buffer.void register(net.minecraft.util.Identifier id, PacketConsumer consumer)
id
- The packet Identifier.consumer
- The method used for handling the packet.void unregister(net.minecraft.util.Identifier id)
id
- The packet Identifier.