mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-12 08:49:42 +00:00
RegionLoader: Fixed performance issue converting huge worlds
I was big nub when i wrote this code.
This commit is contained in:
parent
1e0f1e5b1a
commit
62185d476b
@ -29,7 +29,7 @@ use pocketmine\utils\Binary;
|
|||||||
use function ceil;
|
use function ceil;
|
||||||
use function chr;
|
use function chr;
|
||||||
use function fclose;
|
use function fclose;
|
||||||
use function fgetc;
|
use function feof;
|
||||||
use function file_exists;
|
use function file_exists;
|
||||||
use function filesize;
|
use function filesize;
|
||||||
use function fopen;
|
use function fopen;
|
||||||
@ -301,7 +301,7 @@ class RegionLoader{
|
|||||||
//TODO: more validity checks
|
//TODO: more validity checks
|
||||||
|
|
||||||
fseek($this->filePointer, $fileOffset);
|
fseek($this->filePointer, $fileOffset);
|
||||||
if(fgetc($this->filePointer) === false){ //Try and read from the location
|
if(feof($this->filePointer)){
|
||||||
throw new CorruptedRegionException("Region file location offset x=$x,z=$z points to invalid file location $fileOffset");
|
throw new CorruptedRegionException("Region file location offset x=$x,z=$z points to invalid file location $fileOffset");
|
||||||
}
|
}
|
||||||
if(isset($usedOffsets[$offset])){
|
if(isset($usedOffsets[$offset])){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user