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 chr;
|
||||
use function fclose;
|
||||
use function fgetc;
|
||||
use function feof;
|
||||
use function file_exists;
|
||||
use function filesize;
|
||||
use function fopen;
|
||||
@ -301,7 +301,7 @@ class RegionLoader{
|
||||
//TODO: more validity checks
|
||||
|
||||
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");
|
||||
}
|
||||
if(isset($usedOffsets[$offset])){
|
||||
|
Loading…
x
Reference in New Issue
Block a user