Skip to content

Class BoolProperty

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

Represents a one-byte Boolean packet property.

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

Inheritance

objectBoolProperty

Implements

IPacketProperty<BoolProperty>, IPacketProperty, IEquatable<BoolProperty>

Inherited Members

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

Constructors

BoolProperty(ReadOnlyMemory<byte>)

Represents a one-byte Boolean packet property.

public BoolProperty(ReadOnlyMemory<byte> Value)

Parameters

Value ReadOnlyMemory<byte>

The encoded property bytes, retained without copying or validation.

Properties

AsPrimitive

Gets the encoded byte converted to a Boolean.

public bool AsPrimitive { get; }

Property Value

bool

Value

The encoded property bytes, retained without copying or validation.

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

Property Value

ReadOnlyMemory<byte>

Methods

FromPrimitive(bool)

Encodes a Boolean as a packet property.

public static BoolProperty FromPrimitive(bool value)

Parameters

value bool

The value to encode.

Returns

BoolProperty

A property containing 0 or 1.

Read(ref MinecraftBuffer)

Reads one Boolean byte from a buffer.

public static BoolProperty Read(ref MinecraftBuffer buffer)

Parameters

buffer MinecraftBuffer

The source buffer.

Returns

BoolProperty

The decoded property.

Write(ref MinecraftBuffer)

Writes the decoded Boolean as one byte.

public void Write(ref MinecraftBuffer buffer)

Parameters

buffer MinecraftBuffer

The destination buffer.