java.lang.Object
com.viaversion.viaversion.api.minecraft.chunks.NibbleArray

public class NibbleArray extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    NibbleArray(byte[] handle)
     
    NibbleArray(int length)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Get the actual number of bytes
    void
    fill(byte value)
    Fill the array with a value
    byte
    get(int index)
    Get the value at an index
    byte
    get(int x, int y, int z)
    Get the value at a desired X, Y, Z
    byte[]
    Get the byte array behind this nibble
    void
    set(int index, int value)
    Set a value at an index
    void
    set(int x, int y, int z, int value)
    Set the value based on an x, y, z
    void
    setHandle(byte[] handle)
    Copy a byte array into this nibble
    int
    The size of this nibble

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • NibbleArray

      public NibbleArray(int length)
    • NibbleArray

      public NibbleArray(byte[] handle)
  • Method Details

    • get

      public byte get(int x, int y, int z)
      Get the value at a desired X, Y, Z
      Parameters:
      x - Block X
      y - Block Y
      z - Block Z
      Returns:
      The value at the given XYZ
    • get

      public byte get(int index)
      Get the value at an index
      Parameters:
      index - The index to lookup
      Returns:
      The value at that index.
    • set

      public void set(int x, int y, int z, int value)
      Set the value based on an x, y, z
      Parameters:
      x - Block X
      y - Block Y
      z - Block Z
      value - Desired Value
    • set

      public void set(int index, int value)
      Set a value at an index
      Parameters:
      index - The index to set the value at.
      value - The desired value
    • size

      public int size()
      The size of this nibble
      Returns:
      The size as an int of the nibble
    • actualSize

      public int actualSize()
      Get the actual number of bytes
      Returns:
      The number of bytes based on the handle.
    • fill

      public void fill(byte value)
      Fill the array with a value
      Parameters:
      value - Value to fill with
    • getHandle

      public byte[] getHandle()
      Get the byte array behind this nibble
      Returns:
      The byte array
    • setHandle

      public void setHandle(byte[] handle)
      Copy a byte array into this nibble
      Parameters:
      handle - The byte array to copy in.