Search in sources :

Example 1 with ChunkTask

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

the class ChunkProcessingPipeline method processChunkInfo.

private void processChunkInfo(ChunkProcessingInfo info) {
    if (info.getChunkTask() == null) {
        return;
    }
    if (info.getCurrentFuture() != null) {
        return;
    }
    ChunkTask chunkTask = info.getChunkTask();
    List<Vector3ic> requirements = chunkTask.getRequirements();
    List<Chunk> requiredChunks = Lists.newArrayListWithCapacity(requirements.size());
    for (Vector3ic pos : requirements) {
        Chunk chunk = getChunkBy(info.getChunkTaskProvider(), pos);
        if (chunk != null) {
            requiredChunks.add(chunk);
        } else {
            return;
        }
    }
    info.setCurrentFuture(runTask(chunkTask, requiredChunks));
}
Also used : Vector3ic(org.joml.Vector3ic) Chunk(org.terasology.engine.world.chunks.Chunk) ChunkTask(org.terasology.engine.world.chunks.pipeline.stages.ChunkTask)

Aggregations

Vector3ic (org.joml.Vector3ic)1 Chunk (org.terasology.engine.world.chunks.Chunk)1 ChunkTask (org.terasology.engine.world.chunks.pipeline.stages.ChunkTask)1