LevelDB
extends BaseWorldProvider
in package
implements
WritableWorldProvider
Interfaces, Classes, Traits and Enums
Table of Contents
- CURRENT_LEVEL_CHUNK_VERSION = 7
- CURRENT_LEVEL_SUBCHUNK_VERSION = 8
- ENTRY_FLAT_WORLD_LAYERS = "game_flatworldlayers"
- FINALISATION_DONE = 2
- FINALISATION_NEEDS_INSTATICKING = 0
- FINALISATION_NEEDS_POPULATION = 1
- TAG_BIOME_STATE = "5"
- TAG_BLOCK_ENTITY = "1"
- TAG_BLOCK_EXTRA_DATA = "4"
- TAG_BORDER_BLOCKS = "8"
- TAG_DATA_2D = "-"
- TAG_DATA_2D_LEGACY = "."
- TAG_ENTITY = "2"
- TAG_HARDCODED_SPAWNERS = "9"
- TAG_LEGACY_TERRAIN = "0"
- TAG_PENDING_TICK = "3"
- TAG_STATE_FINALISATION = "6"
- TAG_SUBCHUNK_PREFIX = "/"
- TAG_VERSION = "v"
- $db : LevelDB
- $path : string
- $worldData : WorldData
- __construct() : mixed
- calculateChunkCount() : int
- chunkIndex() : string
- close() : void
- doGarbageCollection() : void
- generate() : void
- getAllChunks() : Generator
- getDatabase() : LevelDB
- getPath() : string
- getWorldData() : WorldData
- Returns information about the world
- getWorldMaxY() : int
- getWorldMinY() : int
- isValid() : bool
- loadChunk() : ChunkData|null
- saveChunk() : void
- Saves a chunk (usually to disk).
- deserializeExtraDataKey() : void
- deserializeLegacyExtraData() : array<string|int, PalettedBlockArray>
- deserializePaletted() : PalettedBlockArray
- loadLevelData() : WorldData
- checkForLevelDBExtension() : void
- createDB() : LevelDB
- writeTags() : void
Constants
CURRENT_LEVEL_CHUNK_VERSION
protected
mixed
CURRENT_LEVEL_CHUNK_VERSION
= 7
CURRENT_LEVEL_SUBCHUNK_VERSION
protected
mixed
CURRENT_LEVEL_SUBCHUNK_VERSION
= 8
ENTRY_FLAT_WORLD_LAYERS
protected
mixed
ENTRY_FLAT_WORLD_LAYERS
= "game_flatworldlayers"
FINALISATION_DONE
protected
mixed
FINALISATION_DONE
= 2
FINALISATION_NEEDS_INSTATICKING
protected
mixed
FINALISATION_NEEDS_INSTATICKING
= 0
FINALISATION_NEEDS_POPULATION
protected
mixed
FINALISATION_NEEDS_POPULATION
= 1
TAG_BIOME_STATE
protected
mixed
TAG_BIOME_STATE
= "5"
TAG_BLOCK_ENTITY
protected
mixed
TAG_BLOCK_ENTITY
= "1"
TAG_BLOCK_EXTRA_DATA
protected
mixed
TAG_BLOCK_EXTRA_DATA
= "4"
TAG_BORDER_BLOCKS
protected
mixed
TAG_BORDER_BLOCKS
= "8"
TAG_DATA_2D
protected
mixed
TAG_DATA_2D
= "-"
TAG_DATA_2D_LEGACY
protected
mixed
TAG_DATA_2D_LEGACY
= "."
TAG_ENTITY
protected
mixed
TAG_ENTITY
= "2"
TAG_HARDCODED_SPAWNERS
protected
mixed
TAG_HARDCODED_SPAWNERS
= "9"
TAG_LEGACY_TERRAIN
protected
mixed
TAG_LEGACY_TERRAIN
= "0"
TAG_PENDING_TICK
protected
mixed
TAG_PENDING_TICK
= "3"
TAG_STATE_FINALISATION
protected
mixed
TAG_STATE_FINALISATION
= "6"
TAG_SUBCHUNK_PREFIX
protected
mixed
TAG_SUBCHUNK_PREFIX
= "/"
TAG_VERSION
protected
mixed
TAG_VERSION
= "v"
Properties
$db
protected
LevelDB
$db
$path
protected
string
$path
$worldData
protected
WorldData
$worldData
Methods
__construct()
public
__construct(string $path) : mixed
Parameters
- $path : string
Return values
mixed —calculateChunkCount()
public
calculateChunkCount() : int
Return values
int —chunkIndex()
public
static chunkIndex(int $chunkX, int $chunkZ) : string
Parameters
- $chunkX : int
- $chunkZ : int
Return values
string —close()
public
close() : void
Return values
void —doGarbageCollection()
public
doGarbageCollection() : void
Return values
void —generate()
public
static generate(string $path, string $name, WorldCreationOptions $options) : void
Parameters
- $path : string
- $name : string
- $options : WorldCreationOptions
Return values
void —getAllChunks()
public
getAllChunks([bool $skipCorrupted = false ][, Logger|null $logger = null ]) : Generator
Parameters
- $skipCorrupted : bool = false
- $logger : Logger|null = null
Return values
Generator —getDatabase()
public
getDatabase() : LevelDB
Return values
LevelDB —getPath()
public
getPath() : string
Return values
string —getWorldData()
Returns information about the world
public
getWorldData() : WorldData
Return values
WorldData —getWorldMaxY()
public
getWorldMaxY() : int
Return values
int —getWorldMinY()
public
getWorldMinY() : int
Return values
int —isValid()
public
static isValid(string $path) : bool
Parameters
- $path : string
Return values
bool —loadChunk()
public
loadChunk(int $chunkX, int $chunkZ) : ChunkData|null
Parameters
- $chunkX : int
- $chunkZ : int
Tags
Return values
ChunkData|null —saveChunk()
Saves a chunk (usually to disk).
public
saveChunk(int $chunkX, int $chunkZ, ChunkData $chunkData) : void
Parameters
- $chunkX : int
- $chunkZ : int
- $chunkData : ChunkData
Return values
void —deserializeExtraDataKey()
protected
static deserializeExtraDataKey(int $chunkVersion, int $key, int|null &$x, int|null &$y, int|null &$z) : void
Parameters
- $chunkVersion : int
- $key : int
- $x : int|null
- $y : int|null
- $z : int|null
Return values
void —deserializeLegacyExtraData()
protected
deserializeLegacyExtraData(string $index, int $chunkVersion) : array<string|int, PalettedBlockArray>
Parameters
- $index : string
- $chunkVersion : int
Return values
array<string|int, PalettedBlockArray> —deserializePaletted()
protected
deserializePaletted(BinaryStream $stream) : PalettedBlockArray
Parameters
- $stream : BinaryStream
Return values
PalettedBlockArray —loadLevelData()
protected
loadLevelData() : WorldData
Return values
WorldData —checkForLevelDBExtension()
private
static checkForLevelDBExtension() : void
Return values
void —createDB()
private
static createDB(string $path) : LevelDB
Parameters
- $path : string
Tags
Return values
LevelDB —writeTags()
private
writeTags(array<string|int, CompoundTag> $targets, string $index, LevelDBWriteBatch $write) : void
Parameters
- $targets : array<string|int, CompoundTag>
- $index : string
- $write : LevelDBWriteBatch