Search in sources :

Example 11 with Chunk

use of org.asassecreations.voxelgame.world.chunk.Chunk in project Voxel_Game by ASasseCreations.

the class ChunkSaveQueue method contains.

private static final boolean contains(final Chunk chunk) {
    if (chunk == null)
        return false;
    for (int i = 0; i < LIST.size(); i++) {
        final ChunkSaveQueue queue = LIST.get(i);
        if (queue == null)
            continue;
        final Chunk temp = queue.chunk;
        if (temp == null)
            continue;
        if (temp.x == chunk.x && temp.z == chunk.z)
            return true;
    }
    return false;
}
Also used : Chunk(org.asassecreations.voxelgame.world.chunk.Chunk)

Example 12 with Chunk

use of org.asassecreations.voxelgame.world.chunk.Chunk in project Voxel_Game by ASasseCreations.

the class ChunkSaveQueue method queue.

public static final void queue() {
    for (int i = 0; i < LIST.size(); i++) {
        final ChunkSaveQueue queue = LIST.get(i);
        if (queue == null)
            continue;
        final Chunk chunk = queue.chunk;
        if (chunk == null)
            continue;
        if (chunk.operation == null)
            chunk.operation = ChunkOperation.SAVING;
        if (chunk.save())
            LIST.remove(queue);
    }
}
Also used : Chunk(org.asassecreations.voxelgame.world.chunk.Chunk)

Aggregations

Chunk (org.asassecreations.voxelgame.world.chunk.Chunk)12 Vec3 (org.asassecreations.engine.math.vector.Vec3)2 Color (org.asassecreations.engine.render.Color)1 TextureProperties (org.asassecreations.engine.texture.TextureProperties)1 BlockModeled (org.asassecreations.voxelgame.world.block.BlockModeled)1 ChunkSaveQueue (org.asassecreations.voxelgame.world.chunk.queue.ChunkSaveQueue)1