diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/adapter/StarlightRelighter.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/adapter/StarlightRelighter.java index 02729cfa95..6ce77e165d 100644 --- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/adapter/StarlightRelighter.java +++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/adapter/StarlightRelighter.java @@ -118,10 +118,14 @@ protected void fixLighting(LongSet chunks, Runnable andThen) { public boolean addChunk(int cx, int cz, byte[] skipReason, int bitmask) { areaLock.lock(); try { - long key = MathMan.pairInt(cx >> CHUNKS_PER_BATCH_SQRT_LOG2, cz >> CHUNKS_PER_BATCH_SQRT_LOG2); - // TODO probably submit here already if chunks.size == CHUNKS_PER_BATCH? - LongSet chunks = this.regions.computeIfAbsent(key, k -> new LongArraySet(CHUNKS_PER_BATCH >> 2)); - chunks.add(asLong(cx, cz)); + // light can go into neighboring chunks, make sure they are relighted too. + for (int x = cx - 1; x <= cx + 1; x++) { + for (int z = cz - 1; z <= cz + 1; z++) { + long key = MathMan.pairInt(x >> CHUNKS_PER_BATCH_SQRT_LOG2, z >> CHUNKS_PER_BATCH_SQRT_LOG2); + LongSet chunks = this.regions.computeIfAbsent(key, k -> new LongArraySet(CHUNKS_PER_BATCH >> 2)); + chunks.add(asLong(x, z)); + } + } } finally { areaLock.unlock(); }