Improve chunk loaded checks

This commit is contained in:
Spottedleaf
2019-06-10 17:29:30 -07:00
parent 0616199cad
commit 522cb2b4d1
19 changed files with 94 additions and 55 deletions

View File

@@ -9,7 +9,7 @@ waiting for the execution queue to get to our request; We can just query
the chunk status and get a response now, vs having to wait
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 0328eadf27..7b17a634c2 100644
index 0328eadf27..4e1fd76bbd 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 {
@@ -18,7 +18,7 @@ index 0328eadf27..7b17a634c2 100644
public boolean isChunkLoaded(int x, int z) {
- net.minecraft.server.Chunk chunk = world.getChunkProvider().getChunkAt(x, z, false);
- return chunk != null;
+ return world.getChunkProvider().isLoaded(x, z);// Paper
+ return world.getChunkProvider().getChunkAtIfLoadedImmediately(x, z) != null; // Paper
}
@Override