Java Code Examples for cn.nukkit.level.format.FullChunk#getHighestBlockAt()

The following examples show how to use cn.nukkit.level.format.FullChunk#getHighestBlockAt() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WaterIcePopulator.java    From Nukkit with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void populate(ChunkManager level, int chunkX, int chunkZ, NukkitRandom random, FullChunk chunk) {
    for (int x = 0; x < 16; x++) {
        for (int z = 0; z < 16; z++) {
            Biome biome = EnumBiome.getBiome(chunk.getBiomeId(x, z));
            if (biome.isFreezing()) {
                int topBlock = chunk.getHighestBlockAt(x, z);
                if (chunk.getBlockId(x, topBlock, z) == STILL_WATER)     {
                    chunk.setBlockId(x, topBlock, z, ICE);
                }
            }
        }
    }
}
 
Example 2
Source File: Populator.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
protected int getHighestWorkableBlock(ChunkManager level, int x, int z, FullChunk chunk)    {
    return chunk.getHighestBlockAt(x & 0xF, z & 0xF);
}
 
Example 3
Source File: IcePlainsSpikesBiome.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
public int getHighestWorkableBlock(int x, int z, FullChunk chunk) {
    return chunk.getHighestBlockAt(x & 0xF, z & 0xF) - 5;
}