Skip to content

Class ByteProperty

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

Represents a one-byte unsigned packet property.

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

Inheritance

objectByteProperty

Implements

IPacketProperty<ByteProperty>, IPacketProperty, IEquatable<ByteProperty>

Inherited Members

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

Constructors

ByteProperty(ReadOnlyMemory<byte>)

Represents a one-byte unsigned packet property.

public ByteProperty(ReadOnlyMemory<byte> Value)

Parameters

Value ReadOnlyMemory<byte>

The encoded property bytes, retained without copying or validation.

Properties

AsPrimitive

Gets the first encoded byte.

public byte AsPrimitive { get; }

Property Value

byte

Value

The encoded property bytes, retained without copying or validation.

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

Property Value

ReadOnlyMemory<byte>

Methods

FromPrimitive(byte)

Encodes an unsigned byte as a packet property.

public static ByteProperty FromPrimitive(byte value)

Parameters

value byte

The value to encode.

Returns

ByteProperty

A property containing the byte.

Read(ref MinecraftBuffer)

Reads one unsigned byte from a buffer.

public static ByteProperty Read(ref MinecraftBuffer buffer)

Parameters

buffer MinecraftBuffer

The source buffer.

Returns

ByteProperty

The decoded property.

Write(ref MinecraftBuffer)

Writes the decoded unsigned byte.

public void Write(ref MinecraftBuffer buffer)

Parameters

buffer MinecraftBuffer

The destination buffer.