41 private static function make() :
self{
43 Filesystem::fileGetContents(BedrockDataFiles::BLOCK_ID_TO_ITEM_ID_MAP_JSON),
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;