Palette

sealed class Palette<ElementType>

Represents the palette of elements used in a chunk section. This palette allows to save space when saving to disk or transferring over network, as it lowers the required number of bits used to represent an element, by remapping global IDs to local IDs, with fewer bits per entry.

Functions

compactIDs
Link copied to clipboard
fun compactIDs(states: Array<ElementType>, version: SupportedVersion = SupportedVersion.Latest, minimumBitSize: Int = 1): ImmutableLongArray
Produces a long array with the compacted IDs based on this palette.
decreaseReference
Link copied to clipboard
fun decreaseReference(block: ElementType)
Decreases the number of references to the given element.
increaseReference
Link copied to clipboard
fun increaseReference(block: ElementType)
Increases the reference count of the given element.
isEmpty
Link copied to clipboard
fun isEmpty(): Boolean
Returns true iif the only referenced block inside this palette is "minecraft:air"
toNBT
Link copied to clipboard
fun toNBT(): NBTList<NBT>
Converts this Palette into its NBT representation

Properties

elements
Link copied to clipboard
val elements: MutableList<ElementType>

Inheritors

BlockPalette
Link copied to clipboard
BiomePalette
Link copied to clipboard