Class DataLayer

java.lang.Object
net.minecraft.world.level.chunk.DataLayer

public class DataLayer extends Object
A representation of a 16x16x16 cube of nibbles (half-bytes).
  • Field Details

  • Constructor Details

    • DataLayer

      public DataLayer()
    • DataLayer

      public DataLayer(int pSize)
    • DataLayer

      public DataLayer(byte[] pData)
  • Method Details

    • get

      public int get(int pX, int pY, int pZ)
      Note all coordinates must be in the range [0, 16), they are not checked, and will either silently overrun the array or throw an exception.
      Returns:
      The value of this data layer at the provided position.
    • set

      public void set(int pX, int pY, int pZ, int pValue)
      Sets the value of this data layer at the provided position. Note all coordinates must be in the range [0, 16), they are not checked, and will either silently overrun the array or throw an exception.
    • getIndex

      private static int getIndex(int pX, int pY, int pZ)
    • get

      private int get(int pIndex)
    • set

      private void set(int pIndex, int pValue)
    • getNibbleIndex

      private static int getNibbleIndex(int pIndex)
    • getByteIndex

      private static int getByteIndex(int pIndex)
    • fill

      public void fill(int pDefaultValue)
    • packFilled

      private static byte packFilled(int pValue)
    • getData

      public byte[] getData()
    • copy

      public DataLayer copy()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • layerToString

      public String layerToString(int pUnused)
    • isDefinitelyHomogenous

      public boolean isDefinitelyHomogenous()
    • isDefinitelyFilledWith

      public boolean isDefinitelyFilledWith(int pValue)
    • isEmpty

      public boolean isEmpty()