0.9.x setentitymotion packet added

This commit is contained in:
GameHerobrine 2023-02-21 11:42:37 +03:00
parent 532acb549d
commit 6cbc3824f3
7 changed files with 20 additions and 44 deletions

View file

@ -1,10 +1,7 @@
<?php
class SetEntityMotionPacket extends RakNetDataPacket{
public $eid;
public $speedX;
public $speedY;
public $speedZ;
public $entities;
public function pid(){
return ProtocolInfo::SET_ENTITY_MOTION_PACKET;
@ -16,10 +13,13 @@ class SetEntityMotionPacket extends RakNetDataPacket{
public function encode(){
$this->reset();
$this->putInt($this->eid);
$this->putShort((int) ($this->speedX * 400));
$this->putShort((int) ($this->speedY * 400));
$this->putShort((int) ($this->speedZ * 400));
$this->putInt(count($this->entities));
foreach($this->entities as $d){
$this->putInt($d[0]);
$this->putShort((int) ($d[1]*8000));
$this->putShort((int) ($d[2]*8000));
$this->putShort((int) ($d[3]*8000));
}
}
}
}