Fixed RegionLoader not creating default index on first load

This commit is contained in:
Shoghi Cervantes
2014-10-15 16:59:31 +02:00
parent 5dc5aba42c
commit 8abe95309c
3 changed files with 6 additions and 3 deletions

View File

@ -43,11 +43,12 @@ class RegionLoader extends \pocketmine\level\format\mcregion\RegionLoader{
$this->z = $regionZ;
$this->levelProvider = $level;
$this->filePath = $this->levelProvider->getPath() . "region/r.$regionX.$regionZ.mca";
$exists = file_exists($this->filePath);
touch($this->filePath);
$this->filePointer = fopen($this->filePath, "r+b");
stream_set_read_buffer($this->filePointer, 1024 * 16); //16KB
stream_set_write_buffer($this->filePointer, 1024 * 16); //16KB
if(!file_exists($this->filePath)){
if(!$exists){
$this->createBlank();
}else{
$this->loadLocationTable();