PocketMine-MP 5.15.1 git-5ef247620a7c6301a849b54e5ef1009217729fc8
pocketmine\world\format\io\data\BedrockWorldData Class Reference
+ Inheritance diagram for pocketmine\world\format\io\data\BedrockWorldData:
+ Collaboration diagram for pocketmine\world\format\io\data\BedrockWorldData:

Public Member Functions

 getCompoundTag ()
 
 getDifficulty ()
 
 getGenerator ()
 
 getGeneratorOptions ()
 
 getLightningLevel ()
 
 getLightningTime ()
 
 getName ()
 
 getRainLevel ()
 
 getRainTime ()
 
 getSeed ()
 
 getSpawn ()
 
 getTime ()
 
 save ()
 
 setDifficulty (int $difficulty)
 
 setLightningLevel (float $level)
 
 setLightningTime (int $ticks)
 
 setName (string $value)
 
 setRainLevel (float $level)
 
 setRainTime (int $ticks)
 
 setSpawn (Vector3 $pos)
 
 setTime (int $value)
 

Static Public Member Functions

static generate (string $path, string $name, WorldCreationOptions $options)
 

Public Attributes

const CURRENT_CLIENT_VERSION_TARGET
 
const CURRENT_STORAGE_NETWORK_VERSION = 671
 
const CURRENT_STORAGE_VERSION = 10
 
const GENERATOR_FLAT = 2
 
const GENERATOR_INFINITE = 1
 
const GENERATOR_LIMITED = 0
 

Protected Member Functions

 fix ()
 
 load ()
 

Static Protected Member Functions

static hackyFixForGeneratorClasspathInLevelDat (string $className)
 

Protected Attributes

CompoundTag $compoundTag
 
const TAG_GENERATOR_NAME = "generatorName"
 
const TAG_GENERATOR_OPTIONS = "generatorOptions"
 
const TAG_LEVEL_NAME = "LevelName"
 
const TAG_RANDOM_SEED = "RandomSeed"
 
const TAG_SPAWN_X = "SpawnX"
 
const TAG_SPAWN_Y = "SpawnY"
 
const TAG_SPAWN_Z = "SpawnZ"
 
const TAG_TIME = "Time"
 

Detailed Description

Definition at line 51 of file BedrockWorldData.php.

Member Function Documentation

◆ fix()

pocketmine\world\format\io\data\BedrockWorldData::fix ( )
protected
Exceptions
CorruptedWorldException
UnsupportedWorldFormatException

Reimplemented from pocketmine\world\format\io\data\BaseNbtWorldData.

Definition at line 177 of file BedrockWorldData.php.

◆ generate()

static pocketmine\world\format\io\data\BedrockWorldData::generate ( string  $path,
string  $name,
WorldCreationOptions  $options 
)
static

Definition at line 90 of file BedrockWorldData.php.

◆ getCompoundTag()

pocketmine\world\format\io\data\BaseNbtWorldData::getCompoundTag ( )
inherited

Definition at line 109 of file BaseNbtWorldData.php.

◆ getDifficulty()

pocketmine\world\format\io\data\BedrockWorldData::getDifficulty ( )

Returns the world difficulty. This will be one of the World constants.

Implements pocketmine\world\format\io\WorldData.

Definition at line 219 of file BedrockWorldData.php.

◆ getGenerator()

pocketmine\world\format\io\data\BaseNbtWorldData::getGenerator ( )
inherited

Returns the generator name

Implements pocketmine\world\format\io\WorldData.

Definition at line 123 of file BaseNbtWorldData.php.

◆ getGeneratorOptions()

pocketmine\world\format\io\data\BaseNbtWorldData::getGeneratorOptions ( )
inherited

Implements pocketmine\world\format\io\WorldData.

Definition at line 127 of file BaseNbtWorldData.php.

◆ getLightningLevel()

pocketmine\world\format\io\data\BedrockWorldData::getLightningLevel ( )
Returns
float 0.0 - 1.0

Implements pocketmine\world\format\io\WorldData.

Definition at line 251 of file BedrockWorldData.php.

◆ getLightningTime()

pocketmine\world\format\io\data\BedrockWorldData::getLightningTime ( )

Returns the time in ticks to the next lightning level change.

Implements pocketmine\world\format\io\WorldData.

Definition at line 243 of file BedrockWorldData.php.

◆ getName()

pocketmine\world\format\io\data\BaseNbtWorldData::getName ( )
inherited

Implements pocketmine\world\format\io\WorldData.

Definition at line 115 of file BaseNbtWorldData.php.

◆ getRainLevel()

pocketmine\world\format\io\data\BedrockWorldData::getRainLevel ( )
Returns
float 0.0 - 1.0

Implements pocketmine\world\format\io\WorldData.

Definition at line 235 of file BedrockWorldData.php.

◆ getRainTime()

pocketmine\world\format\io\data\BedrockWorldData::getRainTime ( )

Returns the time in ticks to the next rain level change.

Implements pocketmine\world\format\io\WorldData.

Definition at line 227 of file BedrockWorldData.php.

◆ getSeed()

pocketmine\world\format\io\data\BaseNbtWorldData::getSeed ( )
inherited

Implements pocketmine\world\format\io\WorldData.

Definition at line 131 of file BaseNbtWorldData.php.

◆ getSpawn()

pocketmine\world\format\io\data\BaseNbtWorldData::getSpawn ( )
inherited

Implements pocketmine\world\format\io\WorldData.

Definition at line 146 of file BaseNbtWorldData.php.

◆ getTime()

pocketmine\world\format\io\data\BaseNbtWorldData::getTime ( )
inherited

Implements pocketmine\world\format\io\WorldData.

Definition at line 135 of file BaseNbtWorldData.php.

◆ hackyFixForGeneratorClasspathInLevelDat()

static pocketmine\world\format\io\data\BaseNbtWorldData::hackyFixForGeneratorClasspathInLevelDat ( string  $className)
staticprotectedinherited

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.

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
string$classNameClassname saved in level.dat
Returns
null|string Name of the correct generator to replace the broken value

Definition at line 95 of file BaseNbtWorldData.php.

◆ load()

pocketmine\world\format\io\data\BedrockWorldData::load ( )
protected
Exceptions
CorruptedWorldException
UnsupportedWorldFormatException

Reimplemented from pocketmine\world\format\io\data\BaseNbtWorldData.

Definition at line 141 of file BedrockWorldData.php.

◆ save()

pocketmine\world\format\io\data\BedrockWorldData::save ( )

Saves information about the world state, such as weather, time, etc.

Implements pocketmine\world\format\io\WorldData.

Definition at line 208 of file BedrockWorldData.php.

◆ setDifficulty()

pocketmine\world\format\io\data\BedrockWorldData::setDifficulty ( int  $difficulty)

Sets the world difficulty.

Implements pocketmine\world\format\io\WorldData.

Definition at line 223 of file BedrockWorldData.php.

◆ setLightningLevel()

pocketmine\world\format\io\data\BedrockWorldData::setLightningLevel ( float  $level)
Parameters
float$level0.0 - 1.0

Implements pocketmine\world\format\io\WorldData.

Definition at line 255 of file BedrockWorldData.php.

◆ setLightningTime()

pocketmine\world\format\io\data\BedrockWorldData::setLightningTime ( int  $ticks)

Sets the time in ticks to the next lightning level change.

Implements pocketmine\world\format\io\WorldData.

Definition at line 247 of file BedrockWorldData.php.

◆ setName()

pocketmine\world\format\io\data\BaseNbtWorldData::setName ( string  $value)
inherited

Implements pocketmine\world\format\io\WorldData.

Definition at line 119 of file BaseNbtWorldData.php.

◆ setRainLevel()

pocketmine\world\format\io\data\BedrockWorldData::setRainLevel ( float  $level)
Parameters
float$level0.0 - 1.0

Implements pocketmine\world\format\io\WorldData.

Definition at line 239 of file BedrockWorldData.php.

◆ setRainTime()

pocketmine\world\format\io\data\BedrockWorldData::setRainTime ( int  $ticks)

Sets the time in ticks to the next rain level change.

Implements pocketmine\world\format\io\WorldData.

Definition at line 231 of file BedrockWorldData.php.

◆ setSpawn()

pocketmine\world\format\io\data\BaseNbtWorldData::setSpawn ( Vector3  $pos)
inherited

Implements pocketmine\world\format\io\WorldData.

Definition at line 150 of file BaseNbtWorldData.php.

◆ setTime()

pocketmine\world\format\io\data\BaseNbtWorldData::setTime ( int  $value)
inherited

Implements pocketmine\world\format\io\WorldData.

Definition at line 142 of file BaseNbtWorldData.php.

Member Data Documentation

◆ $compoundTag

CompoundTag pocketmine\world\format\io\data\BaseNbtWorldData::$compoundTag
protectedinherited

Definition at line 44 of file BaseNbtWorldData.php.

◆ CURRENT_CLIENT_VERSION_TARGET

const pocketmine\world\format\io\data\BedrockWorldData::CURRENT_CLIENT_VERSION_TARGET
Initial value:
= [
1,
20,
80,
5,
0
]

Definition at line 55 of file BedrockWorldData.php.

◆ CURRENT_STORAGE_NETWORK_VERSION

const pocketmine\world\format\io\data\BedrockWorldData::CURRENT_STORAGE_NETWORK_VERSION = 671

Definition at line 54 of file BedrockWorldData.php.

◆ CURRENT_STORAGE_VERSION

const pocketmine\world\format\io\data\BedrockWorldData::CURRENT_STORAGE_VERSION = 10

Definition at line 53 of file BedrockWorldData.php.

◆ GENERATOR_FLAT

const pocketmine\world\format\io\data\BedrockWorldData::GENERATOR_FLAT = 2

Definition at line 65 of file BedrockWorldData.php.

◆ GENERATOR_INFINITE

const pocketmine\world\format\io\data\BedrockWorldData::GENERATOR_INFINITE = 1

Definition at line 64 of file BedrockWorldData.php.

◆ GENERATOR_LIMITED

const pocketmine\world\format\io\data\BedrockWorldData::GENERATOR_LIMITED = 0

Definition at line 63 of file BedrockWorldData.php.

◆ TAG_GENERATOR_NAME

const pocketmine\world\format\io\data\BaseNbtWorldData::TAG_GENERATOR_NAME = "generatorName"
protectedinherited

Definition at line 36 of file BaseNbtWorldData.php.

◆ TAG_GENERATOR_OPTIONS

const pocketmine\world\format\io\data\BaseNbtWorldData::TAG_GENERATOR_OPTIONS = "generatorOptions"
protectedinherited

Definition at line 37 of file BaseNbtWorldData.php.

◆ TAG_LEVEL_NAME

const pocketmine\world\format\io\data\BaseNbtWorldData::TAG_LEVEL_NAME = "LevelName"
protectedinherited

Definition at line 35 of file BaseNbtWorldData.php.

◆ TAG_RANDOM_SEED

const pocketmine\world\format\io\data\BaseNbtWorldData::TAG_RANDOM_SEED = "RandomSeed"
protectedinherited

Definition at line 38 of file BaseNbtWorldData.php.

◆ TAG_SPAWN_X

const pocketmine\world\format\io\data\BaseNbtWorldData::TAG_SPAWN_X = "SpawnX"
protectedinherited

Definition at line 40 of file BaseNbtWorldData.php.

◆ TAG_SPAWN_Y

const pocketmine\world\format\io\data\BaseNbtWorldData::TAG_SPAWN_Y = "SpawnY"
protectedinherited

Definition at line 41 of file BaseNbtWorldData.php.

◆ TAG_SPAWN_Z

const pocketmine\world\format\io\data\BaseNbtWorldData::TAG_SPAWN_Z = "SpawnZ"
protectedinherited

Definition at line 42 of file BaseNbtWorldData.php.

◆ TAG_TIME

const pocketmine\world\format\io\data\BaseNbtWorldData::TAG_TIME = "Time"
protectedinherited

Definition at line 39 of file BaseNbtWorldData.php.


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