22declare(strict_types=1);
24namespace pocketmine\data\bedrock\item;
29use pocketmine\utils\SingletonTrait;
30use
function array_flip;
32use
function json_decode;
33use
const JSON_THROW_ON_ERROR;
41 private static function make() :
self{
45 flags: JSON_THROW_ON_ERROR
51 return new self($map);
58 private array $itemToBlockId;
65 $this->itemToBlockId = array_flip($this->blockToItemId);
68 public function lookupItemId(
string $blockId) : ?string{
69 return $this->blockToItemId[$blockId] ?? null;
72 public function lookupBlockId(
string $itemId) : ?string{
73 return $this->itemToBlockId[$itemId] ?? null;
__construct(private array $blockToItemId)
static fileGetContents(string $fileName, bool $useIncludePath=false, $context=null, int $offset=0, ?int $length=null)