Contains the common information found in a serialized blockstate.
Definition at line 38 of file BlockStateData.php.
◆ __construct()
pocketmine\data\bedrock\block\BlockStateData::__construct |
( |
private string | $name, |
|
|
private array | $states, |
|
|
private int | $version ) |
- Parameters
-
Tag[] | $states | @phpstan-param array<string, Tag> $states |
Definition at line 59 of file BlockStateData.php.
◆ current()
static pocketmine\data\bedrock\block\BlockStateData::current |
( |
string | $name, |
|
|
array | $states ) |
|
static |
- Parameters
-
Tag[] | $states | @phpstan-param array<string, Tag> $states |
Definition at line 69 of file BlockStateData.php.
◆ equals()
pocketmine\data\bedrock\block\BlockStateData::equals |
( |
self | $that | ) |
|
◆ fromNbt()
static pocketmine\data\bedrock\block\BlockStateData::fromNbt |
( |
CompoundTag | $nbt | ) |
|
|
static |
◆ getName()
pocketmine\data\bedrock\block\BlockStateData::getName |
( |
| ) |
|
◆ getState()
pocketmine\data\bedrock\block\BlockStateData::getState |
( |
string | $name | ) |
|
◆ getStates()
pocketmine\data\bedrock\block\BlockStateData::getStates |
( |
| ) |
|
◆ getVersion()
pocketmine\data\bedrock\block\BlockStateData::getVersion |
( |
| ) |
|
◆ getVersionAsString()
pocketmine\data\bedrock\block\BlockStateData::getVersionAsString |
( |
| ) |
|
◆ toNbt()
pocketmine\data\bedrock\block\BlockStateData::toNbt |
( |
| ) |
|
Encodes 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.
Definition at line 135 of file BlockStateData.php.
◆ toVanillaNbt()
pocketmine\data\bedrock\block\BlockStateData::toVanillaNbt |
( |
| ) |
|
Encodes the blockstate as a TAG_Compound, exactly as it would be in vanilla Bedrock.
Definition at line 120 of file BlockStateData.php.
◆ CURRENT_VERSION
const pocketmine\data\bedrock\block\BlockStateData::CURRENT_VERSION |
Initial value:=
(1 << 24) |
(21 << 16) |
(40 << 8) |
(1)
Bedrock version of the most recent backwards-incompatible change to blockstates.
This is not the same as current game version. It should match the numbers in the newest blockstate upgrade schema used in BedrockBlockUpgradeSchema.
Definition at line 45 of file BlockStateData.php.
◆ TAG_NAME
const pocketmine\data\bedrock\block\BlockStateData::TAG_NAME = "name" |
◆ TAG_STATES
const pocketmine\data\bedrock\block\BlockStateData::TAG_STATES = "states" |
◆ TAG_VERSION
const pocketmine\data\bedrock\block\BlockStateData::TAG_VERSION = "version" |
The documentation for this class was generated from the following file: