inverted ? $this->idInfo->getSecondId() : parent::getId(); } protected function writeStateToMeta() : int{ return $this->power; } public function readStateFromData(int $id, int $stateMeta) : void{ $this->power = BlockDataValidator::readBoundedInt("power", $stateMeta, 0, 15); $this->inverted = $id === $this->idInfo->getSecondId(); } public function getStateBitmask() : int{ return 0b1111; } public function isInverted() : bool{ return $this->inverted; } /** * @param bool $inverted * * @return $this */ public function setInverted(bool $inverted = true) : self{ $this->inverted = $inverted; return $this; } public function getHardness() : float{ return 0.2; } public function getFuelTime() : int{ return 300; } public function getToolType() : int{ return BlockToolType::TYPE_AXE; } protected function recalculateBoundingBox() : ?AxisAlignedBB{ return AxisAlignedBB::one()->trim(Facing::UP, 0.5); } public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null) : bool{ $this->inverted = !$this->inverted; $this->level->setBlock($this, $this); return true; } //TODO }