Skip to content

Class ShortProperty

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

Represents a big-endian signed 16-bit packet property.

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

Inheritance

objectShortProperty

Implements

IPacketProperty<ShortProperty>, IPacketProperty, IEquatable<ShortProperty>

Inherited Members

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

Constructors

ShortProperty(ReadOnlyMemory<byte>)

Represents a big-endian signed 16-bit packet property.

public ShortProperty(ReadOnlyMemory<byte> Value)

Parameters

Value ReadOnlyMemory<byte>

The encoded property bytes, retained without copying or validation.

Properties

AsPrimitive

Gets the signed 16-bit value decoded from the property bytes.

public short AsPrimitive { get; }

Property Value

short

Value

The encoded property bytes, retained without copying or validation.

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

Property Value

ReadOnlyMemory<byte>

Methods

FromPrimitive(short)

Encodes a signed 16-bit integer as two big-endian bytes.

public static ShortProperty FromPrimitive(short value)

Parameters

value short

The value to encode.

Returns

ShortProperty

The encoded property.

Read(ref MinecraftBuffer)

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

public static ShortProperty Read(ref MinecraftBuffer buffer)

Parameters

buffer MinecraftBuffer

The source buffer.

Returns

ShortProperty

The decoded property.

Write(ref MinecraftBuffer)

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

public void Write(ref MinecraftBuffer buffer)

Parameters

buffer MinecraftBuffer

The destination buffer.