Java Code Examples for org.bukkit.World#getChunkAtAsync()

The following examples show how to use org.bukkit.World#getChunkAtAsync() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AsyncChunksPaper_9_12.java    From PaperLib with MIT License 5 votes vote down vote up
@Override
public CompletableFuture<Chunk> getChunkAtAsync(World world, int x, int z, boolean gen, boolean isUrgent) {
    CompletableFuture<Chunk> future = new CompletableFuture<>();
    if (!gen && PaperLib.getMinecraftVersion() >= 12 && !world.isChunkGenerated(x, z)) {
        future.complete(null);
    } else {
        World.ChunkLoadCallback chunkLoadCallback = future::complete;
        world.getChunkAtAsync(x, z, chunkLoadCallback);
    }
    return future;
}
 
Example 2
Source File: AsyncChunksPaper_13.java    From PaperLib with MIT License 4 votes vote down vote up
@Override
public CompletableFuture<Chunk> getChunkAtAsync(World world, int x, int z, boolean gen, boolean isUrgent) {
    return world.getChunkAtAsync(x, z, gen);
}
 
Example 3
Source File: AsyncChunksPaper_15.java    From PaperLib with MIT License 4 votes vote down vote up
@Override
public CompletableFuture<Chunk> getChunkAtAsync(World world, int x, int z, boolean gen, boolean isUrgent) {
    return world.getChunkAtAsync(x, z, gen, isUrgent);
}
 
Example 4
Source File: PaperChunkCallback.java    From FastAsyncWorldedit with GNU General Public License v3.0 4 votes vote down vote up
public PaperChunkCallback(World world, int x, int z) {
    world.getChunkAtAsync(x, z, chunk -> PaperChunkCallback.this.onLoad(chunk));
}