From 09582cffc17d576ef3efe6722879e280164c4116 Mon Sep 17 00:00:00 2001 From: themode Date: Sun, 27 Sep 2020 20:48:12 +0200 Subject: [PATCH] Comments for IChunkLoader specifying when to execute the callbacks --- .../java/net/minestom/server/instance/IChunkLoader.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/minestom/server/instance/IChunkLoader.java b/src/main/java/net/minestom/server/instance/IChunkLoader.java index 7e9d9199e..28ccf97ce 100644 --- a/src/main/java/net/minestom/server/instance/IChunkLoader.java +++ b/src/main/java/net/minestom/server/instance/IChunkLoader.java @@ -14,7 +14,8 @@ public interface IChunkLoader { * @param instance the instance where the chunk belong * @param chunkX the chunk X * @param chunkZ the chunk Z - * @param callback the callback executed when the chunk is done loading + * @param callback the callback executed when the chunk is done loading, + * never called if something went wrong * @return true if the chunk loaded successfully, false otherwise */ boolean loadChunk(Instance instance, int chunkX, int chunkZ, ChunkCallback callback); @@ -23,7 +24,8 @@ public interface IChunkLoader { * Save a specific chunk with a callback for when it is done * * @param chunk the chunk to save - * @param callback the callback executed when the chunk is done saving + * @param callback the callback executed when the chunk is done saving, + * should be called even if the saving failed (you can throw an exception) */ void saveChunk(Chunk chunk, Runnable callback);