Class ListProperty<TPacketProperty>
Namespace: Void.Minecraft.Network.Registries.Transformations.Properties
Assembly: Void.Minecraft.dll
Represents a variable-length-prefixed list of packet properties.
public record ListProperty<TPacketProperty> : IPacketProperty<ListProperty<TPacketProperty>>, IPacketProperty, IEquatable<ListProperty<TPacketProperty>> where TPacketProperty : IPacketProperty<TPacketProperty>Type Parameters
TPacketProperty
The self-decoding property type stored in the list.
Inheritance
object ← ListProperty<TPacketProperty>
Implements
IPacketProperty<ListProperty<TPacketProperty>>, IPacketProperty, IEquatable<ListProperty<TPacketProperty>>
Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
Constructors
ListProperty(List<TPacketProperty>)
Represents a variable-length-prefixed list of packet properties.
public ListProperty(List<TPacketProperty> Values)Parameters
Values List<TPacketProperty>
The mutable element list, retained without copying.
Properties
Values
The mutable element list, retained without copying.
public List<TPacketProperty> Values { get; init; }Property Value
List<TPacketProperty>
Methods
Read(ref MinecraftBuffer)
Reads a list property from buffer using the encoded element count prefix.
public static ListProperty<TPacketProperty> Read(ref MinecraftBuffer buffer)Parameters
buffer MinecraftBuffer
Returns
ListProperty<TPacketProperty>
Remarks
This method first reads the list length as a VarInt and then delegates to TPacketProperty.Read(ref buffer) repeatedly.
Read(ref MinecraftBuffer, int)
Reads an explicit number of elements without consuming a length prefix.
public static ListProperty<TPacketProperty> Read(ref MinecraftBuffer buffer, int size)Parameters
buffer MinecraftBuffer
The source buffer.
size int
The number of elements to decode.
Returns
ListProperty<TPacketProperty>
A property containing a new list of decoded elements.
Exceptions
size is negative.
Write(ref MinecraftBuffer)
Writes the current element count as a variable-length integer followed by each element.
public void Write(ref MinecraftBuffer buffer)Parameters
buffer MinecraftBuffer
The destination buffer.