Search in sources :

Example 1 with Heightmap

use of net.minecraft.world.level.levelgen.Heightmap in project Denizen-For-Bukkit by DenizenScript.

the class ChunkHelperImpl method getHeightMap.

@Override
public int[] getHeightMap(Chunk chunk) {
    Heightmap map = ((CraftChunk) chunk).getHandle().heightmaps.get(Heightmap.Types.MOTION_BLOCKING);
    int[] outputMap = new int[256];
    for (int x = 0; x < 16; x++) {
        for (int y = 0; y < 16; y++) {
            outputMap[x * 16 + y] = map.getFirstAvailable(x, y);
        }
    }
    return outputMap;
}
Also used : Heightmap(net.minecraft.world.level.levelgen.Heightmap) CraftChunk(org.bukkit.craftbukkit.v1_18_R1.CraftChunk)

Example 2 with Heightmap

use of net.minecraft.world.level.levelgen.Heightmap in project Denizen-For-Bukkit by DenizenScript.

the class ChunkHelperImpl method getHeightMap.

@Override
public int[] getHeightMap(Chunk chunk) {
    Heightmap map = ((CraftChunk) chunk).getHandle().heightmaps.get(Heightmap.Types.MOTION_BLOCKING);
    int[] outputMap = new int[256];
    for (int x = 0; x < 16; x++) {
        for (int y = 0; y < 16; y++) {
            outputMap[x * 16 + y] = map.getFirstAvailable(x, y);
        }
    }
    return outputMap;
}
Also used : Heightmap(net.minecraft.world.level.levelgen.Heightmap) CraftChunk(org.bukkit.craftbukkit.v1_17_R1.CraftChunk)

Aggregations

Heightmap (net.minecraft.world.level.levelgen.Heightmap)2 CraftChunk (org.bukkit.craftbukkit.v1_17_R1.CraftChunk)1 CraftChunk (org.bukkit.craftbukkit.v1_18_R1.CraftChunk)1