Fix NPE in recheckGaps when using async lighting

This commit is contained in:
Byteflux 2015-08-06 21:44:03 -07:00
parent f2f04fbb77
commit d4bd87a7ec
2 changed files with 2 additions and 6 deletions

View File

@ -108,7 +108,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public static boolean haveWeSilencedAPhysicsCrash;
public static String blockLocation;
private int tileTickPosition;
+ public ExecutorService lightingExecutor; // PaperSpigot - Asynchronous lighting updates
+ public ExecutorService lightingExecutor = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat("PaperSpigot - Lighting Thread").build()); // PaperSpigot - Asynchronous lighting updates
public static long chunkToKey(int x, int z)
{
@ -182,10 +182,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return this.c(enumskyblock, position, chunk, null);
+ }
+
+ if (lightingExecutor == null) {
+ lightingExecutor = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat("PaperSpigot - Lighting Thread").build());
+ }
+
+ chunk.pendingLightUpdates.incrementAndGet();
+ chunk.lightUpdateTime = chunk.world.getTime();
+

View File

@ -128,7 +128,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
public static String blockLocation;
private int tileTickPosition;
public ExecutorService lightingExecutor; // PaperSpigot - Asynchronous lighting updates
public ExecutorService lightingExecutor = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat("PaperSpigot - Lighting Thread").build()); // PaperSpigot - Asynchronous lighting updates
+ public final Map<Explosion.CacheKey, Float> explosionDensityCache = new HashMap<Explosion.CacheKey, Float>(); // PaperSpigot - Optimize explosions
public static long chunkToKey(int x, int z)