BedrockWorldData
extends BaseNbtWorldData
in package
Table of Contents
- CURRENT_STORAGE_VERSION = 8
- GENERATOR_FLAT = 2
- GENERATOR_INFINITE = 1
- GENERATOR_LIMITED = 0
- $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
Constants
CURRENT_STORAGE_VERSION
public
mixed
CURRENT_STORAGE_VERSION
= 8
GENERATOR_FLAT
public
mixed
GENERATOR_FLAT
= 2
GENERATOR_INFINITE
public
mixed
GENERATOR_INFINITE
= 1
GENERATOR_LIMITED
public
mixed
GENERATOR_LIMITED
= 0
Properties
$compoundTag
protected
CompoundTag
$compoundTag
$dataPath
protected
string
$dataPath
Methods
__construct()
public
__construct(string $dataPath) : mixed
Parameters
- $dataPath : string
Tags
Return values
mixed —generate()
public
static generate(string $path, string $name, WorldCreationOptions $options) : void
Parameters
- $path : string
- $name : string
- $options : WorldCreationOptions
Return values
void —getCompoundTag()
public
getCompoundTag() : CompoundTag
Return values
CompoundTag —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 —getName()
public
getName() : string
Return values
string —getRainLevel()
public
getRainLevel() : float
Return values
float —getRainTime()
public
getRainTime() : int
Return values
int —getSeed()
public
getSeed() : int
Return values
int —getSpawn()
public
getSpawn() : Vector3
Return values
Vector3 —getTime()
public
getTime() : int
Return values
int —save()
public
save() : void
Return values
void —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 —setSpawn()
public
setSpawn(Vector3 $pos) : void
Parameters
- $pos : Vector3
Return values
void —setTime()
public
setTime(int $value) : void
Parameters
- $value : int
Return values
void —fix()
protected
fix() : void
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
load()
protected
load() : CompoundTag