mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 15:49:00 +01:00
6fe45a6b09
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 4db9e3dc Add API to locate structures CraftBukkit Changes:65bb2d0f
Increase expiration time to 10 days88a5346f
Add API to locate structures. Spigot Changes: 68acb93f Rebuild patches
30 lines
No EOL
1.3 KiB
Diff
30 lines
No EOL
1.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Aikar <aikar@aikar.co>
|
|
Date: Sat, 21 Jul 2018 16:55:04 -0400
|
|
Subject: [PATCH] Add async chunk load API
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
index 74f09ac45..0c83a070f 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
@@ -0,0 +0,0 @@ public class CraftWorld implements World {
|
|
}
|
|
}
|
|
|
|
+ // Paper start - Async chunk load API
|
|
+ @Override
|
|
+ public java.util.concurrent.CompletableFuture<Chunk> getChunkAtAsync(final int x, final int z, final boolean gen) {
|
|
+ final ChunkProviderServer cps = this.world.getChunkProviderServer();
|
|
+ java.util.concurrent.CompletableFuture<Chunk> future = new java.util.concurrent.CompletableFuture<>();
|
|
+ net.minecraft.server.Chunk chunk = cps.getChunkAt(x, z, true, gen);
|
|
+ // TODO: Add back async variant
|
|
+ future.complete(chunk != null ? chunk.bukkitChunk : null);
|
|
+ return future;
|
|
+ }
|
|
+ // Paper end
|
|
+
|
|
public Chunk getChunkAt(int x, int z) {
|
|
return this.world.getChunkProviderServer().getChunkAt(x, z, true, true).bukkitChunk;
|
|
}
|
|
--
|