diff options
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java index 8feadd11..1440349b 100644 --- a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java +++ b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java @@ -28,7 +28,7 @@ class ChunkIOProvider implements AsynchronousExecutor.CallBackProvider<QueuedChu // sync stuff public void callStage2(QueuedChunk queuedChunk, Chunk chunk) throws RuntimeException { - if(chunk == null) { + if (chunk == null) { // If the chunk loading failed just do it synchronously (may generate) queuedChunk.provider.originalGetChunkAt(queuedChunk.x, queuedChunk.z); return; @@ -48,6 +48,21 @@ class ChunkIOProvider implements AsynchronousExecutor.CallBackProvider<QueuedChu server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkLoadEvent(chunk.bukkitChunk, false)); } + // Update neighbor counts + for (int x = -2; x < 3; x++) { + for (int z = -2; z < 3; z++) { + if (x == 0 && z == 0) { + continue; + } + + Chunk neighbor = queuedChunk.provider.getChunkIfLoaded(chunk.locX + x, chunk.locZ + z); + if (neighbor != null) { + neighbor.setNeighborLoaded(-x, -z); + chunk.setNeighborLoaded(x, z); + } + } + } + chunk.a(queuedChunk.provider, queuedChunk.provider, queuedChunk.x, queuedChunk.z); } |