Interface DataPalette

All Known Implementing Classes:
DataPaletteImpl

public interface DataPalette
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addId(int id)
    Adds a new id to the palette.
    void
    Clears the palette.
    int
    idAt(int sectionCoordinate)
    Returns the value of the given chunk coordinate.
    default int
    idAt(int sectionX, int sectionY, int sectionZ)
    Returns the value of the section coordinate.
    int
    idByIndex(int index)
    Returns the id assigned to the given palette index.
    int
    index(int x, int y, int z)
    Returns the packet section index of the given coordinates.
    int
    paletteIndexAt(int packedCoordinate)
    Returns the palette index of the given section index.
    void
    replaceId(int oldId, int newId)
    Replaces an id in the palette.
    void
    setIdAt(int sectionCoordinate, int id)
    Set a value in the chunk section.
    default void
    setIdAt(int sectionX, int sectionY, int sectionZ, int id)
    Set a value in the chunk section.
    void
    setIdByIndex(int index, int id)
    Assigns an id assigned to the given palette index.
    void
    setPaletteIndexAt(int sectionCoordinate, int index)
    Sets the index of the given section coordinate.
    int
    Returns the size of the palette.
  • Method Details

    • index

      int index(int x, int y, int z)
      Returns the packet section index of the given coordinates.
      Parameters:
      x - x
      y - y
      z - z
      Returns:
      packed section index of the given coordinates
    • idAt

      int idAt(int sectionCoordinate)
      Returns the value of the given chunk coordinate.
      Parameters:
      sectionCoordinate - section index within the section
      Returns:
      section state of the given index
    • idAt

      default int idAt(int sectionX, int sectionY, int sectionZ)
      Returns the value of the section coordinate.
      Parameters:
      sectionX - section x
      sectionY - section y
      sectionZ - section z
      Returns:
      id of the given section coordinate
    • setIdAt

      void setIdAt(int sectionCoordinate, int id)
      Set a value in the chunk section. This method does not update non-air blocks count.
      Parameters:
      sectionCoordinate - section index within the section
      id - id value
    • setIdAt

      default void setIdAt(int sectionX, int sectionY, int sectionZ, int id)
      Set a value in the chunk section. This method does not update non-air blocks count.
      Parameters:
      sectionX - section x
      sectionY - section y
      sectionZ - section z
      id - id value
    • idByIndex

      int idByIndex(int index)
      Returns the id assigned to the given palette index.
      Parameters:
      index - palette index
      Returns:
      id assigned to the given palette index
    • setIdByIndex

      void setIdByIndex(int index, int id)
      Assigns an id assigned to the given palette index.
      Parameters:
      index - palette index
      id - id value
    • paletteIndexAt

      int paletteIndexAt(int packedCoordinate)
      Returns the palette index of the given section index.
      Parameters:
      packedCoordinate - section index
      Returns:
      palette index of the given section index
    • setPaletteIndexAt

      void setPaletteIndexAt(int sectionCoordinate, int index)
      Sets the index of the given section coordinate.
      Parameters:
      sectionCoordinate - section index
      index - palette index
    • addId

      void addId(int id)
      Adds a new id to the palette.
      Parameters:
      id - id value
    • replaceId

      void replaceId(int oldId, int newId)
      Replaces an id in the palette.
      Parameters:
      oldId - old id
      newId - new id
    • size

      int size()
      Returns the size of the palette.
      Returns:
      palette size
    • clear

      void clear()
      Clears the palette.