Skip to content

Class LongProperty

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

Represents a 64-bit signed integer property encoded as the Minecraft long binary format.

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

Inheritance

objectLongProperty

Implements

IPacketProperty<LongProperty>, IPacketProperty, IEquatable<LongProperty>

Inherited Members

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

Constructors

LongProperty(ReadOnlyMemory<byte>)

Represents a 64-bit signed integer property encoded as the Minecraft long binary format.

public LongProperty(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 property 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 as eight big-endian bytes.

public static LongProperty FromPrimitive(long value)

Parameters

value long

The value to encode.

Returns

LongProperty

The encoded property.

Read(ref MinecraftBuffer)

Reads one big-endian signed 64-bit integer from a buffer.

public static LongProperty Read(ref MinecraftBuffer buffer)

Parameters

buffer MinecraftBuffer

The source buffer.

Returns

LongProperty

The decoded property.

Write(ref MinecraftBuffer)

Writes the decoded signed 64-bit integer in big-endian order.

public void Write(ref MinecraftBuffer buffer)

Parameters

buffer MinecraftBuffer

The destination buffer.