Documentation

BaseNbtWorldData
in package
implements WorldData

Interfaces, Classes, Traits and Enums

WorldData

Table of Contents

$compoundTag  : CompoundTag
$dataPath  : string
__construct()  : mixed
getCompoundTag()  : CompoundTag
getGenerator()  : string
Returns the generator name
getGeneratorOptions()  : string
getName()  : string
getSeed()  : int
getSpawn()  : Vector3
getTime()  : int
setSpawn()  : void
setTime()  : void
fix()  : void
hackyFixForGeneratorClasspathInLevelDat()  : null|string
Hack to fix worlds broken previously by older versions of PocketMine-MP which incorrectly saved classpaths of generators into level.dat on imported (not generated) worlds.
load()  : CompoundTag

Properties

Methods

getGenerator()

Returns the generator name

public getGenerator() : string
Return values
string

getGeneratorOptions()

public getGeneratorOptions() : string
Return values
string

setTime()

public setTime(int $value) : void
Parameters
$value : int
Return values
void

hackyFixForGeneratorClasspathInLevelDat()

Hack to fix worlds broken previously by older versions of PocketMine-MP which incorrectly saved classpaths of generators into level.dat on imported (not generated) worlds.

protected static hackyFixForGeneratorClasspathInLevelDat(string $className) : null|string

This should only have affected leveldb worlds as far as I know, because PC format worlds include the generatorName tag by default. However, MCPE leveldb ones didn't, and so they would get filled in with something broken.

This bug took a long time to get found because previously the generator manager would just return the default generator silently on failure to identify the correct generator, which caused lots of unexpected bugs.

Only classnames which were written into the level.dat from "fixing" the level data are included here. These are hardcoded to avoid problems fixing broken worlds in the future if these classes get moved, renamed or removed.

Parameters
$className : string

Classname saved in level.dat

Return values
null|string

Name of the correct generator to replace the broken value

Search results