Search in sources :

Example 1 with ChunkTaskProvider

use of org.terasology.engine.world.chunks.pipeline.stages.ChunkTaskProvider in project Terasology by MovingBlocks.

the class ChunkProcessingPipeline method getChunkBy.

private Chunk getChunkBy(ChunkTaskProvider requiredStage, Vector3ic position) {
    Chunk chunk = chunkProvider.apply(position);
    if (chunk == null) {
        ChunkProcessingInfo candidate = chunkProcessingInfoMap.get(position);
        if (candidate == null) {
            return null;
        }
        ChunkTaskProvider candidateCurrentStage = candidate.getChunkTaskProvider();
        if (stages.indexOf(candidateCurrentStage) >= stages.indexOf(requiredStage)) {
            chunk = candidate.getChunk();
        }
    }
    return chunk;
}
Also used : ChunkTaskProvider(org.terasology.engine.world.chunks.pipeline.stages.ChunkTaskProvider) Chunk(org.terasology.engine.world.chunks.Chunk)

Aggregations

Chunk (org.terasology.engine.world.chunks.Chunk)1 ChunkTaskProvider (org.terasology.engine.world.chunks.pipeline.stages.ChunkTaskProvider)1