Added PMFLevel upgrade

This commit is contained in:
Shoghi Cervantes
2014-02-13 00:37:23 +01:00
parent f7b8ad0e37
commit b7ed2f765c
4 changed files with 72 additions and 10 deletions

View File

@ -149,10 +149,11 @@ class Level{
}
public function generateChunk($X, $Z){
$this->level->initCleanChunk($X, $Z);
$this->generator->generateChunk($X, $Z);
}
public function populateChunk($X, $Z){
$this->generator->populateChunk($X, $Z);
$this->level->saveChunk($X, $Z);
}
public function __destruct(){

View File

@ -116,6 +116,8 @@ class NormalGenerator implements LevelGenerator{
$this->random->setSeed(0xdeadbeef ^ ($chunkX << 8) ^ $chunkZ ^ $this->level->getSeed());
$populator->populate($this->level, $chunkX, $chunkZ, $this->random);
}
$this->level->level->setPopulated($chunkX, $chunkZ);
}
public function populateLevel(){

View File

@ -134,6 +134,7 @@ class SuperflatGenerator implements LevelGenerator{
$this->random->setSeed(0xdeadbeef ^ ($chunkX << 8) ^ $chunkZ ^ $this->level->getSeed());
$populator->populate($this->level, $chunkX, $chunkZ, $this->random);
}
$this->level->level->setPopulated($chunkX, $chunkZ);
}
public function populateLevel(){