Skip to content

Class FloatProperty

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

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

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

Inheritance

objectFloatProperty

Implements

IPacketProperty<FloatProperty>, IPacketProperty, IEquatable<FloatProperty>

Inherited Members

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

Constructors

FloatProperty(ReadOnlyMemory<byte>)

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

public FloatProperty(ReadOnlyMemory<byte> Value)

Parameters

Value ReadOnlyMemory<byte>

The encoded property bytes, retained without copying or validation.

Properties

AsPrimitive

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

public float AsPrimitive { get; }

Property Value

float

Value

The encoded property bytes, retained without copying or validation.

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

Property Value

ReadOnlyMemory<byte>

Methods

FromPrimitive(float)

Creates a property payload containing the big-endian Minecraft binary representation of a single-precision floating-point value.

public static FloatProperty FromPrimitive(float value)

Parameters

value float

The value to serialize into the property payload.

Returns

FloatProperty

A whose contains the serialized value.

Read(ref MinecraftBuffer)

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

public static FloatProperty Read(ref MinecraftBuffer buffer)

Parameters

buffer MinecraftBuffer

The source buffer.

Returns

FloatProperty

The decoded property.

Write(ref MinecraftBuffer)

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

public void Write(ref MinecraftBuffer buffer)

Parameters

buffer MinecraftBuffer

The destination buffer.