Table of Contents

Class PalettedChunkData

Namespace
Shard.Gameplay.Universe.World.Chunks
Assembly
Shard.Gameplay.Universe.dll

IChunkData implementation that internally palettes values, storing their indices rather than the values themselves. Can be serialized for use in Hytale.Protocol.Packets.World.SetChunk and Hytale.Protocol.Packets.World.SetFluids packets.

public sealed class PalettedChunkData : IChunkData
Inheritance
PalettedChunkData
Implements
Inherited Members

Properties

IsEmpty

Whether all values are zero.

public bool IsEmpty { get; }

Property Value

bool

this[BlockIndex]

Gets or sets a block's value by its index.

public int this[BlockIndex i] { get; set; }

Parameters

i BlockIndex

Property Value

int

Exceptions

IndexOutOfRangeException

If i is < 0 or >= Volume.

LengthForPacket

public int LengthForPacket { get; }

Property Value

int

Methods

Clear()

Resets all values to zero.

public void Clear()

GetAndSet(BlockIndex, int)

Sets a block's value by its index and returns its previous value.

public int GetAndSet(BlockIndex i, int value)

Parameters

i BlockIndex

The block's index.

value int

The new value.

Returns

int

The previous value.

Exceptions

IndexOutOfRangeException

If i is < 0 or >= Volume.

SerializeForPacket(Span<byte>)

public void SerializeForPacket(Span<byte> output)

Parameters

output Span<byte>