PocketMine-MP 5.15.1 git-5ef247620a7c6301a849b54e5ef1009217729fc8
pocketmine\world\format\io\leveldb\LevelDB Class Reference
+ Inheritance diagram for pocketmine\world\format\io\leveldb\LevelDB:
+ Collaboration diagram for pocketmine\world\format\io\leveldb\LevelDB:

Public Member Functions

 __construct (string $path, \Logger $logger)
 
 calculateChunkCount ()
 
 close ()
 
 doGarbageCollection ()
 
 getAllChunks (bool $skipCorrupted=false, ?\Logger $logger=null)
 
 getDatabase ()
 
 getPath ()
 
 getWorldData ()
 
 getWorldMaxY ()
 
 getWorldMinY ()
 
 loadChunk (int $chunkX, int $chunkZ)
 
 saveChunk (int $chunkX, int $chunkZ, ChunkData $chunkData, int $dirtyFlags)
 

Static Public Member Functions

static chunkIndex (int $chunkX, int $chunkZ)
 
static generate (string $path, string $name, WorldCreationOptions $options)
 
static isValid (string $path)
 

Protected Member Functions

 deserializeBlockPalette (BinaryStream $stream, \Logger $logger)
 
 deserializeLegacyExtraData (string $index, int $chunkVersion, \Logger $logger)
 
 loadLevelData ()
 
 palettizeLegacySubChunkFromColumn (string $idArray, string $metaArray, int $yOffset, \Logger $logger)
 
 palettizeLegacySubChunkXZY (string $idArray, string $metaArray, \Logger $logger)
 
 palettizeLegacySubChunkYZX (string $idArray, string $metaArray, \Logger $logger)
 

Static Protected Member Functions

static deserializeExtraDataKey (int $chunkVersion, int $key, ?int &$x, ?int &$y, ?int &$z)
 

Protected Attributes

BlockDataUpgrader $blockDataUpgrader
 
BlockStateDeserializer $blockStateDeserializer
 
BlockStateSerializer $blockStateSerializer
 
LevelDB $db
 
WorldData $worldData
 
const CURRENT_LEVEL_CHUNK_VERSION = ChunkVersion::v1_18_30
 
const CURRENT_LEVEL_SUBCHUNK_VERSION = SubChunkVersion::PALETTED_MULTI
 
const ENTRY_FLAT_WORLD_LAYERS = "game_flatworldlayers"
 
const FINALISATION_DONE = 2
 
const FINALISATION_NEEDS_INSTATICKING = 0
 
const FINALISATION_NEEDS_POPULATION = 1
 

Detailed Description

Definition at line 73 of file LevelDB.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\world\format\io\leveldb\LevelDB::__construct ( string  $path,
\Logger  $logger 
)

Definition at line 108 of file LevelDB.php.

Member Function Documentation

◆ calculateChunkCount()

pocketmine\world\format\io\leveldb\LevelDB::calculateChunkCount ( )

Returns the number of chunks in the provider. Used for world conversion time estimations.

Implements pocketmine\world\format\io\WorldProvider.

Definition at line 849 of file LevelDB.php.

◆ chunkIndex()

static pocketmine\world\format\io\leveldb\LevelDB::chunkIndex ( int  $chunkX,
int  $chunkZ 
)
static

Definition at line 816 of file LevelDB.php.

◆ close()

pocketmine\world\format\io\leveldb\LevelDB::close ( )

Performs cleanups necessary when the world provider is closed and no longer needed.

Implements pocketmine\world\format\io\WorldProvider.

Definition at line 824 of file LevelDB.php.

◆ deserializeBlockPalette()

pocketmine\world\format\io\leveldb\LevelDB::deserializeBlockPalette ( BinaryStream  $stream,
\Logger  $logger 
)
protected
Exceptions
CorruptedChunkException

Definition at line 150 of file LevelDB.php.

References pocketmine\utils\BinaryStream\get().

+ Here is the call graph for this function:

◆ deserializeExtraDataKey()

static pocketmine\world\format\io\leveldb\LevelDB::deserializeExtraDataKey ( int  $chunkVersion,
int  $key,
?int &  $x,
?int &  $y,
?int &  $z 
)
staticprotected

@phpstan-param-out int $x @phpstan-param-out int $y @phpstan-param-out int $z

Definition at line 351 of file LevelDB.php.

◆ deserializeLegacyExtraData()

pocketmine\world\format\io\leveldb\LevelDB::deserializeLegacyExtraData ( string  $index,
int  $chunkVersion,
\Logger  $logger 
)
protected
Returns
PalettedBlockArray[]

Definition at line 366 of file LevelDB.php.

◆ doGarbageCollection()

pocketmine\world\format\io\leveldb\LevelDB::doGarbageCollection ( )

Performs garbage collection in the world provider, such as cleaning up regions in Region-based worlds.

Implements pocketmine\world\format\io\WorldProvider.

Definition at line 820 of file LevelDB.php.

◆ generate()

static pocketmine\world\format\io\leveldb\LevelDB::generate ( string  $path,
string  $name,
WorldCreationOptions  $options 
)
static

Definition at line 136 of file LevelDB.php.

◆ getAllChunks()

pocketmine\world\format\io\leveldb\LevelDB::getAllChunks ( bool  $skipCorrupted = false,
?\Logger  $logger = null 
)

Returns a generator which yields all the chunks in this world.

Returns
\Generator|LoadedChunkData[] @phpstan-return \Generator<array{int, int}, LoadedChunkData, void, void>
Exceptions
CorruptedChunkException

Implements pocketmine\world\format\io\WorldProvider.

Definition at line 828 of file LevelDB.php.

References Logger\error().

+ Here is the call graph for this function:

