Skip to content

Class MinecraftPacketIdRegistryExtensions

Namespace: Void.Minecraft.Network.Registries.PacketId.Extensions
Assembly: Void.Minecraft.dll

Provides concise registration of one packet type and its identifier mappings.

public static class MinecraftPacketIdRegistryExtensions

Inheritance

object ← MinecraftPacketIdRegistryExtensions

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Methods

RegisterPacket<T>(IMinecraftPacketIdRegistry, ProtocolVersion, params MinecraftPacketIdMapping[])

Adds identifier mappings for a packet type at a protocol version.

public static void RegisterPacket<T>(this IMinecraftPacketIdRegistry registry, ProtocolVersion protocolVersion, params MinecraftPacketIdMapping[] mappings) where T : IMinecraftPacket

Parameters

registry IMinecraftPacketIdRegistry

The registry to update.

protocolVersion ProtocolVersion

The protocol version used to select an identifier.

mappings MinecraftPacketIdMapping[]

The ordered identifier mappings for T.

Type Parameters

T

The packet type to register.

Exceptions

ArgumentException

The selected mapping interval is invalid or conflicts with an existing identifier or type.