mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
Fixed some issues with chunks being generated on a loop
This commit is contained in:
parent
c175485cd8
commit
8e47c93fbc
@ -2220,8 +2220,8 @@ class Level implements ChunkManager, Metadatable{
|
||||
|
||||
|
||||
public function generateChunk($x, $z){
|
||||
if(!isset($this->chunkGenerationQueue[Level::chunkHash($x, $z)])){
|
||||
$this->chunkGenerationQueue[Level::chunkHash($x, $z)] = true;
|
||||
if(!isset($this->chunkGenerationQueue[$index = Level::chunkHash($x, $z)])){
|
||||
$this->chunkGenerationQueue[$index] = true;
|
||||
$this->server->getGenerationManager()->requestChunk($this, $x, $z);
|
||||
}
|
||||
}
|
||||
|
@ -179,7 +179,7 @@ class GenerationChunkManager implements ChunkManager{
|
||||
|
||||
protected function requestChunk($chunkX, $chunkZ){
|
||||
$chunk = $this->manager->requestChunk($this->levelID, $chunkX, $chunkZ);
|
||||
$this->chunks[$index = Level::chunkHash($chunkX, $chunkZ)] = $chunk;
|
||||
$this->chunks[Level::chunkHash($chunkX, $chunkZ)] = $chunk;
|
||||
|
||||
return $chunk;
|
||||
}
|
||||
|
@ -83,7 +83,8 @@ class GenerationLevelManager extends GenerationManager{
|
||||
if(count($chunks) === 0){
|
||||
unset($this->requestQueue[$levelID]);
|
||||
}else{
|
||||
Level::getXZ($key = key($chunks), $chunkX, $chunkZ);
|
||||
$key = key($chunks);
|
||||
Level::getXZ($key, $chunkX, $chunkZ);
|
||||
unset($this->requestQueue[$levelID][$key]);
|
||||
$this->generateChunk($levelID, $chunkX, $chunkZ);
|
||||
++$count;
|
||||
|
@ -126,7 +126,8 @@ class GenerationManager{
|
||||
if(count($chunks) === 0){
|
||||
unset($this->requestQueue[$levelID]);
|
||||
}else{
|
||||
Level::getXZ($key = key($chunks), $chunkX, $chunkZ);
|
||||
$key = key($chunks);
|
||||
Level::getXZ($key, $chunkX, $chunkZ);
|
||||
unset($this->requestQueue[$levelID][$key]);
|
||||
$this->generateChunk($levelID, $chunkX, $chunkZ);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user