diff --git a/Spigot-Server-Patches/Configurable-async-light-updates.patch b/Spigot-Server-Patches/Configurable-async-light-updates.patch index 60e7520359..88b407dac5 100644 --- a/Spigot-Server-Patches/Configurable-async-light-updates.patch +++ b/Spigot-Server-Patches/Configurable-async-light-updates.patch @@ -37,6 +37,39 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } this.q = true; +@@ -0,0 +0,0 @@ public class Chunk { + + public void b(boolean flag) { + if (this.k && !this.world.worldProvider.o() && !flag) { +- this.h(this.world.isClientSide); ++ this.recheckGaps(this.world.isClientSide); // PaperSpigot - Asynchronous lighting updates + } + + this.p = true; +@@ -0,0 +0,0 @@ public class Chunk { + + } + ++ /** ++ * PaperSpigot - Recheck gaps asynchronously. ++ */ ++ public void recheckGaps(final boolean isClientSide) { ++ if (!world.paperSpigotConfig.useAsyncLighting) { ++ this.h(isClientSide); ++ return; ++ } ++ ++ world.lightingExecutor.submit(new Runnable() { ++ @Override ++ public void run() { ++ Chunk.this.h(isClientSide); ++ } ++ }); ++ } ++ + public boolean isReady() { + // Spigot Start + /* diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -75,7 +108,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public static boolean haveWeSilencedAPhysicsCrash; public static String blockLocation; private int tileTickPosition; -+ private ExecutorService lightingExecutor; // PaperSpigot - Asynchronous lighting updates ++ public ExecutorService lightingExecutor; // PaperSpigot - Asynchronous lighting updates public static long chunkToKey(int x, int z) { @@ -170,6 +203,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + } + ++ if (!Bukkit.isPrimaryThread()) { ++ return this.c(enumskyblock, position, chunk, neighbors); ++ } ++ + lightingExecutor.submit(new Runnable() { + @Override + public void run() { @@ -198,6 +235,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + log( "World async lighting: " + useAsyncLighting ); + } } --- -1.9.5.msysgit.1 - +-- \ No newline at end of file diff --git a/Spigot-Server-Patches/Optimize-explosions.patch b/Spigot-Server-Patches/Optimize-explosions.patch index 1a4edb86b7..906eacd2ef 100644 --- a/Spigot-Server-Patches/Optimize-explosions.patch +++ b/Spigot-Server-Patches/Optimize-explosions.patch @@ -128,7 +128,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { public static String blockLocation; private int tileTickPosition; - private ExecutorService lightingExecutor; // PaperSpigot - Asynchronous lighting updates + public ExecutorService lightingExecutor; // PaperSpigot - Asynchronous lighting updates + public final Map explosionDensityCache = new HashMap(); // PaperSpigot - Optimize explosions public static long chunkToKey(int x, int z)