mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 20:49:43 +00:00
Merge branch 'master' of https://github.com/kotyaralih/NostalgiaCore
This commit is contained in:
commit
c60ccb4f1b
2 changed files with 11 additions and 2 deletions
|
|
@ -21,7 +21,12 @@ class PMF{
|
||||||
|
|
||||||
public function create($file, $type, $version = PMF_CURRENT_VERSION){
|
public function create($file, $type, $version = PMF_CURRENT_VERSION){
|
||||||
$this->file = $file;
|
$this->file = $file;
|
||||||
@mkdir(dirname($this->file), 0755, true);
|
$dirname = dirname($this->file);
|
||||||
|
if(!is_dir($dirname)){
|
||||||
|
@mkdir($dirname, 0755, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(!is_resource($this->fp)){
|
if(!is_resource($this->fp)){
|
||||||
if(($this->fp = @fopen($file, "c+b")) === false){
|
if(($this->fp = @fopen($file, "c+b")) === false){
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,11 @@ class PMFLevel extends PMF{
|
||||||
$this->saveData(false);
|
$this->saveData(false);
|
||||||
$this->locationTable = [];
|
$this->locationTable = [];
|
||||||
$cnt = pow($this->levelData["width"], 2);
|
$cnt = pow($this->levelData["width"], 2);
|
||||||
@mkdir(dirname($this->file) . "/chunks/", 0755);
|
$dirname = dirname($this->file) . "/chunks/";
|
||||||
|
if(!is_dir($dirname)){
|
||||||
|
@mkdir($dirname , 0755);
|
||||||
|
}
|
||||||
|
|
||||||
for($index = 0; $index < $cnt; ++$index){
|
for($index = 0; $index < $cnt; ++$index){
|
||||||
$this->chunks[$index] = false;
|
$this->chunks[$index] = false;
|
||||||
$this->chunkChange[$index] = false;
|
$this->chunkChange[$index] = false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue