Skip to content

EnumFromRawStateMap ​

class · pocketmine\data\bedrock\block\convert\property\EnumFromRawStateMap · source

Implements StateMap

Methods ​

__construct() ​

php
public function __construct(string $class, \Closure $mapper, ?\Closure $aliasMapper = null)

getRawToValueMap() ​

php
public function getRawToValueMap() : array

int() ​

php
public static function int(string $class, \Closure $mapper, ?\Closure $aliasMapper = null) : self

Workaround PHPStan too-specific literal type inference - if it ever gets fixed we can get rid of these functions

printableValue() ​

php
public function printableValue(mixed $value) : string

rawToValue() ​

php
public function rawToValue(int|string $raw) : ?\UnitEnum

string() ​

php
public static function string(string $class, \Closure $mapper, ?\Closure $aliasMapper = null) : self

Workaround PHPStan too-specific literal type inference - if it ever gets fixed we can get rid of these functions

valueToRaw() ​

php
public function valueToRaw(mixed $value) : int|string

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