Class Heightmap
java.lang.Object
net.minestom.server.instance.heightmap.Heightmap
- Direct Known Subclasses:
MotionBlockingHeightmap, WorldSurfaceHeightmap
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract booleancheckBlock(Block block) static long[]encode(short[] heights, int bitsPerEntry) Creates compressed longs array from uncompressed heights array.intgetHeight(int x, int z) static intgetHighestBlockSection(Chunk chunk) long[]getNBT()voidloadFrom(long[] data) voidrefresh(int startY) voidrefresh(int x, int z, int startY) voidabstract Heightmap.Typetype()
-
Constructor Details
-
Heightmap
-
-
Method Details
-
type
-
checkBlock
-
refresh
-
refresh
public void refresh(int startY) -
refresh
public void refresh(int x, int z, int startY) -
getNBT
public long[] getNBT() -
loadFrom
public void loadFrom(long[] data) -
getHeight
public int getHeight(int x, int z) -
getHighestBlockSection
-
encode
public static long[] encode(short[] heights, int bitsPerEntry) Creates compressed longs array from uncompressed heights array.- Parameters:
heights- array of heights. Note that for this method it doesn't matter what size this array will be. But to get correct heights, array must be 256 elements long, and at index `i` must be height of (z=i/16, x=i%16).bitsPerEntry- bits that each entry from height will take in `long` container.- Returns:
- array of encoded heights.
-