Documentation

JavaWorldData extends BaseNbtWorldData
in package

Table of Contents

$compoundTag  : CompoundTag
$dataPath  : string
__construct()  : mixed
generate()  : void
getCompoundTag()  : CompoundTag
getDifficulty()  : int
getGenerator()  : string
Returns the generator name
getGeneratorOptions()  : string
getLightningLevel()  : float
getLightningTime()  : int
getName()  : string
getRainLevel()  : float
getRainTime()  : int
getSeed()  : int
getSpawn()  : Vector3
getTime()  : int
save()  : void
setDifficulty()  : void
setLightningLevel()  : void
setLightningTime()  : void
setRainLevel()  : void
setRainTime()  : void
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

getDifficulty()

public getDifficulty() : int
Return values
int

getGenerator()

Returns the generator name

public getGenerator() : string
Return values
string

getGeneratorOptions()

public getGeneratorOptions() : string
Return values
string

getLightningLevel()

public getLightningLevel() : float
Return values
float

getLightningTime()

public getLightningTime() : int
Return values
int

getRainLevel()

public getRainLevel() : float
Return values
float

getRainTime()

public getRainTime() : int
Return values
int

setDifficulty()

public setDifficulty(int $difficulty) : void
Parameters
$difficulty : int
Return values
void

setLightningLevel()

public setLightningLevel(float $level) : void
Parameters
$level : float
Return values
void

setLightningTime()

public setLightningTime(int $ticks) : void
Parameters
$ticks : int
Return values
void

setRainLevel()

public setRainLevel(float $level) : void
Parameters
$level : float
Return values
void

setRainTime()

public setRainTime(int $ticks) : void
Parameters
$ticks : int
Return values
void

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