Search in sources :

Example 1 with ChunkColumn

use of com.github.hhhzzzsss.hbot.block.ChunkColumn in project HBot-Release by hhhzzzsss.

the class CommandCore method checkCore.

private boolean checkCore(ChunkPos pos) {
    ChunkColumn chunkColumn = world.getChunk(pos);
    if (chunkColumn == null)
        return false;
    ChunkSection section = chunkColumn.getChunks()[0];
    if (section == null)
        return false;
    BitStorage storage = section.getChunkData().getStorage();
    Palette palette = section.getChunkData().getPalette();
    for (int i = 0; i < 256 * targetCoreHeight; i++) {
        if (!isCommandBlock(palette.idToState(storage.get(i)))) {
            return false;
        }
    }
    return true;
}
Also used : Palette(com.github.steveice10.mc.protocol.data.game.chunk.palette.Palette) ChunkColumn(com.github.hhhzzzsss.hbot.block.ChunkColumn) ChunkSection(com.github.steveice10.mc.protocol.data.game.chunk.ChunkSection) BitStorage(com.github.steveice10.mc.protocol.data.game.chunk.BitStorage)

Aggregations

ChunkColumn (com.github.hhhzzzsss.hbot.block.ChunkColumn)1 BitStorage (com.github.steveice10.mc.protocol.data.game.chunk.BitStorage)1 ChunkSection (com.github.steveice10.mc.protocol.data.game.chunk.ChunkSection)1 Palette (com.github.steveice10.mc.protocol.data.game.chunk.palette.Palette)1