mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
Fixed RegionLoader not creating default index on first load
This commit is contained in:
parent
5dc5aba42c
commit
8abe95309c
@ -349,7 +349,7 @@ namespace pocketmine {
|
||||
E_DEPRECATED => "E_DEPRECATED",
|
||||
E_USER_DEPRECATED => "E_USER_DEPRECATED",
|
||||
];
|
||||
$type = ($errno === E_ERROR or $errno === E_WARNING or $errno === E_USER_ERROR or $errno === E_USER_WARNING) ? LogLevel::ERROR : LogLevel::NOTICE;
|
||||
$type = ($errno === E_ERROR or $errno === E_USER_ERROR) ? LogLevel::ERROR : (($errno === E_USER_WARNING or $errno === E_WARNING) ? LogLevel::WARNING : LogLevel::NOTICE);
|
||||
$errno = isset($errorConversion[$errno]) ? $errorConversion[$errno] : $errno;
|
||||
if(($pos = strpos($errstr, "\n")) !== false){
|
||||
$errstr = substr($errstr, 0, $pos);
|
||||
@ -362,6 +362,7 @@ namespace pocketmine {
|
||||
foreach(($trace = getTrace($trace === null ? 3 : 0, $trace)) as $i => $line){
|
||||
$logger->debug($line);
|
||||
}
|
||||
|
||||
$lastError = [
|
||||
"type" => $type,
|
||||
"message" => $errstr,
|
||||
|
@ -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();
|
||||
|
@ -53,11 +53,12 @@ class RegionLoader{
|
||||
$this->z = $regionZ;
|
||||
$this->levelProvider = $level;
|
||||
$this->filePath = $this->levelProvider->getPath() . "region/r.$regionX.$regionZ.mcr";
|
||||
$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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user