java.lang.Object
org.geysermc.mcprotocollib.protocol.data.game.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, io.netty.buffer.ByteBuf 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.
    • copy

      public ListPalette copy()
      Description copied from interface: Palette
      Creates a copy of this palette. This performs a deep copy of the palette's internal data.
      Specified by:
      copy in interface Palette
      Returns:
      The palette's copy.
    • getCapacity

      public int getCapacity()
    • getData

      public int[] getData()
    • getNextId

      public int getNextId()
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(@Nullable Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object