CavePVP-Stuff/cSpigot-master/spigot-api-Patches/0006-Add-async-chunk-load-API.patch
2023-05-01 19:59:40 +01:00

30 lines
1010 B
Diff

From 575342be7a5fd0e650ff6846a21a9836d7ab5684 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 6 Nov 2014 18:29:20 -0600
Subject: [PATCH] Add async chunk load API
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index ab731747..c962e7de 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -129,6 +129,15 @@ public interface World extends PluginMessageRecipient, Metadatable {
*/
public Chunk getChunkAt(Block block);
+ // PaperSpigot start - Async chunk load API
+ public static interface ChunkLoadCallback {
+ public void onLoad(Chunk chunk);
+ }
+ public void getChunkAtAsync(int x, int z, ChunkLoadCallback cb);
+ public void getChunkAtAsync(Location location, ChunkLoadCallback cb);
+ public void getChunkAtAsync(Block block, ChunkLoadCallback cb);
+ // PaperSpigot end
+
/**
* Checks if the specified {@link Chunk} is loaded
*
--
2.11.0.windows.3