Merge branch 'stable'

This commit is contained in:
Dylan K. Taylor
2021-02-02 13:46:29 +00:00
8 changed files with 52 additions and 25 deletions

View File

@ -32,6 +32,7 @@ use pocketmine\world\format\io\exception\CorruptedChunkException;
use function assert;
use function ceil;
use function chr;
use function clearstatcache;
use function fclose;
use function feof;
use function file_exists;
@ -91,6 +92,7 @@ class RegionLoader{
* @throws CorruptedRegionException
*/
public function open() : void{
clearstatcache(false, $this->filePath);
$exists = file_exists($this->filePath);
if(!$exists){
touch($this->filePath);
@ -370,6 +372,7 @@ class RegionLoader{
fwrite($this->filePointer, Binary::writeInt($entry !== null ? ($entry->getFirstSector() << 8) | $entry->getSectorCount() : 0), 4);
fseek($this->filePointer, 4096 + ($index << 2));
fwrite($this->filePointer, Binary::writeInt($entry !== null ? $entry->getTimestamp() : 0), 4);
clearstatcache(false, $this->filePath);
}
protected function createBlank() : void{