PocketMine
LevelProvider Interface Reference
Inheritance diagram for LevelProvider:
BaseLevelProvider LevelDB McRegion Anvil

Public Member Functions

 __construct (Level $level, $path)
 
 requestChunkTask ($x, $z)
 
 getPath ()
 
 getGenerator ()
 
 getGeneratorOptions ()
 
 getChunk ($X, $Z, $create=false)
 
 saveChunks ()
 
 saveChunk ($X, $Z)
 
 unloadChunks ()
 
 loadChunk ($X, $Z, $create=false)
 
 unloadChunk ($X, $Z, $safe=true)
 
 isChunkGenerated ($X, $Z)
 
 isChunkPopulated ($X, $Z)
 
 isChunkLoaded ($X, $Z)
 
 setChunk ($chunkX, $chunkZ, FullChunk $chunk)
 
 getName ()
 
 getTime ()
 
 setTime ($value)
 
 getSeed ()
 
 setSeed ($value)
 
 getSpawn ()
 
 setSpawn (Vector3 $pos)
 
 getLoadedChunks ()
 
 doGarbageCollection ()
 
 getLevel ()
 
 close ()
 

Static Public Member Functions

static getProviderName ()
 
static getProviderOrder ()
 
static usesChunkSection ()
 
static isValid ($path)
 
static generate ($path, $name, $seed, $generator, array $options=[])
 
static createChunkSection ($Y)
 

Data Fields

const ORDER_YZX = 0
 
const ORDER_ZXY = 1
 

Constructor & Destructor Documentation

__construct ( Level  $level,
  $path 
)
Parameters
Level$level
string$path

Implemented in LevelDB, and BaseLevelProvider.

Member Function Documentation

static createChunkSection (   $Y)
static
Parameters
$Y0-7
Returns
ChunkSection

Implemented in LevelDB, McRegion, and Anvil.

static generate (   $path,
  $name,
  $seed,
  $generator,
array  $options = [] 
)
static

Generate the needed files in the path given

Parameters
string$path
string$name
int$seed
string$generator
array[]$options

Implemented in LevelDB, and McRegion.

getChunk (   $X,
  $Z,
  $create = false 
)

Gets the Chunk object This method must be implemented by all the level formats.

Parameters
int$Xabsolute Chunk X value
int$Zabsolute Chunk Z value
bool$createWhether to generate the chunk if it does not exist
Returns
FullChunk|Chunk

Implemented in LevelDB, McRegion, and Anvil.

getGenerator ( )

Returns the generator name

Returns
string

Implemented in LevelDB, and McRegion.

getGeneratorOptions ( )
Returns
array

Implemented in LevelDB, and McRegion.

getLevel ( )
Returns
Level

Implemented in BaseLevelProvider.

getLoadedChunks ( )
Returns
FullChunk|Chunk[]

Implemented in LevelDB, and McRegion.

getName ( )
Returns
string

Implemented in BaseLevelProvider.

getPath ( )
Returns
string

Implemented in BaseLevelProvider.

static getProviderName ( )
static

Returns the full provider name, like "anvil" or "mcregion", will be used to find the correct format.

Returns
string

Implemented in LevelDB, McRegion, and Anvil.

static getProviderOrder ( )
static
Returns
int

Implemented in LevelDB, McRegion, and Anvil.

getSeed ( )
Returns
int

Implemented in BaseLevelProvider.

getSpawn ( )
Returns
Vector3

Implemented in BaseLevelProvider.

getTime ( )
Returns
int

Implemented in BaseLevelProvider.

isChunkGenerated (   $X,
  $Z 
)
Parameters
int$X
int$Z
Returns
bool

Implemented in LevelDB, McRegion, and Anvil.

isChunkLoaded (   $X,
  $Z 
)
Parameters
int$X
int$Z
Returns
bool

Implemented in LevelDB, and McRegion.

isChunkPopulated (   $X,
  $Z 
)
Parameters
int$X
int$Z
Returns
bool

Implemented in LevelDB, and McRegion.

static isValid (   $path)
static

Tells if the path is a valid level. This must tell if the current format supports opening the files in the directory

Parameters
string$path
Returns
true

Implemented in LevelDB, McRegion, and Anvil.

loadChunk (   $X,
  $Z,
  $create = false 
)
Parameters
int$X
int$Z
bool$create
Returns
bool

Implemented in LevelDB, and McRegion.

requestChunkTask (   $x,
  $z 
)

Requests a MC: PE network chunk to be sent

Parameters
int$x
int$z
Returns
|null

Implemented in LevelDB, McRegion, and Anvil.

saveChunk (   $X,
  $Z 
)
Parameters
int$X
int$Z

Implemented in LevelDB, and McRegion.

setChunk (   $chunkX,
  $chunkZ,
FullChunk  $chunk 
)
Parameters
int$chunkX
int$chunkZ
FullChunk$chunk
Returns
mixed

Implemented in LevelDB, McRegion, and Anvil.

setSeed (   $value)
Parameters
int$value

Implemented in BaseLevelProvider.

setSpawn ( Vector3  $pos)
Parameters
Vector3$pos

Implemented in BaseLevelProvider.

setTime (   $value)
Parameters
int$value

Implemented in BaseLevelProvider.

unloadChunk (   $X,
  $Z,
  $safe = true 
)
Parameters
int$X
int$Z
bool$safe
Returns
bool

Implemented in LevelDB, and McRegion.

static usesChunkSection ( )
static
Returns
bool

Implemented in LevelDB, McRegion, and Anvil.


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