Faster chunk setting on provider

This commit is contained in:
Shoghi Cervantes
2014-12-12 15:51:31 +01:00
parent c81bbdaaa9
commit 71d602a4cf
2 changed files with 3 additions and 4 deletions

View File

@ -1756,8 +1756,7 @@ class Level implements ChunkManager, Metadatable{
$oldChunk = $this->getChunk($x, $z, false);
unset($this->chunkGenerationQueue[Level::chunkHash($x, $z)]);
$this->setChunk($x, $z, $chunk);
$chunk = $this->getChunk($x, $z, false);
if($chunk !== null and (!($oldChunk !== null) or $oldChunk->isPopulated() === false) and $chunk->isPopulated()){
if($chunk !== null and ($oldChunk === null or $oldChunk->isPopulated() === false) and $chunk->isPopulated()){
$this->server->getPluginManager()->callEvent(new ChunkPopulateEvent($chunk));
}
}