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 wire format is [u16 count][count × key][i32 packedByteLength][packed indices], little-endian, with
no leading type byte — height and tint are told apart by their position in SetColumn. The key width is
the only difference between the two: SerializeShortKeys() (heights) vs
SerializeIntKeys() (tints).
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
SerializeIntKeys()
Serialize with 32-bit LE keys (tints).
public byte[] SerializeIntKeys()
Returns
- byte[]
SerializeShortKeys()
Serialize with 16-bit LE keys (heights).
public byte[] SerializeShortKeys()
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)