mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-21 02:16:33 +00:00
Fixed memory leak issues on chunk generation under 32-bit hosts, fixed issue with generated chunks not having a provider. Closes #2419, fixes #2308, closes #2421
This commit is contained in:
parent
ab72c32769
commit
8d9fbec4ce
@ -1755,6 +1755,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
public function generateChunkCallback($x, $z, FullChunk $chunk){
|
||||
$oldChunk = $this->getChunk($x, $z, false);
|
||||
unset($this->chunkGenerationQueue[Level::chunkHash($x, $z)]);
|
||||
$chunk->setProvider($this->provider);
|
||||
$this->setChunk($x, $z, $chunk);
|
||||
if($chunk !== null and ($oldChunk === null or $oldChunk->isPopulated() === false) and $chunk->isPopulated()){
|
||||
$this->server->getPluginManager()->callEvent(new ChunkPopulateEvent($chunk));
|
||||
|
@ -163,7 +163,7 @@ class GenerationChunkManager implements ChunkManager{
|
||||
try{
|
||||
$chunk = $this->getChunk($chunkX, $chunkZ);
|
||||
$chunk->setGenerated(true);
|
||||
$this->changes["$chunkX:$chunkZ"] = $chunk;
|
||||
$this->changes[Level::chunkHash($chunkX, $chunkZ)] = $chunk;
|
||||
}catch(\Exception $e){
|
||||
}
|
||||
}
|
||||
@ -172,7 +172,7 @@ class GenerationChunkManager implements ChunkManager{
|
||||
try{
|
||||
$chunk = $this->getChunk($chunkX, $chunkZ);
|
||||
$chunk->setPopulated(true);
|
||||
$this->changes["$chunkX:$chunkZ"] = $chunk;
|
||||
$this->changes[Level::chunkHash($chunkX, $chunkZ)] = $chunk;
|
||||
}catch(\Exception $e){
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user