◆ getDatabase()

pocketmine\world\format\io\leveldb\LevelDB::getDatabase ( )

Definition at line 812 of file LevelDB.php.

◆ getPath()

pocketmine\world\format\io\BaseWorldProvider::getPath ( )
inherited

Implements pocketmine\world\format\io\WorldProvider.

Definition at line 116 of file BaseWorldProvider.php.

◆ getWorldData()

pocketmine\world\format\io\BaseWorldProvider::getWorldData ( )
inherited

Returns information about the world

Implements pocketmine\world\format\io\WorldProvider.

Definition at line 120 of file BaseWorldProvider.php.

◆ getWorldMaxY()

pocketmine\world\format\io\leveldb\LevelDB::getWorldMaxY ( )

Gets the build height limit of this world

Implements pocketmine\world\format\io\WorldProvider.

Definition at line 128 of file LevelDB.php.

◆ getWorldMinY()

pocketmine\world\format\io\leveldb\LevelDB::getWorldMinY ( )

Returns the lowest buildable Y coordinate of this world

Implements pocketmine\world\format\io\WorldProvider.

Definition at line 124 of file LevelDB.php.

◆ isValid()

static pocketmine\world\format\io\leveldb\LevelDB::isValid ( string  $path)
static

Definition at line 132 of file LevelDB.php.

◆ loadChunk()

pocketmine\world\format\io\leveldb\LevelDB::loadChunk ( int  $chunkX,
int  $chunkZ 
)
Exceptions
CorruptedChunkException

Implements pocketmine\world\format\io\WorldProvider.

Definition at line 641 of file LevelDB.php.

◆ loadLevelData()

pocketmine\world\format\io\leveldb\LevelDB::loadLevelData ( )
protected
Exceptions
CorruptedWorldException
UnsupportedWorldFormatException

Reimplemented from pocketmine\world\format\io\BaseWorldProvider.

Definition at line 120 of file LevelDB.php.

◆ palettizeLegacySubChunkFromColumn()

pocketmine\world\format\io\BaseWorldProvider::palettizeLegacySubChunkFromColumn ( string  $idArray,
string  $metaArray,
int  $yOffset,
\Logger  $logger 
)
protectedinherited

Definition at line 112 of file BaseWorldProvider.php.

◆ palettizeLegacySubChunkXZY()

pocketmine\world\format\io\BaseWorldProvider::palettizeLegacySubChunkXZY ( string  $idArray,
string  $metaArray,
\Logger  $logger 
)
protectedinherited

Definition at line 104 of file BaseWorldProvider.php.

◆ palettizeLegacySubChunkYZX()

pocketmine\world\format\io\BaseWorldProvider::palettizeLegacySubChunkYZX ( string  $idArray,
string  $metaArray,
\Logger  $logger 
)
protectedinherited

Definition at line 108 of file BaseWorldProvider.php.

◆ saveChunk()

pocketmine\world\format\io\leveldb\LevelDB::saveChunk ( int  $chunkX,
int  $chunkZ,
ChunkData  $chunkData,
int  $dirtyFlags 
)

Saves a chunk (usually to disk).

Implements pocketmine\world\format\io\WritableWorldProvider.

Definition at line 749 of file LevelDB.php.

Member Data Documentation

◆ $blockDataUpgrader

BlockDataUpgrader pocketmine\world\format\io\BaseWorldProvider::$blockDataUpgrader
protectedinherited

Definition at line 42 of file BaseWorldProvider.php.

◆ $blockStateDeserializer

BlockStateDeserializer pocketmine\world\format\io\BaseWorldProvider::$blockStateDeserializer
protectedinherited

Definition at line 41 of file BaseWorldProvider.php.

◆ $blockStateSerializer

BlockStateSerializer pocketmine\world\format\io\BaseWorldProvider::$blockStateSerializer
protectedinherited

Definition at line 43 of file BaseWorldProvider.php.

◆ $db

LevelDB pocketmine\world\format\io\leveldb\LevelDB::$db
protected

Definition at line 86 of file LevelDB.php.

◆ $worldData

WorldData pocketmine\world\format\io\BaseWorldProvider::$worldData
protectedinherited

Definition at line 39 of file BaseWorldProvider.php.

◆ CURRENT_LEVEL_CHUNK_VERSION

const pocketmine\world\format\io\leveldb\LevelDB::CURRENT_LEVEL_CHUNK_VERSION = ChunkVersion::v1_18_30
protected

Definition at line 81 of file LevelDB.php.

◆ CURRENT_LEVEL_SUBCHUNK_VERSION

const pocketmine\world\format\io\leveldb\LevelDB::CURRENT_LEVEL_SUBCHUNK_VERSION = SubChunkVersion::PALETTED_MULTI
protected

Definition at line 82 of file LevelDB.php.

◆ ENTRY_FLAT_WORLD_LAYERS

const pocketmine\world\format\io\leveldb\LevelDB::ENTRY_FLAT_WORLD_LAYERS = "game_flatworldlayers"
protected

Definition at line 79 of file LevelDB.php.

◆ FINALISATION_DONE

const pocketmine\world\format\io\leveldb\LevelDB::FINALISATION_DONE = 2
protected

Definition at line 77 of file LevelDB.php.

◆ FINALISATION_NEEDS_INSTATICKING

const pocketmine\world\format\io\leveldb\LevelDB::FINALISATION_NEEDS_INSTATICKING = 0
protected

Definition at line 75 of file LevelDB.php.

◆ FINALISATION_NEEDS_POPULATION

const pocketmine\world\format\io\leveldb\LevelDB::FINALISATION_NEEDS_POPULATION = 1
protected

Definition at line 76 of file LevelDB.php.


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