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
    • bottomYBlockPos

      public final int bottomYBlockPos
    • topYBlockPos

      public final int topYBlockPos
  • Constructor Details

    • DhApiChunk

      @Deprecated public DhApiChunk(int chunkPosX, int chunkPosZ, int topYBlockPos, int bottomYBlockPos)
      Deprecated.
      Deprecated due to the topYBlockPos and bottomYBlockPos variables being put in the wrong order. They should have been in bottom -> top order.
      See Also:
  • Method Details

    • create

      public static DhApiChunk create(int chunkPosX, int chunkPosZ, int bottomYBlockPos, int topYBlockPos)
      Since:
      API 3.0.0
    • 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