mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Added PhpDoc for packet field types and changed float x,y,z to Vector3
This commit is contained in:
@ -26,24 +26,25 @@ namespace pocketmine\network\mcpe\protocol;
|
||||
#include <rules/DataPacket.h>
|
||||
|
||||
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\network\mcpe\NetworkSession;
|
||||
|
||||
class SetEntityMotionPacket extends DataPacket{
|
||||
const NETWORK_ID = ProtocolInfo::SET_ENTITY_MOTION_PACKET;
|
||||
|
||||
/** @var int */
|
||||
public $entityRuntimeId;
|
||||
public $motionX;
|
||||
public $motionY;
|
||||
public $motionZ;
|
||||
/** @var Vector3 */
|
||||
public $motion;
|
||||
|
||||
protected function decodePayload(){
|
||||
$this->entityRuntimeId = $this->getEntityRuntimeId();
|
||||
$this->getVector3f($this->motionX, $this->motionY, $this->motionZ);
|
||||
$this->motion = $this->getVector3Obj();
|
||||
}
|
||||
|
||||
protected function encodePayload(){
|
||||
$this->putEntityRuntimeId($this->entityRuntimeId);
|
||||
$this->putVector3f($this->motionX, $this->motionY, $this->motionZ);
|
||||
$this->putVector3Obj($this->motion);
|
||||
}
|
||||
|
||||
public function handle(NetworkSession $session) : bool{
|
||||
|
Reference in New Issue
Block a user