Class PalettedChunkData
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
this[BlockIndex]
Gets or sets a block's value by its index.
public int this[BlockIndex i] { get; set; }
Parameters
Property Value
Exceptions
- IndexOutOfRangeException
If
iis < 0 or >= Volume.
LengthForPacket
public int LengthForPacket { get; }
Property Value
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
iBlockIndexThe block's index.
valueintThe new value.
Returns
- int
The previous value.
Exceptions
- IndexOutOfRangeException
If
iis < 0 or >= Volume.
SerializeForPacket(Span<byte>)
public void SerializeForPacket(Span<byte> output)