Class DhApiChunk
java.lang.Object
com.seibel.distanthorizons.api.objects.data.DhApiChunk
Contains a list of
DhApiTerrainDataPoint
representing the blocks in a Minecraft chunk.- Since:
- API 2.0.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal int
final int
final int
final int
-
Constructor Summary
ConstructorsConstructorDescriptionDhApiChunk
(int chunkPosX, int chunkPosZ, int topYBlockPos, int bottomYBlockPos) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionstatic DhApiChunk
create
(int chunkPosX, int chunkPosZ, int bottomYBlockPos, int topYBlockPos) getDataPoints
(int relX, int relZ) void
setDataPoints
(int relX, int relZ, List<DhApiTerrainDataPoint> dataPoints)
-
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.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 chunkrelZ
- 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 chunkrelZ
- a block position between 0 and 15 (inclusive) representing the Z axis in the chunkdataPoints
- 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 chunkIllegalArgumentException
-