PocketMine-MP 5.15.1 git-5ef247620a7c6301a849b54e5ef1009217729fc8
pocketmine\world\format\io\region\RegionLoader Class Reference
+ Collaboration diagram for pocketmine\world\format\io\region\RegionLoader:

Public Member Functions

 calculateChunkCount ()
 
 chunkExists (int $x, int $z)
 
 close ()
 
 generateSectorMap (string $usedChar, string $freeChar)
 
 getFilePath ()
 
 getProportionUnusedSpace ()
 
 readChunk (int $x, int $z)
 
 removeChunk (int $x, int $z)
 
 writeChunk (int $x, int $z, string $chunkData)
 

Static Public Member Functions

static createNew (string $filePath)
 
static loadExisting (string $filePath)
 

Public Attributes

int $lastUsed
 
const COMPRESSION_GZIP = 1
 
const COMPRESSION_ZLIB = 2
 
const FIRST_SECTOR = 2
 

Protected Member Functions

 createBlank ()
 
 isChunkGenerated (int $index)
 
 loadLocationTable ()
 
 writeLocationIndex (int $index)
 

Static Protected Member Functions

static getChunkCoords (int $offset, ?int &$x, ?int &$z)
 
static getChunkOffset (int $x, int $z)
 

Protected Attributes

 $filePointer
 
RegionGarbageMap $garbageTable
 
array $locationTable = []
 
int $nextSector = self::FIRST_SECTOR
 

Detailed Description

Definition at line 58 of file RegionLoader.php.

Constructor & Destructor Documentation

◆ __destruct()

pocketmine\world\format\io\region\RegionLoader::__destruct ( )

Definition at line 120 of file RegionLoader.php.

Member Function Documentation

◆ calculateChunkCount()

pocketmine\world\format\io\region\RegionLoader::calculateChunkCount ( )

Definition at line 435 of file RegionLoader.php.

◆ chunkExists()

pocketmine\world\format\io\region\RegionLoader::chunkExists ( int  $x,
int  $z 
)
Exceptions

InvalidArgumentException

Definition at line 178 of file RegionLoader.php.

◆ close()

pocketmine\world\format\io\region\RegionLoader::close ( )

Closes the file

Definition at line 283 of file RegionLoader.php.

◆ createBlank()

pocketmine\world\format\io\region\RegionLoader::createBlank ( )
protected

Definition at line 383 of file RegionLoader.php.

◆ createNew()

static pocketmine\world\format\io\region\RegionLoader::createNew ( string  $filePath)
static

Definition at line 108 of file RegionLoader.php.

◆ generateSectorMap()

pocketmine\world\format\io\region\RegionLoader::generateSectorMap ( string  $usedChar,
string  $freeChar 
)

Definition at line 395 of file RegionLoader.php.

◆ getChunkCoords()

static pocketmine\world\format\io\region\RegionLoader::getChunkCoords ( int  $offset,
?int &  $x,
?int &  $z 
)
staticprotected
Parameters
int$xreference parameter
int$zreference parameter @phpstan-param-out int $x @phpstan-param-out int $z

Definition at line 275 of file RegionLoader.php.

◆ getChunkOffset()

static pocketmine\world\format\io\region\RegionLoader::getChunkOffset ( int  $x,
int  $z 
)
staticprotected
Exceptions

InvalidArgumentException

Definition at line 262 of file RegionLoader.php.

◆ getFilePath()

pocketmine\world\format\io\region\RegionLoader::getFilePath ( )

Definition at line 431 of file RegionLoader.php.

◆ getProportionUnusedSpace()

pocketmine\world\format\io\region\RegionLoader::getProportionUnusedSpace ( )

Returns a float between 0 and 1 indicating what fraction of the file is currently unused space.

Definition at line 420 of file RegionLoader.php.

◆ isChunkGenerated()

pocketmine\world\format\io\region\RegionLoader::isChunkGenerated ( int  $index)
protected

Definition at line 126 of file RegionLoader.php.

◆ loadExisting()

static pocketmine\world\format\io\region\RegionLoader::loadExisting ( string  $filePath)
static
Exceptions
CorruptedRegionException

Definition at line 94 of file RegionLoader.php.

◆ loadLocationTable()

pocketmine\world\format\io\region\RegionLoader::loadLocationTable ( )
protected
Exceptions
CorruptedRegionException

Definition at line 292 of file RegionLoader.php.

◆ readChunk()

pocketmine\world\format\io\region\RegionLoader::readChunk ( int  $x,
int  $z 
)
Exceptions

InvalidArgumentException if invalid coordinates are given

Exceptions
CorruptedChunkExceptionif chunk corruption is detected

Definition at line 134 of file RegionLoader.php.

◆ removeChunk()

pocketmine\world\format\io\region\RegionLoader::removeChunk ( int  $x,
int  $z 
)
Exceptions

InvalidArgumentException

Definition at line 249 of file RegionLoader.php.

◆ writeChunk()

pocketmine\world\format\io\region\RegionLoader::writeChunk ( int  $x,
int  $z,
string  $chunkData 
)
Exceptions
ChunkException

InvalidArgumentException

Definition at line 203 of file RegionLoader.php.

◆ writeLocationIndex()

pocketmine\world\format\io\region\RegionLoader::writeLocationIndex ( int  $index)
protected

Definition at line 374 of file RegionLoader.php.

Member Data Documentation

◆ $filePointer

pocketmine\world\format\io\region\RegionLoader::$filePointer
protected

Definition at line 68 of file RegionLoader.php.

◆ $garbageTable

RegionGarbageMap pocketmine\world\format\io\region\RegionLoader::$garbageTable
protected

Definition at line 72 of file RegionLoader.php.

◆ $lastUsed

int pocketmine\world\format\io\region\RegionLoader::$lastUsed

Definition at line 73 of file RegionLoader.php.

◆ $locationTable

array pocketmine\world\format\io\region\RegionLoader::$locationTable = []
protected

Definition at line 71 of file RegionLoader.php.

◆ $nextSector

int pocketmine\world\format\io\region\RegionLoader::$nextSector = self::FIRST_SECTOR
protected

Definition at line 69 of file RegionLoader.php.

◆ COMPRESSION_GZIP

const pocketmine\world\format\io\region\RegionLoader::COMPRESSION_GZIP = 1

Definition at line 59 of file RegionLoader.php.

◆ COMPRESSION_ZLIB

const pocketmine\world\format\io\region\RegionLoader::COMPRESSION_ZLIB = 2

Definition at line 60 of file RegionLoader.php.

◆ FIRST_SECTOR

const pocketmine\world\format\io\region\RegionLoader::FIRST_SECTOR = 2

Definition at line 65 of file RegionLoader.php.


The documentation for this class was generated from the following file: