Class ArgumentSerializerMapping
Namespace: Void.Minecraft.Commands.Brigadier.Registry
Assembly: Void.Minecraft.dll
Maps a command argument identifier to parser IDs that take effect at protocol-version thresholds.
public record ArgumentSerializerMapping : IEquatable<ArgumentSerializerMapping>Inheritance
object ← ArgumentSerializerMapping
Implements
IEquatable<ArgumentSerializerMapping>
Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
Constructors
ArgumentSerializerMapping(string, Dictionary<ProtocolVersion, int>)
Maps a command argument identifier to parser IDs that take effect at protocol-version thresholds.
public ArgumentSerializerMapping(string Identifier, Dictionary<ProtocolVersion, int> VersionParserMappings)Parameters
Identifier string
The namespaced parser identifier used before 1.19.
VersionParserMappings Dictionary<ProtocolVersion, int>
Parser-ID changes keyed by their first applicable protocol version.
ArgumentSerializerMapping(string)
Creates an identifier-only mapping used by protocols before numeric parser IDs.
public ArgumentSerializerMapping(string identifier)Parameters
identifier string
The namespaced parser identifier.
ArgumentSerializerMapping(string, ProtocolVersion, int)
Creates a mapping with one numeric parser-ID threshold.
public ArgumentSerializerMapping(string identifier, ProtocolVersion protocolVersion, int parserId)Parameters
identifier string
The namespaced parser identifier.
protocolVersion ProtocolVersion
The first version using the ID.
parserId int
The numeric parser ID.
Properties
Identifier
The namespaced parser identifier used before 1.19.
public string Identifier { get; init; }Property Value
VersionParserIdMapping
Gets the expanded parser ID for every supported applicable protocol version.
public FrozenDictionary<ProtocolVersion, int> VersionParserIdMapping { get; }Property Value
FrozenDictionary<ProtocolVersion, int>
VersionParserMappings
Parser-ID changes keyed by their first applicable protocol version.
public Dictionary<ProtocolVersion, int> VersionParserMappings { get; init; }Property Value
Dictionary<ProtocolVersion, int>
Methods
TryGetParserId(ProtocolVersion, out int)
Attempts to get the numeric parser ID for an exact supported protocol version.
public bool TryGetParserId(ProtocolVersion version, out int id)Parameters
version ProtocolVersion
The protocol version.
id int
The mapped ID when present.
Returns
true when a numeric mapping exists.