Skip to content

Interface IMinecraftPacketIdSystemRegistry

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

Defines an interface for managing and accessing Minecraft packet ID registries for different protocol versions and operations.

public interface IMinecraftPacketIdSystemRegistry

Remarks

This interface has split and registries unlike .

Properties

IsEmpty

Gets whether the built-in registry has no read or write mappings and no managing plugin.

bool IsEmpty { get; }

Property Value

bool

ManagedBy

Gets or sets the plugin responsible for system registry lifecycle.

IPlugin? ManagedBy { get; set; }

Property Value

IPlugin?

ProtocolVersion

Gets or sets the protocol version used when selecting mappings.

ProtocolVersion? ProtocolVersion { get; set; }

Property Value

ProtocolVersion?

Read

Gets or sets the registry used to decode inbound packets.

IMinecraftPacketIdRegistry Read { get; set; }

Property Value

IMinecraftPacketIdRegistry

Write

Gets or sets the registry used to encode outbound packets.

IMinecraftPacketIdRegistry Write { get; set; }

Property Value

IMinecraftPacketIdRegistry

Methods

AddPackets(Operation, IReadOnlyDictionary<MinecraftPacketIdMapping[], Type>)

Adds mappings to selected operation registries for .

void AddPackets(Operation operation, IReadOnlyDictionary<MinecraftPacketIdMapping[], Type> mappings)

Parameters

operation Operation

The read, write, or both operation registries to update.

mappings IReadOnlyDictionary<MinecraftPacketIdMapping[], Type>

Packet types keyed by ordered mapping arrays.

Exceptions

InvalidOperationException

is null.

ArgumentException

operation is unsupported or selected mappings are invalid or conflicting.

Contains<T>()

Determines whether either operation registry contains a compatible message type.

bool Contains<T>() where T : IMinecraftMessage

Returns

bool

true when a compatible read or write mapping exists; otherwise, false.

Type Parameters

T

The message type to query.

Contains(Type)

Determines whether either operation registry contains a compatible runtime type.

bool Contains(Type type)

Parameters

type Type

The type to query.

Returns

bool

true when a compatible read or write mapping exists; otherwise, false.

Contains(IMinecraftMessage)

Determines whether either operation registry contains a compatible mapping for a message.

bool Contains(IMinecraftMessage packet)

Parameters

packet IMinecraftMessage

The message to query.

Returns

bool

true when a compatible read or write mapping exists; otherwise, false.

ReplacePackets(Operation, IReadOnlyDictionary<MinecraftPacketIdMapping[], Type>)

Clears and replaces mappings in selected operation registries for .

void ReplacePackets(Operation operation, IReadOnlyDictionary<MinecraftPacketIdMapping[], Type> mappings)

Parameters

operation Operation

The read, write, or both operation registries to replace.

mappings IReadOnlyDictionary<MinecraftPacketIdMapping[], Type>

Packet types keyed by ordered mapping arrays.

Exceptions

InvalidOperationException

is null.

ArgumentException

operation is unsupported or selected mappings are invalid or conflicting.

Reset()

Clears both operation registries and sets protocol and manager metadata to null.

void Reset()