Skip to content

Interface IMinecraftPacketIdPluginsRegistry

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

Partitions read and write packet-ID registries by contributing plugin.

public interface IMinecraftPacketIdPluginsRegistry

Extension Methods

MinecraftPacketIdPluginsRegistryExtensions.TryGetTransformations(IMinecraftPacketIdPluginsRegistry, IMinecraftPacketTransformationsPluginsRegistry, IMinecraftPacket, TransformationType, out MinecraftPacketTransformation[]), MinecraftPacketIdPluginsRegistryExtensions.TryGetTransformations(IMinecraftPacketIdPluginsRegistry, IMinecraftPacketTransformationsPluginsRegistry, Type, TransformationType, out MinecraftPacketTransformation[])

Properties

IsEmpty

Gets whether all plugin-owned read and write packet ID registries are empty.

bool IsEmpty { get; }

Property Value

bool

ManagedBy

Gets or sets the plugin responsible for this aggregate registry’s lifecycle.

IPlugin? ManagedBy { get; set; }

Property Value

IPlugin?

ProtocolVersion

Gets or sets the protocol version for which plugin mappings are configured.

ProtocolVersion? ProtocolVersion { get; set; }

Property Value

ProtocolVersion?

Read

Gets the current plugin-owned read registries.

IReadOnlyCollection<IMinecraftPacketIdRegistry> Read { get; }

Property Value

IReadOnlyCollection<IMinecraftPacketIdRegistry>

Write

Gets the current plugin-owned write registries.

IReadOnlyCollection<IMinecraftPacketIdRegistry> Write { get; }

Property Value

IReadOnlyCollection<IMinecraftPacketIdRegistry>

Methods

Clear()

Removes all per-plugin read and write registries while preserving ownership and protocol metadata.

void Clear()

Clear(Direction, Operation)

Clears packet ID registrations for the specified direction from the selected operation buckets.

void Clear(Direction direction, Operation operation)

Parameters

direction Direction

The packet direction whose registrations should be removed.

operation Operation

The read and/or write registry buckets to clear.

Remarks

When operation includes , each read registry is cleared for direction. When it includes , each write registry is cleared. If neither flag is present, this method has no effect.

Contains<T>()

Determines whether any plugin registry contains a compatible packet type.

bool Contains<T>() where T : IMinecraftPacket

Returns

bool

true when any read or write registry contains it; otherwise, false.

Type Parameters

T

The packet type to query.

Contains(INetworkMessage)

Determines whether any plugin registry contains a compatible mapping for a message.

bool Contains(INetworkMessage message)

Parameters

message INetworkMessage

The message to query.

Returns

bool

true when any read or write registry contains it; otherwise, false.

Contains(Type)

Determines whether any plugin registry contains a compatible runtime type.

bool Contains(Type type)

Parameters

type Type

The type to query.

Returns

bool

true when any read or write registry contains it; otherwise, false.

Get(Operation, IPlugin)

Gets or creates the registry for one plugin and one operation.

IMinecraftPacketIdRegistry Get(Operation operation, IPlugin plugin)

Parameters

operation Operation

Exactly or .

plugin IPlugin

The plugin that owns the returned registry.

Returns

IMinecraftPacketIdRegistry

The existing or newly created registry.

Exceptions

InvalidOperationException

has not been set.

ArgumentException

operation is or an unsupported value.

Remove(IPlugin)

Removes both read and write registries owned by a plugin.

void Remove(IPlugin plugin)

Parameters

plugin IPlugin

The plugin to remove.

Reset()

Clears all plugin registries and sets and to null.

void Reset()

TryGetPlugin<T>(out IPlugin)

Attempts to find the first plugin with a compatible mapping for a packet type.

bool TryGetPlugin<T>(out IPlugin plugin) where T : IMinecraftPacket

Parameters

plugin IPlugin

When successful, the owning plugin; otherwise, null.

Returns

bool

true when a mapping is found; otherwise, false.

Type Parameters

T

The packet type to locate.

TryGetPlugin(INetworkMessage, out IPlugin)

Attempts to find the first plugin with a compatible mapping for a message’s runtime type.

bool TryGetPlugin(INetworkMessage message, out IPlugin plugin)

Parameters

message INetworkMessage

The message to locate.

plugin IPlugin

When successful, the owning plugin; otherwise, null.

Returns

bool

true when a mapping is found; otherwise, false.

TryGetPlugin(Type, out IPlugin)

Attempts to find the first plugin with a compatible mapping for a runtime type.

bool TryGetPlugin(Type type, out IPlugin plugin)

Parameters

type Type

The packet type to locate.

plugin IPlugin

When successful, the owning plugin; otherwise, null.

Returns

bool

true when a mapping is found; otherwise, false.