decodeRotation($r); } protected function encodeState(BlockDataWriter $w) : void{ parent::encodeState($w); $this->encodeRotation($w); } protected function getSupportingFace() : int{ return Facing::DOWN; } public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{ if($face !== Facing::UP){ return false; } if($player !== null){ $this->rotation = self::getRotationFromYaw($player->getLocation()->getYaw()); } return parent::place($tx, $item, $blockReplace, $blockClicked, $face, $clickVector, $player); } }