java.lang.Object
com.github.retrooper.packetevents.protocol.world.chunk.palette.ListPalette
All Implemented Interfaces:
Palette

public class ListPalette extends Object implements Palette
A palette backed by a List.
  • Constructor Details

    • ListPalette

      public ListPalette(int bitsPerEntry)
    • ListPalette

      public ListPalette(int bitsPerEntry, NetStreamInput in)
  • Method Details

    • size

      public int size()
      Description copied from interface: Palette
      Gets the number of block states known by this palette.
      Specified by:
      size in interface Palette
      Returns:
      The palette's size.
    • stateToId

      public int stateToId(int state)
      Description copied from interface: Palette
      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.
      Specified by:
      stateToId in interface Palette
      Parameters:
      state - Block state to convert.
      Returns:
      The resulting storage ID.
    • idToState

      public int idToState(int id)
      Description copied from interface: Palette
      Converts a storage ID to a block state. If the storage ID has no mapping, it will return a block state of 0.
      Specified by:
      idToState in interface Palette
      Parameters:
      id - Storage ID to convert.
      Returns:
      The resulting block state.