Add getHeight method to ChunkData (#12311)
This commit is contained in:
@ -14,6 +14,7 @@ import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.material.MaterialData;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.annotations.Range;
|
||||
|
||||
/**
|
||||
* A chunk generator is responsible for the initial shaping of an entire
|
||||
@ -777,5 +778,18 @@ public abstract class ChunkGenerator {
|
||||
*/
|
||||
@Deprecated(since = "1.8.8")
|
||||
public byte getData(int x, int y, int z);
|
||||
|
||||
/**
|
||||
* Get the current height of a position in the chunk data.
|
||||
* <p>This will differ based on which state generation of the chunk is currently at.
|
||||
* If for example the chunk is in the generate surface stage,
|
||||
* this will return what was already generated in the noise stage.</p>
|
||||
*
|
||||
* @param heightMap Heightmap to determine where to grab height
|
||||
* @param x the x location in the chunk from 0-15 inclusive
|
||||
* @param z the z location in the chunk from 0-15 inclusive
|
||||
* @return Y coordinate at highest position
|
||||
*/
|
||||
int getHeight(@NotNull HeightMap heightMap, @Range(from = 0L, to = 15L) int x, @Range(from = 0L, to = 15L) int z);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user