Interface IMinecraftPacketIdPluginsRegistry
Namespace: Void.Minecraft.Network.Registries.PacketId
Assembly: Void.Minecraft.dll
Partitions read and write packet-ID registries by contributing plugin.
public interface IMinecraftPacketIdPluginsRegistryExtension 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
ManagedBy
Gets or sets the plugin responsible for this aggregate registry’s lifecycle.
IPlugin? ManagedBy { get; set; }Property Value
ProtocolVersion
Gets or sets the protocol version for which plugin mappings are configured.
ProtocolVersion? ProtocolVersion { get; set; }Property Value
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 direction. When it includes
Contains<T>()
Determines whether any plugin registry contains a compatible packet type.
bool Contains<T>() where T : IMinecraftPacketReturns
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
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
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
plugin IPlugin
The plugin that owns the returned registry.
Returns
The existing or newly created registry.
Exceptions
operation is
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
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 : IMinecraftPacketParameters
plugin IPlugin
When successful, the owning plugin; otherwise, null.
Returns
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
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.