Skip to content

Class VarLongProperty

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

Represents a Minecraft variable-length signed 64-bit packet property.

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

Inheritance

objectVarLongProperty

Implements

IPacketProperty<VarLongProperty>, IPacketProperty, IEquatable<VarLongProperty>

Inherited Members

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

Constructors

VarLongProperty(ReadOnlyMemory<byte>)

Represents a Minecraft variable-length signed 64-bit packet property.

public VarLongProperty(ReadOnlyMemory<byte> Value)

Parameters

Value ReadOnlyMemory<byte>

The encoded property bytes, retained without copying or validation.

Properties

AsPrimitive

Gets the signed 64-bit value decoded from the variable-length bytes.

public long AsPrimitive { get; }

Property Value

long

Value

The encoded property bytes, retained without copying or validation.

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

Property Value

ReadOnlyMemory<byte>

Methods

FromPrimitive(long)

Encodes a signed 64-bit integer using Minecraft variable-length encoding.

public static VarLongProperty FromPrimitive(long value)

Parameters

value long

The value to encode.

Returns

VarLongProperty

The encoded property.

Read(ref MinecraftBuffer)

Reads one variable-length signed 64-bit integer from a buffer.

public static VarLongProperty Read(ref MinecraftBuffer buffer)

Parameters

buffer MinecraftBuffer

The source buffer.

Returns

VarLongProperty

The decoded property.

Exceptions

InvalidOperationException

The encoding uses more than ten bytes.

Write(ref MinecraftBuffer)

Writes the decoded value using Minecraft variable-length encoding.

public void Write(ref MinecraftBuffer buffer)

Parameters

buffer MinecraftBuffer

The destination buffer.