BlockStateData
Contains the common information found in a serialized blockstate.
Constants
CURRENT_VERSION
php
public const CURRENT_VERSION = \pocketmine\data\bedrock\WorldDataVersions::BLOCK_STATESTAG_NAME
php
public const TAG_NAME = "name"TAG_STATES
php
public const TAG_STATES = "states"TAG_VERSION
php
public const TAG_VERSION = "version"Methods
__construct()
php
public function __construct(string $name, array $states, int $version)current()
php
public static function current(string $name, array $states) : selfequals()
php
public function equals(self $that) : boolfromNbt()
php
public static function fromNbt(\pocketmine\nbt\tag\CompoundTag $nbt) : selfgetName()
php
public function getName() : stringgetState()
php
public function getState(string $name) : ?\pocketmine\nbt\tag\TaggetStates()
php
public function getStates() : arraygetVersion()
php
public function getVersion() : intgetVersionAsString()
php
public function getVersionAsString() : stringtoNbt()
php
public function toNbt() : \pocketmine\nbt\tag\CompoundTagEncodes the blockstate as a TAG_Compound, but with extra PM-specific metadata, used for fixing bugs in old saved data. This should be used for anything saved to disk.
toVanillaNbt()
php
public function toVanillaNbt() : \pocketmine\nbt\tag\CompoundTagEncodes the blockstate as a TAG_Compound, exactly as it would be in vanilla Bedrock.
