use pocketmine\network\mcpe\NetworkSession; class AnimatePacket extends DataPacket{ const NETWORK_ID = ProtocolInfo::ANIMATE_PACKET; public $action; public $entityRuntimeId; public $float; //TODO (Boat rowing time?) public function decodePayload(){ $this->action = $this->getVarInt(); $this->entityRuntimeId = $this->getEntityRuntimeId(); if($this->action & 0x80){ $this->float = $this->getLFloat(); } } public function encodePayload(){ $this->putVarInt($this->action); $this->putEntityRuntimeId($this->entityRuntimeId); if($this->action & 0x80){ $this->putLFloat($this->float); } } public function handle(NetworkSession $session) : bool{ return $session->handleAnimate($this); } }