Skip to content

Class DoubleProperty

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

Represents a big-endian IEEE 754 double-precision packet property.

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

Inheritance

objectDoubleProperty

Implements

IPacketProperty<DoubleProperty>, IPacketProperty, IEquatable<DoubleProperty>

Inherited Members

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

Constructors

DoubleProperty(ReadOnlyMemory<byte>)

Represents a big-endian IEEE 754 double-precision packet property.

public DoubleProperty(ReadOnlyMemory<byte> Value)

Parameters

Value ReadOnlyMemory<byte>

The encoded property bytes, retained without copying or validation.

Properties

AsPrimitive

Gets the double-precision value decoded from the property bytes.

public double AsPrimitive { get; }

Property Value

double

Value

The encoded property bytes, retained without copying or validation.

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

Property Value

ReadOnlyMemory<byte>

Methods

FromPrimitive(double)

Encodes a double-precision value as a packet property.

public static DoubleProperty FromPrimitive(double value)

Parameters

value double

The value to encode.

Returns

DoubleProperty

A property containing eight big-endian bytes.

Read(ref MinecraftBuffer)

Reads one big-endian double-precision value from a buffer.

public static DoubleProperty Read(ref MinecraftBuffer buffer)

Parameters

buffer MinecraftBuffer

The source buffer.

Returns

DoubleProperty

The decoded property.

Write(ref MinecraftBuffer)

Writes the decoded double-precision value in big-endian order.

public void Write(ref MinecraftBuffer buffer)

Parameters

buffer MinecraftBuffer

The destination buffer.