Class ColumnBytePalette
A per-column palette of one value per (x,z) cell over a 32×32 column (Java: IntBytePalette for
tints, ShortBytePalette for heights). Distinct values are interned into a key table and each of the
1024 cells stores a 10-bit index into it (via BitFieldArray). Cell 0 defaults to key 0.
The direct serialization returns one value per cell for the heightmap packet field. The tint packet field uses
the Hytale IntBytePalette format: [u16 count][count × i32 key][i32 packedByteLength][packed indices],
little-endian.
public sealed class ColumnBytePalette
- Inheritance
-
ColumnBytePalette
- Inherited Members
Fields
BitsPerIndex
public const int BitsPerIndex = 10
Field Value
CellCount
public const int CellCount = 1024
Field Value
Edge
public const int Edge = 32
Field Value
Methods
CellIndex(int, int)
Column cell index for (x,z): z<<5 | x, range 0..1023.
public static int CellIndex(int x, int z)
Parameters
Returns
Get(int, int)
The value at column cell (x,z).
public int Get(int x, int z)
Parameters
Returns
Serialize()
Serialize the value of each cell in z * 32 + x order.
public int[] Serialize()
Returns
- int[]
SerializeIntPalette()
Serialize the palette with 32-bit keys for the Hytale tintmap packet field.
public byte[] SerializeIntPalette()
Returns
- byte[]
Set(int, int, int)
Set the value at column cell (x,z), interning it into the key table.
public void Set(int x, int z, int value)