java.lang.Object
com.seibel.distanthorizons.api.objects.data.DhApiChunk

public class DhApiChunk extends Object
Contains a list of DhApiTerrainDataPoint representing the blocks in a Minecraft chunk.
Since:
API 2.0.0
See Also:
  • Field Details

    • chunkPosX

      public final int chunkPosX
    • chunkPosZ

      public final int chunkPosZ
    • topYBlockPos

      public final int topYBlockPos
    • bottomYBlockPos

      public final int bottomYBlockPos
  • Constructor Details

    • DhApiChunk

      public DhApiChunk(int chunkPosX, int chunkPosZ, int topYBlockPos, int bottomYBlockPos)
  • Method Details

    • getDataPoints

      public List<DhApiTerrainDataPoint> getDataPoints(int relX, int relZ) throws IndexOutOfBoundsException
      Parameters:
      relX - a block position between 0 and 15 (inclusive) representing the X axis in the chunk
      relZ - a block position between 0 and 15 (inclusive) representing the Z axis in the chunk
      Returns:
      the DhApiTerrainDataPoint's representing the blocks at the relative X and Z position in the chunk.
      Throws:
      IndexOutOfBoundsException - if relX or relZ are outside the chunk
    • setDataPoints

      public void setDataPoints(int relX, int relZ, List<DhApiTerrainDataPoint> dataPoints) throws IndexOutOfBoundsException, IllegalArgumentException
      Parameters:
      relX - a block position between 0 and 15 (inclusive) representing the X axis in the chunk
      relZ - a block position between 0 and 15 (inclusive) representing the Z axis in the chunk
      dataPoints - Represents the blocks at the relative X and Z position in the chunk. Cannot contain null objects or data points with any detail level but 0 (block-sized).
      Throws:
      IndexOutOfBoundsException - if relX or relZ are outside the chunk
      IllegalArgumentException