mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-06 01:51:51 +00:00
Faster chunk setting on provider
This commit is contained in:
parent
c81bbdaaa9
commit
71d602a4cf
@ -1756,8 +1756,7 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
$oldChunk = $this->getChunk($x, $z, false);
|
$oldChunk = $this->getChunk($x, $z, false);
|
||||||
unset($this->chunkGenerationQueue[Level::chunkHash($x, $z)]);
|
unset($this->chunkGenerationQueue[Level::chunkHash($x, $z)]);
|
||||||
$this->setChunk($x, $z, $chunk);
|
$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));
|
$this->server->getPluginManager()->callEvent(new ChunkPopulateEvent($chunk));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -251,11 +251,11 @@ class McRegion extends BaseLevelProvider{
|
|||||||
$chunk->setZ($chunkZ);
|
$chunk->setZ($chunkZ);
|
||||||
|
|
||||||
|
|
||||||
if($this->getChunk($chunkX, $chunkZ, false) !== $chunk){
|
if(isset($this->chunks[$index = Level::chunkHash($chunkX, $chunkZ)]) and $this->chunks[$index] !== $chunk){
|
||||||
$this->unloadChunk($chunkX, $chunkZ, false);
|
$this->unloadChunk($chunkX, $chunkZ, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->chunks[Level::chunkHash($chunkX, $chunkZ)] = $chunk;
|
$this->chunks[$index] = $chunk;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function createChunkSection($Y){
|
public static function createChunkSection($Y){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user