Skip to content

BaseNbtWorldData ​

abstract class · pocketmine\world\format\io\data\BaseNbtWorldData · source

Implements WorldData

Constants ​

TAG_GENERATOR_NAME protected ​

php
protected const TAG_GENERATOR_NAME = "generatorName"

TAG_GENERATOR_OPTIONS protected ​

php
protected const TAG_GENERATOR_OPTIONS = "generatorOptions"

TAG_LEVEL_NAME protected ​

php
protected const TAG_LEVEL_NAME = "LevelName"

TAG_RANDOM_SEED protected ​

php
protected const TAG_RANDOM_SEED = "RandomSeed"

TAG_SPAWN_X protected ​

php
protected const TAG_SPAWN_X = "SpawnX"

TAG_SPAWN_Y protected ​

php
protected const TAG_SPAWN_Y = "SpawnY"

TAG_SPAWN_Z protected ​

php
protected const TAG_SPAWN_Z = "SpawnZ"

TAG_TIME protected ​

php
protected const TAG_TIME = "Time"

Properties ​

$compoundTag protected ​

php
protected \pocketmine\nbt\tag\CompoundTag $compoundTag

$dataPath ​

php
public string $dataPath

Methods ​

__construct() ​

php
public function __construct(string $dataPath)

fix() protected ​

php
abstract protected function fix() : void

getCompoundTag() ​

php
public function getCompoundTag() : \pocketmine\nbt\tag\CompoundTag

getGenerator() ​

php
public function getGenerator() : string

getGeneratorOptions() ​

php
public function getGeneratorOptions() : string

getName() ​

php
public function getName() : string

getSeed() ​

php
public function getSeed() : int

getSpawn() ​

php
public function getSpawn() : \pocketmine\math\Vector3

getTime() ​

php
public function getTime() : int

hackyFixForGeneratorClasspathInLevelDat() protected ​

php
protected static function hackyFixForGeneratorClasspathInLevelDat(string $className) : ?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.

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.

load() protected ​

php
abstract protected function load() : \pocketmine\nbt\tag\CompoundTag

setName() ​

php
public function setName(string $value) : void

setSpawn() ​

php
public function setSpawn(\pocketmine\math\Vector3 $pos) : void

setTime() ​

php
public function setTime(int $value) : void

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.