hollow-cube/lighting-join-patch (#56)

This commit is contained in:
iam 2023-09-04 13:34:13 -04:00 committed by GitHub
parent e2efdbb427
commit 010fe985bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -165,6 +165,7 @@ public class LightingChunk extends DynamicChunk {
@Override
protected LightData createLightData(boolean sendLater) {
synchronized (lightCache) {
BitSet skyMask = new BitSet();
BitSet blockMask = new BitSet();
BitSet emptySkyMask = new BitSet();
@ -224,6 +225,7 @@ public class LightingChunk extends DynamicChunk {
emptySkyMask, emptyBlockMask,
skyLights, blockLights);
}
}
private static final LongSet queuedChunks = new LongOpenHashSet();
private static final List<LightingChunk> sendQueue = new ArrayList<>();
@ -412,10 +414,10 @@ public class LightingChunk extends DynamicChunk {
Chunk c = instance.getChunk(chunkX, chunkZ);
if (c == null) return;
synchronized (instance) {
Set<Point> collected = collectRequiredNearby(instance, new Vec(chunkX, sectionY, chunkZ));
// System.out.println("Calculating " + chunkX + " " + sectionY + " " + chunkZ + " | " + collected.size() + " | " + type);
synchronized (instance) {
relight(instance, collected, type);
}
}