All Known Implementing Classes:
GlobalPalette, ListPalette, MapPalette, SingletonPalette

public interface Palette
A palette for mapping block states to storage IDs.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    idToState(int id)
    Converts a storage ID to a block state.
    int
    Gets the number of block states known by this palette.
    int
    stateToId(int state)
    Converts a block state to a storage ID.
  • Method Details

    • size

      int size()
      Gets the number of block states known by this palette.
      Returns:
      The palette's size.
    • stateToId

      int stateToId(int state)
      Converts a block state to a storage ID. If the state has not been mapped, the palette will attempt to map it, returning -1 if it cannot.
      Parameters:
      state - Block state to convert.
      Returns:
      The resulting storage ID.
    • idToState

      int idToState(int id)
      Converts a storage ID to a block state. If the storage ID has no mapping, it will return a block state of 0.
      Parameters:
      id - Storage ID to convert.
      Returns:
      The resulting block state.