mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-17 03:08:58 +00:00
Merge branch 'master' into Core-Rewrite
Conflicts: src/pmf/PMFLevel.php
This commit is contained in:
commit
ca308f8159
@ -212,33 +212,37 @@ class PMFLevel extends PMF{
|
|||||||
@mkdir(dirname($path), 0755);
|
@mkdir(dirname($path), 0755);
|
||||||
}
|
}
|
||||||
$this->initCleanChunk($X, $Z);
|
$this->initCleanChunk($X, $Z);
|
||||||
$ret = $this->level->generateChunk($X, $Z);
|
if($this->level instanceof Level){
|
||||||
$this->saveChunk($X, $Z);
|
$ret = $this->level->generateChunk($X, $Z);
|
||||||
$this->populateChunk($X - 1, $Z);
|
$this->saveChunk($X, $Z);
|
||||||
$this->populateChunk($X + 1, $Z);
|
$this->populateChunk($X - 1, $Z);
|
||||||
$this->populateChunk($X, $Z - 1);
|
$this->populateChunk($X + 1, $Z);
|
||||||
$this->populateChunk($X, $Z + 1);
|
$this->populateChunk($X, $Z - 1);
|
||||||
$this->populateChunk($X + 1, $Z + 1);
|
$this->populateChunk($X, $Z + 1);
|
||||||
$this->populateChunk($X + 1, $Z - 1);
|
$this->populateChunk($X + 1, $Z + 1);
|
||||||
$this->populateChunk($X - 1, $Z - 1);
|
$this->populateChunk($X + 1, $Z - 1);
|
||||||
$this->populateChunk($X - 1, $Z + 1);
|
$this->populateChunk($X - 1, $Z - 1);
|
||||||
return $ret;
|
$this->populateChunk($X - 1, $Z + 1);
|
||||||
|
return $ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function populateChunk($X, $Z){
|
public function populateChunk($X, $Z){
|
||||||
if($this->isGenerating === 0 and
|
if($this->level instanceof Level){
|
||||||
$this->isChunkLoaded($X, $Z) and
|
if($this->isGenerating === 0 and
|
||||||
!$this->isPopulated($X, $Z) and
|
$this->isChunkLoaded($X, $Z) and
|
||||||
$this->isGenerated($X - 1, $Z) and
|
!$this->isPopulated($X, $Z) and
|
||||||
$this->isGenerated($X, $Z - 1) and
|
$this->isGenerated($X - 1, $Z) and
|
||||||
$this->isGenerated($X + 1, $Z) and
|
$this->isGenerated($X, $Z - 1) and
|
||||||
$this->isGenerated($X, $Z + 1) and
|
$this->isGenerated($X + 1, $Z) and
|
||||||
$this->isGenerated($X + 1, $Z + 1) and
|
$this->isGenerated($X, $Z + 1) and
|
||||||
$this->isGenerated($X - 1, $Z - 1) and
|
$this->isGenerated($X + 1, $Z + 1) and
|
||||||
$this->isGenerated($X + 1, $Z - 1) and
|
$this->isGenerated($X - 1, $Z - 1) and
|
||||||
$this->isGenerated($X - 1, $Z + 1)){
|
$this->isGenerated($X + 1, $Z - 1) and
|
||||||
$this->level->populateChunk($X, $Z);
|
$this->isGenerated($X - 1, $Z + 1)){
|
||||||
$this->saveChunk($X, $Z);
|
$this->level->populateChunk($X, $Z);
|
||||||
|
$this->saveChunk($X, $Z);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,6 +98,7 @@ class LevelImport{
|
|||||||
foreach($chunk as $Y => $data){
|
foreach($chunk as $Y => $data){
|
||||||
$pmf->setMiniChunk($X, $Z, $Y, $data);
|
$pmf->setMiniChunk($X, $Z, $Y, $data);
|
||||||
}
|
}
|
||||||
|
$pmf->setPopulated($X, $Z);
|
||||||
$pmf->saveChunk($X, $Z);
|
$pmf->saveChunk($X, $Z);
|
||||||
}
|
}
|
||||||
console("[NOTICE] Importing level ".ceil(($Z + 1)/0.16)."%");
|
console("[NOTICE] Importing level ".ceil(($Z + 1)/0.16)."%");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user