Interface IMinecraftPacketTransformationsRegistry
Namespace: Void.Minecraft.Network.Registries.Transformations
Assembly: Void.Minecraft.dll
Stores ordered upgrade and downgrade transformation pipelines by packet type.
public interface IMinecraftPacketTransformationsRegistryExtension Methods
Properties
IsEmpty
Gets whether both upgrade and downgrade mapping tables are empty.
bool IsEmpty { get; }Property Value
PacketTypes
Gets the packet
IEnumerable<Type> PacketTypes { get; }Property Value
Remarks
Callers that need a stable snapshot while the registry may be modified should materialize the sequence before enumerating it.
Methods
Add(IReadOnlyDictionary<IEnumerable<MinecraftPacketTransformationMapping>, Type>, ProtocolVersion)
Adds ordered upgrade and downgrade pipelines applicable beyond a protocol version.
IMinecraftPacketTransformationsRegistry Add(IReadOnlyDictionary<IEnumerable<MinecraftPacketTransformationMapping>, Type> mappings, ProtocolVersion protocolVersion)Parameters
mappings IReadOnlyDictionary<IEnumerable<MinecraftPacketTransformationMapping>, Type>
Packet types keyed by their transformation mappings.
protocolVersion ProtocolVersion
The current protocol version used to filter mappings.
Returns
IMinecraftPacketTransformationsRegistry
This registry.
Exceptions
The packet type already has a registered pipeline.
Clear()
Removes every upgrade and downgrade pipeline.
void Clear()Clear(Direction)
Removes pipelines for packet types belonging to a protocol direction.
void Clear(Direction direction)Parameters
direction Direction
The clientbound or serverbound direction to remove.
Exceptions
direction is not clientbound or serverbound.
Contains<T>(TransformationType)
Determines whether a transformation pipeline exists for a packet type.
bool Contains<T>(TransformationType type) where T : IMinecraftPacketParameters
type TransformationType
The upgrade or downgrade table to query.
Returns
true when a compatible entry exists; otherwise, false.
Type Parameters
T
The packet type to query.
Exceptions
type is not upgrade or downgrade.
Contains(IMinecraftMessage, TransformationType)
Determines whether a transformation pipeline exists for a message’s runtime type.
bool Contains(IMinecraftMessage message, TransformationType type)Parameters
message IMinecraftMessage
The message to query.
type TransformationType
The upgrade or downgrade table to query.
Returns
true when a compatible entry exists; otherwise, false.
Exceptions
type is not upgrade or downgrade.
Contains(Type, TransformationType)
Determines whether a transformation pipeline exists for a runtime packet type.
bool Contains(Type packetType, TransformationType transformationType)Parameters
packetType Type
The type to query.
transformationType TransformationType
The upgrade or downgrade table to query.
Returns
true when a compatible entry exists; otherwise, false.
Exceptions
transformationType is not upgrade or downgrade.
Replace(IReadOnlyDictionary<IEnumerable<MinecraftPacketTransformationMapping>, Type>, ProtocolVersion)
Clears existing pipelines and selects transformations applicable beyond a protocol version.
IMinecraftPacketTransformationsRegistry Replace(IReadOnlyDictionary<IEnumerable<MinecraftPacketTransformationMapping>, Type> mappings, ProtocolVersion protocolVersion)Parameters
mappings IReadOnlyDictionary<IEnumerable<MinecraftPacketTransformationMapping>, Type>
Packet types keyed by their transformation mappings.
protocolVersion ProtocolVersion
The current protocol version used to filter mappings.
Returns
IMinecraftPacketTransformationsRegistry
This registry.
Exceptions
More than one mapping set attempts to register the same packet type.
TryGetFor(Type, TransformationType, out MinecraftPacketTransformation[])
Attempts to get the exact packet type’s ordered transformation pipeline.
bool TryGetFor(Type packetType, TransformationType type, out MinecraftPacketTransformation[] transformation)Parameters
packetType Type
The exact registered packet type.
type TransformationType
The upgrade or downgrade table to query.
transformation MinecraftPacketTransformation[]
When successful, the ordered transformation array; otherwise, null.
Returns
true when an exact entry exists; otherwise, false.
Exceptions
type is not upgrade or downgrade.