From 4de83c79abae8896c69c953345187a8cce59a819 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 2 Dec 2016 00:20:34 -0500 Subject: [PATCH] Optimize World.isLoaded(BlockPosition)Z Reduce method invocations for World.isLoaded(BlockPosition)Z --- ...imize-World.isLoaded-BlockPosition-Z.patch | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Spigot-Server-Patches/0185-Optimize-World.isLoaded-BlockPosition-Z.patch diff --git a/Spigot-Server-Patches/0185-Optimize-World.isLoaded-BlockPosition-Z.patch b/Spigot-Server-Patches/0185-Optimize-World.isLoaded-BlockPosition-Z.patch new file mode 100644 index 0000000000..39b7ce63f0 --- /dev/null +++ b/Spigot-Server-Patches/0185-Optimize-World.isLoaded-BlockPosition-Z.patch @@ -0,0 +1,23 @@ +From 3fd7a8e63220cb6fe7d57df374d54cfc327b4354 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Fri, 2 Dec 2016 00:11:43 -0500 +Subject: [PATCH] Optimize World.isLoaded(BlockPosition)Z + +Reduce method invocations for World.isLoaded(BlockPosition)Z + +diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java +index e7ae4c706..51e05f414 100644 +--- a/src/main/java/net/minecraft/server/World.java ++++ b/src/main/java/net/minecraft/server/World.java +@@ -286,7 +286,7 @@ public abstract class World implements IBlockAccess { + } + + public boolean isLoaded(BlockPosition blockposition) { +- return this.a(blockposition, true); ++ return getChunkIfLoaded(blockposition.getX() >> 4, blockposition.getZ() >> 4) != null; // Paper + } + + public boolean a(BlockPosition blockposition, boolean flag) { +-- +2.11.0 +