mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 05:47:45 +01:00
Lookup neighbor chunks more efficiently in async lighting
This commit is contained in:
parent
c17ecdd93f
commit
963925b8ea
@ -159,9 +159,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ final List<Chunk> neighbors = new ArrayList<Chunk>();
|
||||
+ for (int cx = (x >> 4) - 1; cx <= (x >> 4) + 1; ++cx) {
|
||||
+ for (int cz = (z >> 4) - 1; cz <= (z >> 4) + 1; ++cz) {
|
||||
+ if (this.chunkProvider.isChunkLoaded(cx, cz)) {
|
||||
+ Chunk neighbor = this.getChunkAt(cx, cz);
|
||||
+ if (neighbor != chunk) {
|
||||
+ if (cx != x >> 4 && cz != z >> 4) {
|
||||
+ Chunk neighbor = this.getChunkIfLoaded(cx, cz);
|
||||
+ if (neighbor != null) {
|
||||
+ neighbor.pendingLightUpdates.incrementAndGet();
|
||||
+ neighbor.lightUpdateTime = chunk.world.getTime();
|
||||
+ neighbors.add(neighbor);
|
||||
|
Loading…
Reference in New Issue
Block a user