Interface IDhApiTerrainDataRepo
public interface IDhApiTerrainDataRepo
Used to interface with Distant Horizons' terrain data.
- Since:
- API 1.0.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault DhApiResult
<DhApiTerrainDataPoint[][][]> getAllTerrainDataAtChunkPos
(IDhApiLevelWrapper levelWrapper, int chunkPosX, int chunkPosZ) DhApiResult
<DhApiTerrainDataPoint[][][]> getAllTerrainDataAtChunkPos
(IDhApiLevelWrapper levelWrapper, int chunkPosX, int chunkPosZ, IDhApiTerrainDataCache dataCache) Returns every datapoint in the given chunk's X and Z position.DhApiResult
<DhApiTerrainDataPoint[][][]> getAllTerrainDataAtDetailLevelAndPos
(IDhApiLevelWrapper levelWrapper, byte detailLevel, int posX, int posZ, IDhApiTerrainDataCache dataCache) Returns every datapoint in the column located at the given detail level and X/Z position.default DhApiResult
<DhApiTerrainDataPoint[][][]> getAllTerrainDataAtRegionPos
(IDhApiLevelWrapper levelWrapper, byte detailLevel, int posX, int posZ) default DhApiResult
<DhApiTerrainDataPoint[][][]> getAllTerrainDataAtRegionPos
(IDhApiLevelWrapper levelWrapper, int regionPosX, int regionPosZ) DhApiResult
<DhApiTerrainDataPoint[][][]> getAllTerrainDataAtRegionPos
(IDhApiLevelWrapper levelWrapper, int regionPosX, int regionPosZ, IDhApiTerrainDataCache dataCache) Returns every datapoint in the given region's X and Z position.default DhApiResult
<DhApiTerrainDataPoint[]> getColumnDataAtBlockPos
(IDhApiLevelWrapper levelWrapper, int blockPosX, int blockPosZ) getColumnDataAtBlockPos
(IDhApiLevelWrapper levelWrapper, int blockPosX, int blockPosZ, IDhApiTerrainDataCache dataCache) Returns every datapoint in the column located at the given block X and Z position top to bottom.default DhApiResult
<DhApiTerrainDataPoint> getSingleDataPointAtBlockPos
(IDhApiLevelWrapper levelWrapper, int blockPosX, int blockPosY, int blockPosZ) getSingleDataPointAtBlockPos
(IDhApiLevelWrapper levelWrapper, int blockPosX, int blockPosY, int blockPosZ, IDhApiTerrainDataCache dataCache) Returns the terrain datapoint at the given block position, at/or containing the given Y position.overwriteChunkDataAsync
(IDhApiLevelWrapper levelWrapper, Object[] chunkObjectArray) Sets the LOD data for the given chunk at the chunk's position.default DhApiResult
<DhApiRaycastResult> raycast
(IDhApiLevelWrapper levelWrapper, double rayOriginX, double rayOriginY, double rayOriginZ, float rayDirectionX, float rayDirectionY, float rayDirectionZ, int maxRayBlockLength) raycast
(IDhApiLevelWrapper levelWrapper, double rayOriginX, double rayOriginY, double rayOriginZ, float rayDirectionX, float rayDirectionY, float rayDirectionZ, int maxRayBlockLength, IDhApiTerrainDataCache dataCache) Returns the datapoint and position of the LOD at the end of the given ray.
-
Method Details
-
getSingleDataPointAtBlockPos
default DhApiResult<DhApiTerrainDataPoint> getSingleDataPointAtBlockPos(IDhApiLevelWrapper levelWrapper, int blockPosX, int blockPosY, int blockPosZ) - See Also:
-
getSingleDataPointAtBlockPos
DhApiResult<DhApiTerrainDataPoint> getSingleDataPointAtBlockPos(IDhApiLevelWrapper levelWrapper, int blockPosX, int blockPosY, int blockPosZ, IDhApiTerrainDataCache dataCache) Returns the terrain datapoint at the given block position, at/or containing the given Y position.- Since:
- API 3.0.0
-
getColumnDataAtBlockPos
default DhApiResult<DhApiTerrainDataPoint[]> getColumnDataAtBlockPos(IDhApiLevelWrapper levelWrapper, int blockPosX, int blockPosZ) - See Also:
-
getColumnDataAtBlockPos
DhApiResult<DhApiTerrainDataPoint[]> getColumnDataAtBlockPos(IDhApiLevelWrapper levelWrapper, int blockPosX, int blockPosZ, IDhApiTerrainDataCache dataCache) Returns every datapoint in the column located at the given block X and Z position top to bottom.- Since:
- API 3.0.0
-
getAllTerrainDataAtChunkPos
default DhApiResult<DhApiTerrainDataPoint[][][]> getAllTerrainDataAtChunkPos(IDhApiLevelWrapper levelWrapper, int chunkPosX, int chunkPosZ) - See Also:
-
getAllTerrainDataAtChunkPos
DhApiResult<DhApiTerrainDataPoint[][][]> getAllTerrainDataAtChunkPos(IDhApiLevelWrapper levelWrapper, int chunkPosX, int chunkPosZ, IDhApiTerrainDataCache dataCache) Returns every datapoint in the given chunk's X and Z position.
The returned array is ordered: [relativeBlockX][relativeBlockZ][columnIndex]
RelativeBlockX/Z are relative to the block position closest to negative infinity in the chunk's position.
The column data is ordered from top to bottom. Note: each column may have a different number of values.- Since:
- API 3.0.0
-
getAllTerrainDataAtRegionPos
default DhApiResult<DhApiTerrainDataPoint[][][]> getAllTerrainDataAtRegionPos(IDhApiLevelWrapper levelWrapper, int regionPosX, int regionPosZ) - See Also:
-
getAllTerrainDataAtRegionPos
DhApiResult<DhApiTerrainDataPoint[][][]> getAllTerrainDataAtRegionPos(IDhApiLevelWrapper levelWrapper, int regionPosX, int regionPosZ, IDhApiTerrainDataCache dataCache) Returns every datapoint in the given region's X and Z position.
The returned array is ordered: [relativeBlockX][relativeBlockZ][columnIndex]
RelativeBlockX/Z are relative to the block position closest to negative infinity in the region's position.
The column data is ordered from top to bottom. Note: each column may have a different number of values.- Since:
- API 3.0.0
-
getAllTerrainDataAtRegionPos
default DhApiResult<DhApiTerrainDataPoint[][][]> getAllTerrainDataAtRegionPos(IDhApiLevelWrapper levelWrapper, byte detailLevel, int posX, int posZ) - See Also:
-
getAllTerrainDataAtDetailLevelAndPos
DhApiResult<DhApiTerrainDataPoint[][][]> getAllTerrainDataAtDetailLevelAndPos(IDhApiLevelWrapper levelWrapper, byte detailLevel, int posX, int posZ, IDhApiTerrainDataCache dataCache) Returns every datapoint in the column located at the given detail level and X/Z position.
This can be used to return terrain data for non-standard sizes (IE 2x2 blocks or 2x2 chunks).- Parameters:
detailLevel
- a positive byte defining the detail level of the returned data.
Every increase doubles the width of the returned area.
Example values: 0 = block, 1 = 2x2 blocks, 2 = 4x4 blocks, ... 4 = chunk (16x16 blocks), ... 9 = region (512x512 blocks)
SeeEDhApiDetailLevel
for more information.- Since:
- API 3.0.0
-
raycast
default DhApiResult<DhApiRaycastResult> raycast(IDhApiLevelWrapper levelWrapper, double rayOriginX, double rayOriginY, double rayOriginZ, float rayDirectionX, float rayDirectionY, float rayDirectionZ, int maxRayBlockLength) - See Also:
-
raycast
DhApiResult<DhApiRaycastResult> raycast(IDhApiLevelWrapper levelWrapper, double rayOriginX, double rayOriginY, double rayOriginZ, float rayDirectionX, float rayDirectionY, float rayDirectionZ, int maxRayBlockLength, IDhApiTerrainDataCache dataCache) Returns the datapoint and position of the LOD at the end of the given ray.
Will return "success" with a null datapoint if the ray reaches the max length without finding any data.- Since:
- API 3.0.0
-
overwriteChunkDataAsync
DhApiResult<Void> overwriteChunkDataAsync(IDhApiLevelWrapper levelWrapper, Object[] chunkObjectArray) throws ClassCastException Sets the LOD data for the given chunk at the chunk's position.
Notes:
- Only works if the givenIDhApiLevelWrapper
points to a loaded level.
- If the player travels to this chunk, or the chunk is updated in some other way; your data will be replaced by whatever the current chunk is.
- This method may not update the LOD data immediately. Any other chunks that have been queued to update will be handled first.- Parameters:
levelWrapper
- the level wrapper that the chunk should be saved to.chunkObjectArray
- seeIDhApiWorldGenerator.generateChunks(int, int, int, byte, com.seibel.distanthorizons.api.enums.worldGeneration.EDhApiDistantGeneratorMode, java.util.concurrent.ExecutorService, java.util.function.Consumer<java.lang.Object[]>)
for what objects are expected.- Throws:
ClassCastException
- if chunkObjectArray doesn't contain the right objects. The exception will contain the expected object(s).
-
getSoftCache
IDhApiTerrainDataCache getSoftCache()- Returns:
- a
IDhApiTerrainDataCache
backed bySoftReference
's. - Since:
- API 3.0.0
-