From ecc9932f5e379167288446b9793fac390f711f39 Mon Sep 17 00:00:00 2001 From: Marc Baloup Date: Sat, 20 Jan 2024 19:50:49 +0100 Subject: [PATCH] New methods in ChunkCoord --- .../fr/pandacube/lib/paper/world/ChunkCoord.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pandalib-paper/src/main/java/fr/pandacube/lib/paper/world/ChunkCoord.java b/pandalib-paper/src/main/java/fr/pandacube/lib/paper/world/ChunkCoord.java index f53c933..d82006b 100644 --- a/pandalib-paper/src/main/java/fr/pandacube/lib/paper/world/ChunkCoord.java +++ b/pandalib-paper/src/main/java/fr/pandacube/lib/paper/world/ChunkCoord.java @@ -3,6 +3,8 @@ package fr.pandacube.lib.paper.world; import org.bukkit.Chunk; import org.bukkit.World; +import java.util.concurrent.CompletableFuture; + public record ChunkCoord(int x, int z) { public ChunkCoord(Chunk c) { @@ -21,4 +23,16 @@ public record ChunkCoord(int x, int z) { public Chunk getChunk(World w) { return w.getChunkAt(x, z); } + + public Chunk getChunk(World w, boolean generate) { + return w.getChunkAt(x, z, generate); + } + + public CompletableFuture getChunkAsync(World w) { + return w.getChunkAtAsync(x, z); + } + + public CompletableFuture getChunkAsync(World w, boolean generate) { + return w.getChunkAtAsync(x, z, generate); + } }