All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.papermc.lib.features.asyncchunks.AsyncChunksSync Maven / Gradle / Ivy

package io.papermc.lib.features.asyncchunks;

import io.papermc.lib.PaperLib;
import org.bukkit.Chunk;
import org.bukkit.World;

import java.util.concurrent.CompletableFuture;

public class AsyncChunksSync implements AsyncChunks {

    @Override
    public CompletableFuture getChunkAtAsync(World world, int x, int z, boolean gen, boolean isUrgent) {
        if (!gen && !PaperLib.isChunkGenerated(world, x, z)) {
            return CompletableFuture.completedFuture(null);
        } else {
            return CompletableFuture.completedFuture(world.getChunkAt(x, z));
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy