Skip to content

Class UuidProperty

Namespace: Void.Minecraft.Network.Registries.Transformations.Properties
Assembly: Void.Minecraft.dll

Represents a UUID encoded as two 64-bit Minecraft protocol values.

public record UuidProperty : IPacketProperty<UuidProperty>, IPacketProperty, IEquatable<UuidProperty>

Inheritance

objectUuidProperty

Implements

IPacketProperty<UuidProperty>, IPacketProperty, IEquatable<UuidProperty>

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Constructors

UuidProperty(ReadOnlyMemory<byte>)

Represents a UUID encoded as two 64-bit Minecraft protocol values.

public UuidProperty(ReadOnlyMemory<byte> Value)

Parameters

Value ReadOnlyMemory<byte>

The encoded 16-byte value, retained without copying or validation.

Properties

AsUuid

Gets the UUID decoded from the property bytes.

public Uuid AsUuid { get; }

Property Value

Uuid

Empty

Gets a property containing the zero UUID.

public static UuidProperty Empty { get; }

Property Value

UuidProperty

Value

The encoded 16-byte value, retained without copying or validation.

public ReadOnlyMemory<byte> Value { get; init; }

Property Value

ReadOnlyMemory<byte>

Methods

FromUuid(Uuid)

Encodes a UUID as a packet property.

public static UuidProperty FromUuid(Uuid value)

Parameters

value Uuid

The UUID to encode.

Returns

UuidProperty

A property backed by a new 16-byte array.

Read(ref MinecraftBuffer)

Reads a UUID from the current position of the specified buffer and wraps its 16-byte representation in a property.

public static UuidProperty Read(ref MinecraftBuffer buffer)

Parameters

buffer MinecraftBuffer

The buffer to read from. Its position is advanced by 16 bytes.

Returns

UuidProperty

A property containing the UUID read from buffer.

Write(ref MinecraftBuffer)

Writes the decoded UUID to a buffer.

public void Write(ref MinecraftBuffer buffer)

Parameters

buffer MinecraftBuffer

The destination buffer.