mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
do not send chunk updates on chunk generation
This commit is contained in:
parent
bd73cced6e
commit
4523b15991
@ -186,12 +186,19 @@ class PMFLevel extends PMF{
|
||||
if(!file_exists(dirname($path))){
|
||||
@mkdir(dirname($path), 0755);
|
||||
}
|
||||
$this->isGenerating = true;
|
||||
$this->initCleanChunk($X, $Z);
|
||||
$ret = $this->level->generateChunk($X, $Z);
|
||||
$ret = $ret and $this->level->populateChunk($X, $Z);
|
||||
$this->saveChunk($X, $Z);
|
||||
$this->isGenerating = false;
|
||||
if($this->isGenerating === false){
|
||||
$this->isGenerating = true;
|
||||
$this->initCleanChunk($X, $Z);
|
||||
$ret = $this->level->generateChunk($X, $Z);
|
||||
$ret = $ret and $this->level->populateChunk($X, $Z);
|
||||
$this->saveChunk($X, $Z);
|
||||
$this->isGenerating = false;
|
||||
}else{
|
||||
$this->initCleanChunk($X, $Z);
|
||||
$ret = $this->level->generateChunk($X, $Z);
|
||||
$ret = $ret and $this->level->populateChunk($X, $Z);
|
||||
$this->saveChunk($X, $Z);
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
@ -213,9 +220,13 @@ class PMFLevel extends PMF{
|
||||
}
|
||||
|
||||
if($this->isGenerating === false and !$this->isPopulated($X, $Z)){
|
||||
$this->isGenerating = true;
|
||||
$ret = $this->level->populateChunk($X, $Z);
|
||||
$this->isGenerating = false;
|
||||
if($this->isGenerating === false){
|
||||
$this->isGenerating = true;
|
||||
$this->level->populateChunk($X, $Z);
|
||||
$this->isGenerating = false;
|
||||
}else{
|
||||
$this->level->populateChunk($X, $Z);
|
||||
}
|
||||
}
|
||||
|
||||
$chunk = @gzopen($path, "rb");
|
||||
|
@ -107,7 +107,6 @@ class Level{
|
||||
|
||||
if($this->level->isGenerating === false and count($this->changedCount) > 0){
|
||||
arsort($this->changedCount);
|
||||
$resendChunks = array();
|
||||
foreach($this->changedCount as $index => $count){
|
||||
if($count < 582){//Optimal value, calculated using the relation between minichunks and single packets
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user